From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 6D8177EEAF for ; Fri, 18 Jan 2013 05:58:07 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lambda.q.q@gmail.com) identity=pra; client-ip=209.85.217.179; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of lambda.q.q@gmail.com designates 209.85.217.179 as permitted sender) identity=mailfrom; client-ip=209.85.217.179; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="lambda.q.q@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lb0-f179.google.com) identity=helo; client-ip=209.85.217.179; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="lambda.q.q@gmail.com"; x-sender="postmaster@mail-lb0-f179.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvUBAJ3V+FDRVdmzkWdsb2JhbABEhX64OhYOAQEBAQkJDQcSKYJMEwYBOQMNBSY0ASQBBQGIPAMPBJsIgnCPL4UfJw2IVQEFDI4EgykDiFuNMY5oP4FYgkQ X-IronPort-AV: E=Sophos;i="4.84,489,1355094000"; d="scan'208";a="190487327" Received: from mail-lb0-f179.google.com ([209.85.217.179]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Jan 2013 05:58:07 +0100 Received: by mail-lb0-f179.google.com with SMTP id gm13so2450158lbb.10 for ; Thu, 17 Jan 2013 20:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:mime-version :content-type; bh=4pj6+010GvvaL7Ocrn+D0A/11x8cRkJOXX6B5kO+CXY=; b=OY6M43Z9Egk4CH2qCDPUHNhKwz8yY+2fIS+dA6CzTBBCRRPL3Ex3Otzx2tRb09WtWz l9vm4TVPxlCKlMEV/xJZneYE36Quy2eCmTAqE1v9TM0s9LIkoUz4qQbujhAK1Gs0M0CF c/C1cR5Vqp2sDtArGb1SmiI+sE5bMdt+VYYehjTqBlc7+o8Ux40r392ar4CRTCkqg4ky mossz5u7V42PKria1cBYHri5I/PjPVxYvlmPzGwhwf8lWE1BO/wy5lMaJ4nyjV3NXwvF s5lgLlWOAJVrUdiIXtNeh/Ift3uo9d/83ppAmZC6TNFw1WLbhI2JniONQ2iQLTnwAKA0 LHbw== X-Received: by 10.112.10.3 with SMTP id e3mr3251333lbb.33.1358485086226; Thu, 17 Jan 2013 20:58:06 -0800 (PST) Received: from golf.niidar.ru.niidar.ru ([178.176.128.156]) by mx.google.com with ESMTPS id ns7sm1494166lab.5.2013.01.17.20.58.02 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 17 Jan 2013 20:58:04 -0800 (PST) Sender: Ivan Gotovchits From: Ivan Gotovchits To: caml-list@inria.fr Date: Fri, 18 Jan 2013 08:57:58 +0400 Message-ID: <871udjt7e1.fsf@golf.niidar.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Caml-list] Removing repeating code Hi! It was difficult to find a proper phrase for a subject field, sorry. But in ocaml it is really easier to formulate, so going right to the question. Are there any possibility to remove code dublicating in a following function: let f = let g = Array.length in function | Strings a -> g a | Floats a -> g a which have a type val f : value -> int where value is type value = | Strings of string array | Floats of float array May be there is some trick? Thanks in advance! -- (__) (oo) /------\/ / | || * /\---/\ ~~ ~~ ...."Have you mooed today?"...