Last active
April 13, 2018 23:26
-
-
Save aljce/299606a6b3328f4360d230eb05198192 to your computer and use it in GitHub Desktop.
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 LambdaCase #-} | |
{-# LANGUAGE EmptyCase #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeInType #-} | |
module Pokemon where | |
import Data.Kind (Type) | |
import Data.Void (Void) | |
import Type.Reflection ((:~:)(..)) | |
data PokemonType = None | Fire | Water | Grass | |
data Pokemon (a :: PokemonType) (b :: PokemonType) where | |
Poke :: (a :~: b -> Void) -> Pokemon a b | |
bulbasaur :: Pokemon Grass None | |
bulbasaur= Poke (\case {}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.