[Haskell-cafe] Intanciate data type

Corentin Dupont corentin.dupont at gmail.com
Mon Jul 4 20:43:43 UTC 2016


Hi all,
I have a data type looking like this:

data Foo e a
where

   Foo :: e →  Foo e a

I would like to instantiate it to make it equivalent to:

data Bar a
where

   A :: String    →  Bar Int
   B :: Maybe a     →  Bar a

How can I do that? With a functional dependency?
I probably need to change the definition of Foo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160704/863c7cc6/attachment.html>


More information about the Haskell-Cafe mailing list