From: Runhang Li <runhang@posteo.net>
To: Ocaml Mailing List <caml-list@inria.fr>
Subject: [Caml-list] GADT and weak polymorphism
Date: Tue, 17 Nov 2015 10:14:03 -0800 [thread overview]
Message-ID: <B8C45D30-5709-4A8D-A21C-76197DE32389@posteo.net> (raw)
Hi, camels
Consider the following module:
module HList = struct
type (_, _) hlist =
| Empty : ('a, 'a) hlist
| Cons : 'c * ('a, 'b) hlist -> ('c -> 'a, 'b) hlist
let cons : type a b c. c -> (a, b) hlist -> (c -> a, b) hlist =
fun h tl -> Cons (h, tl)
let empty = Empty
let ( **> ) = cons
let l = '2' **> "str" **> empty
end
The type of ``l`` is ``(char -> string -> ‘_a, ‘_a) hlist``. I would like to know the reason that weak polymorphism shows up here.
Thank you
Kindly,
Runhang
next reply other threads:[~2015-11-17 18:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 18:14 Runhang Li [this message]
2015-11-19 9:09 ` Gabriel Scherer
2015-11-21 20:37 ` Jonas Jensen
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=B8C45D30-5709-4A8D-A21C-76197DE32389@posteo.net \
--to=runhang@posteo.net \
--cc=caml-list@inria.fr \
/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