[Haskell-cafe] Polykinded promoted types
t at tmh.cc
Mon Dec 8 23:04:27 UTC 2014
$ ghci -XDataKinds -XKindSignatures
Prelude> data K = K
Prelude> data Foo (a :: K) = Foo
Prelude> :kind Foo
Foo :: K -> *
Note that types with kinds other than * are uninhabited, so you can't write
a version of Maybe with that kind (because the Just constructor would
require a value that can't exist).
On Mon, Dec 8, 2014 at 2:52 PM, Gautier DI FOLCO <gautier.difolco at gmail.com>
> Hi all,
> Is there a way to get a Polykinded promoted type.
> For example with *Maybe* I get:
> data *Maybe* a = Just a | Nothing
> Prelude> :k *Maybe*
> *Maybe* :: ** -> **
> Is it possible to get a *k -> **? If so, how can I do that?
> Thanks in advance for your help,
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe