caml-list - the Caml user's mailing list
 help / Atom feed
From: "Carette, Jacques" <>
To: Oleg <>, "" <>
Subject: RE: [Caml-list] Higher-kinded bounded polymorphism
Date: Tue, 14 Sep 2021 17:03:32 +0000
Message-ID: <YT3PR01MB4897D6C2B315954A0146D498B4DA9@YT3PR01MB4897.CANPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20210913122139.GA3696@Melchior.localnet>

This trick reminds me of a similar trick used by Goguen in OBJ.  See "Higher Order Functions Considered Unnecessary for Higher Order Programming" from 1987.

> -----Original Message-----
> From: <> On Behalf Of Oleg
> Sent: September 13, 2021 8:22 AM
> To:
> Subject: [Caml-list] Higher-kinded bounded polymorphism
> Abstraction over polymorphic types is something that one comes across from
> time to time, especially when implementing operations generic over collections,
> or embedding typed DSLs (particularly in tagless-final style). One immediately
> learns that OCaml does not have higher-kinded type variables (type variables that
> range over type constructors like list and array); does not permit type
> constructors appearing by themselves, without being applied to the right number
> of arguments; and restricts polymorphic types in other ways (e.g., not allowing
> them in type constraints of package types). One soon learns that the module
> system (using functors) is a way to realize higher-kinded polymorphism in OCaml.
> It takes longer to learn it is not the only way, however.
> The following web page is written to speed up this learning. It collects what I have
> learned and rediscovered on this topic, arranged into a single story and with new
> explanations and attributions (and occasionally, new variations).
> One interesting discovery is that some problems that ostensibly require higher-
> kinded polymorphism really do not.
> The article comes with the complete accompanying code.

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 12:22 Oleg
2021-09-14 17:03 ` Carette, Jacques [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YT3PR01MB4897D6C2B315954A0146D498B4DA9@YT3PR01MB4897.CANPRD01.PROD.OUTLOOK.COM \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox