caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] GADT and weak polymorphism
@ 2015-11-17 18:14 Runhang Li
  2015-11-19  9:09 ` Gabriel Scherer
  2015-11-21 20:37 ` Jonas Jensen
  0 siblings, 2 replies; 3+ messages in thread
From: Runhang Li @ 2015-11-17 18:14 UTC (permalink / raw)
  To: Ocaml Mailing List

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-21 20:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17 18:14 [Caml-list] GADT and weak polymorphism Runhang Li
2015-11-19  9:09 ` Gabriel Scherer
2015-11-21 20:37 ` Jonas Jensen

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).