Created
February 7, 2016 19:35
-
-
Save Heimdell/0b7521d949a67ba5c6ae 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 DataKinds, GADTs, KindSignatures #-} | |
data RedBlack :: (Bool -> *) where | |
Red :: RedBlack 'False -> RedBlack 'True | |
Black :: RedBlack a -> RedBlack b | |
Stop :: RedBlack a | |
test = Red $ Black $ Red $ Stop | |
--test1 = Red $ Red $ Stop | |
-- | |
-- causes: | |
-- src/Lol.hs:10:15: | |
-- Couldn't match type ‘'True’ with ‘'False’ | |
-- Expected type: RedBlack 'False | |
-- Actual type: RedBlack 'True | |
-- In the second argument of ‘($)’, namely ‘Red $ Stop’ | |
-- In the expression: Red $ Red $ Stop | |
-- In an equation for ‘test1’: test1 = Red $ Red $ Stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment