Skip to content

Instantly share code, notes, and snippets.

@kkirsanov
Created December 16, 2011 11:31
Show Gist options
  • Save kkirsanov/1485731 to your computer and use it in GitHub Desktop.
Save kkirsanov/1485731 to your computer and use it in GitHub Desktop.
data Logic a where
I :: Int -> Logic Int
B :: Bool -> Logic Bool
lEqual :: Logic a -> Logic b -> Bool
lEqual (I x) (I y) = x == y
lEqual (B x) (B y) = x == y
lEqual _ _ = False
instance Eq (Logic a) where
(==) = lEqual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment