Created
September 6, 2014 17:52
-
-
Save kokjo/fb7876b9e50511bd0c97 to your computer and use it in GitHub Desktop.
vardic
This file contains 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
class VardicSum r where | |
sums :: Integer -> r | |
instance VardicSum Integer where | |
sums x = x | |
instance (Integral a, VardicSum b) => VardicSum (a -> b) where | |
sums x y = sums (x + toInteger y) | |
main = do | |
putStr . show $ (sums 5 5 5 5 :: Integer) | |
putStr "\n" | |
putStr . show $ (sums 5 5 5 :: Integer) | |
putStr "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment