From: Oleg <oleg@okmij.org>
To: edwin+ml-ocaml@etorok.net
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Clever typing for client-server communication?
Date: Sat, 25 Jul 2015 21:42:50 +0900 [thread overview]
Message-ID: <20150725124250.GA2259@Magus.sf-private> (raw)
In-Reply-To: <55B2A69F.2060104@etorok.net>
> > Once you have these types you might write type-level functions to
> > retrieve the components. Here's a function that retrieves the 'src'
> > component:
> >
> > type 'a src = 's constraint 'a = < src: 's; .. >
> This is very useful to know, thanks!
> It'd be interesting to know how you come up with these solutions :)
This is probably a folklore, but it was mentioned on this list more than
a decade ago by Jacques Garrigue. We have used this trick extensively
in
http://okmij.org/ftp/meta-programming/HPC.html#GE-generation
(see the description on p11 of the SCP-metamonads.pdf paper, and many
applications starting from p21)
next prev parent reply other threads:[~2015-07-25 12:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 11:01 Markus Weißmann
2015-07-24 11:20 ` Nicolas Ojeda Bar
2015-07-24 18:41 ` Mikhail Mandrykin
2015-07-24 20:23 ` octachron
2015-07-24 20:25 ` Jeremy Yallop
2015-07-24 20:57 ` Török Edwin
2015-07-25 12:42 ` Oleg [this message]
2015-07-25 15:55 ` mandrykin
2015-08-08 21:39 ` Markus Mottl
2015-08-09 13:04 ` Jacques Garrigue
Reply instructions:
You may reply publicly 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150725124250.GA2259@Magus.sf-private \
--to=oleg@okmij.org \
--cc=caml-list@inria.fr \
--cc=edwin+ml-ocaml@etorok.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox