PROPOSAL: Make Data.Type.Bool.If polykinded
Oliver Charles
ollie at ocharles.org.uk
Tue Sep 2 06:11:58 UTC 2014
+1 - seems natural to me, and I can certainly see myself expecting it to be
just that in the near future.
- ocharles
On Mon, Sep 1, 2014 at 10:41 PM, Merijn Verstraaten <merijn at inconsistent.nl>
wrote:
> Ola!
>
> Currently we have:
>
> type family If cond tru fls where
> If True tru fls = tru
> If False tru fls = fls
>
> Unfortunately, this appears to turned into a monomorphicly kinded type
> family by GHC, which means it’s impossible to do
>
> foo :: If cond () (“Condition does not hold” ~ “”) => Foo -> Bar
>
> or similar fancy constraints.
>
> I hereby propose altering If to:
>
> type family If (cond :: Bool) (tru :: k) (fls :: k) :: k where
> If True tru fls = tru
> If False tru fls = fls
>
> Allowing it to work with kinds other than *.
>
> Discussion period: 2 weeks? Seems like a minor change.
>
> Cheers,
> Merijn
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140902/b8777d42/attachment.html>
More information about the Libraries
mailing list