Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ex3
--ghc 8.0.1 /opt/ghc/8.0.1/lib/ghc-8.0.0.20160127/ main = print $ "Hello, world!" data Digit = Zero | One | Two deriving (Eq,Enum,Show) type Digits = [Digit] data Sign = Pos | Neg deriving (Eq,Show) newtype Numeral = Num (Sign,Digits) deriving (Eq,Show) canonize :: Numeral -> Numeral canonize n = n int2num :: Integer -> Numeral int2num n = Num(Pos, []) num2int :: Numeral -> Integer num2int n = 1
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Factorial in haskell
Knight Journey
NQueens
Bruteforce IEEE Floating Point Numbers
project euler 1, haskel
project euler 3, haskell
Kleintjes
Forkitup
project euler 8, haskell
equiv
Please log in to post a comment.