[ create a new paste ] login | about

Link: http://codepad.org/7n69C5KC    [ raw code | output | fork ]

jleedev - Haskell, pasted on Jan 12:
1
2
3
4
5
6
7
8
9
data N = Z | S N deriving (Ord,Eq,Show)
instance Num N where
        x + Z = x
        x + (S y) = S (x + y)
        fromInteger 0 = Z
        fromInteger (n+1) = S (fromInteger n)

x = x + 1 :: N
main = print (x > 5)


Output:
1
True


Create a new paste based on this one


Comments: