caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN][PATCH+PPX] Curried constructor
@ 2015-09-04 22:58 Jun Furuse
  0 siblings, 0 replies; only message in thread
From: Jun Furuse @ 2015-09-04 22:58 UTC (permalink / raw)
  To: caml-list

Hi,

I wrote  curried-constr patch for OCaml 4.02.3.  It makes variant
constructors usable like functions.

For the type definition

  type t = Foo of int * float

we can write

    Foo   as    (fun (x,y) -> Foo (x,y))

ad

    !Foo  as   (fun x y -> Foo (x,y))


There are two ways to try this extension:  as a compiler modification,
and as a PPX preprocessor:

* opam switch 4.02.3+curried-constr   (as a patched compiler)
* opam install ppx_curried_constr       (as a PPX preprocessor)

Enjoy!

Jun

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-04 22:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 22:58 [Caml-list] [ANN][PATCH+PPX] Curried constructor Jun Furuse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).