From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0K6wxov020524 for ; Fri, 20 Jan 2012 07:58:59 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgBAC4PGU/RVdY0kGdsb2JhbABDnUGQMggiAQEBAQkJDQcUBCGBcgEBAQQSAhMZARsSCwEDDAYFCw0NISEBAREBBQEKEgYTCAoQh2KbWgqLaoJvhGs/iHECBQuDc4goBIg8jFyLAYMPPYQf X-IronPort-AV: E=Sophos;i="4.71,540,1320620400"; d="scan'208";a="128175092" Received: from mail-bk0-f52.google.com ([209.85.214.52]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Jan 2012 07:58:54 +0100 Received: by bkar19 with SMTP id r19so225310bka.39 for ; Thu, 19 Jan 2012 22:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=gJeiicEnevUXXEoUGfCgrhK3PKymzSTME2mXthAMEW0=; b=IJdMNwXbuC0MtQQ6fi0x1SFheYTMa2vJnJhP2NxgS0xF/D3fT35qW+6JU14PzaYYBb xGrQgHFYsJB6lgToYi+tQvmzjurDFWw1TwyjteEDGN6CIg4ZWIuHOzOKMUBf6spA+1dp lHZAn805ylkS1yi6AmXRLNvxgJohH6rtC4vCw= MIME-Version: 1.0 Received: by 10.204.141.14 with SMTP id k14mr10984893bku.67.1327042733693; Thu, 19 Jan 2012 22:58:53 -0800 (PST) Received: by 10.204.171.79 with HTTP; Thu, 19 Jan 2012 22:58:53 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Jan 2012 22:58:53 -0800 Message-ID: From: Martin DeMello To: Valentin ROBERT Cc: OCaml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id q0K6wxov020524 Subject: Re: [Caml-list] is there a more concise way to write this? thanks, that does reduce the potential explosion, which was my main concern. it even looks pleasant enough if you add a linebreak in the middle. martin On Thu, Jan 19, 2012 at 10:46 PM, Valentin ROBERT wrote: > I guess you can write it like: > > let a = (if out then [o] else []) @ (if value then [v] else []) > > But it's not particularly more pleasant to the eye. > Still it reduces the exponential explosion of the code, at a small > additional cost (the @), I believe. > > On Fri, Jan 20, 2012 at 07:38, Martin DeMello > wrote: >> >>      let a = match (out, value) with >>        (true, true)  -> [o; v] >>      | (false, true) -> [v] >>      | (true, false) -> [o] >>      | (false, false) -> [] >> >> -- >> Caml-list mailing list.  Subscription management and archives: >> https://sympa-roc.inria.fr/wws/info/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >> >