caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Polymorphic variant abbreviations
@ 2001-09-18 22:48 Patrick M Doane
  2001-09-19  0:05 ` Patrick M Doane
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Patrick M Doane @ 2001-09-18 22:48 UTC (permalink / raw)
  To: caml-list

I have some code that would like to use polymorphic type abbreviations
along with labels.  It seems to be not behaving quite like I expected.
What could I do to make this shorter:

  type a = [ `A ]

  let f ~a:(#a as a) = ...

I was hoping that I could use this:

  let f ~a:#a = ...

but then it says that 'a' is unbound.


I also find that the error messages are not as useful as they could be
with the type abbreviations. E.g:

  This expression has type ... but is here used with #a as 'a = 'a

Would it be hard to expand '#a' like this so I don't have to track down
the definition? 

  This expression has type ... but is here used with #a = [ `A ]

Thanks for any help or suggestions,
Patrick

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-09-19 16:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-18 22:48 [Caml-list] Polymorphic variant abbreviations Patrick M Doane
2001-09-19  0:05 ` Patrick M Doane
2001-09-19  8:37   ` Laurent Vibert
2001-09-19  8:56   ` Remi VANICAT
2001-09-19  8:01 ` Laurent Vibert
2001-09-19 16:35   ` Patrick M Doane
2001-09-19 12:45 ` Jacques Garrigue
2001-09-19 16:58   ` Patrick M Doane

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