From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p41I7jIZ004504 for ; Sun, 1 May 2011 20:07:48 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwBAG6gvU3RVdy0mGdsb2JhbACYVY0/CBQBAQEBAQgJDQcUJaUZgkKKfIIqg1Q0iF4BAQMGhXoEjnmKOjuDSQ X-IronPort-AV: E=Sophos;i="4.64,298,1301868000"; d="scan'208";a="98438300" Received: from mail-vx0-f180.google.com ([209.85.220.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 May 2011 20:07:48 +0200 Received: by vxk12 with SMTP id 12so6312388vxk.39 for ; Sun, 01 May 2011 11:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Vv5NG3M6AugLEUWIXWXSuyKKosh0Lz1N87CK6cJmDxs=; b=v84WlS6m3NlanH8ECUUFOj7uhVOlz+EJ9hC1gdfknSDHxJCPNPAycLdkD5ArLgqAT3 r+oAu0UFEzvsxMBr3qSOXlmRsqKR9laAYqwvGlkiRuqAaSnm/WZ5zdc/bZ81GMYaYKwl pltdXCeNyAV2mkqeiZsgDGXT+shTg1WzoJeH0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=R1PF038QFlcCRbgeAwbWlZJls7jV/3EheFYSKLDmzTQPfOk3BPb+5jQSmlsM/FkGC9 zJb/XY7kcAmkpaEAOUjuuHQGZQ/fQyRbcwD4xSpjM3bPGoWZHgjYSOkEeixZLpnKiOJ6 gTUbEWBFzmMmTjmWR0euD51KmxDSyZFsHraRM= MIME-Version: 1.0 Received: by 10.52.98.225 with SMTP id el1mr2131588vdb.174.1304273266857; Sun, 01 May 2011 11:07:46 -0700 (PDT) Received: by 10.52.181.39 with HTTP; Sun, 1 May 2011 11:07:46 -0700 (PDT) Date: Sun, 1 May 2011 14:07:46 -0400 Message-ID: From: Sen Horak To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: [Caml-list] Polymorphism question Hi, I am trying to model a situation in which a caller calls a combination of two functions: - The first is a postprocessor that depends on the invocation g: a -> 'b - The second is a higher order function: f: c x d x g -> 'b One could leave the application of 'g' to the caller, making f: c x d -> a. Then the caller would run: let res_a = f inp_c inp_d in my_g res_a But it would be nice to hide 'a' from the caller and have her call: let res_b = f inp_c inp_d my_g I guess I could use functors, and configure a generic f with a particular type of g. Does that seem right, and if so could there be a simper or easier way? Sen