Wired-in type class
Joachim Breitner
mail at joachim-breitner.de
Fri Aug 16 15:43:20 CEST 2013
Dear List,
I have some questions about the inner parts of GHC, where I need to
learn a lot. This is related to my attempts on newtype casting, but
should probably be kept separate from the conceptual discussions.
Say I need to create a wired-in type class, because it cannot be
represented in Haskell. The Core type constructor that will come out of
it will have one field of type ~R#, which is the reason why I cannot
write it in Haskell.
It seems that defining something wired-in is not a very local operation
that affects, at least primops.txt.pp and TysPrim.lhs. Does it affect
more?
It seems that there is not precedent of a wired-in type class. Is that
possible without touching too many parts of the compiler?
Or is it saner to just have "class NT a b" in a module in ghc-prim
without the constraint and use special magic when compiling that file to
add the required field to the data constructor representing the class?
(Similar to how the kind of ~ is adjusted during compilation?)
Greetings,
Joachim
--
Joachim “nomeata” Breitner
mail at joachim-breitner.de • http://www.joachim-breitner.de/
Jabber: nomeata at joachim-breitner.de • GPG-Key: 0x4743206C
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130816/4fdd9947/attachment.pgp>
More information about the ghc-devs
mailing list