[Haskell-cafe] Polykinded promoted types

Taylor Hedberg 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>
wrote:

> 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,
> Regards.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141208/a8750eea/attachment.html>


More information about the Haskell-Cafe mailing list