Coercible class (Was: newtype wrappers)
mail at joachim-breitner.de
Sun Sep 15 21:44:07 UTC 2013
Am Sonntag, den 15.09.2013, 17:24 -0400 schrieb Richard Eisenberg:
> Because, from a user's point of view, defining
> > newtype Age = MkAge Int
> automatically creates Coercible instances
> > instance Coercible Age Int
> > instance Coercible Int Age
> and defining datatypes also creates instances. This looks like a
> user-visible language feature to me, and I think it should be
> documented in the manual.
not really; if you type ":info Coercible" you see that there are no
instances created. Just the type-checking of uses of coerce is a bit
I think the question is rather: Where would the user search for
documentation. And given that there are identifiers related to the
feature (Coercible, coercion), the haddocks for that are the natural
place to search. And as I’d like to avoid duplication, I’d not put the
docs somewhere else again.
I don’t mind adding a pointer from the “Special built-in functions”
section to the haddock docs, though, if you think it would be helpful.
e-Mail: mail at joachim-breitner.de
Jabber-ID: nomeata at joachim-breitner.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the ghc-devs