Created
September 14, 2018 20:59
-
-
Save dmwit/cf9154e425665bac2516ccf847971f36 to your computer and use it in GitHub Desktop.
Foo ('A | 'B)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE TypeApplications #-} | |
data K = A | B | C | |
data Foo a where | |
FooAny :: Foo a | |
FooAB :: Foo (Fam a) | |
FooC :: Foo C | |
type family Fam a where | |
Fam C = A | |
Fam x = x | |
example = FooAB @A |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment