Last active
November 2, 2015 17:44
-
-
Save roberto/6eeed5511da1879bbd31 to your computer and use it in GitHub Desktop.
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
:t True | |
True :: Bool | |
:t 1 | |
1 :: Num a => a | |
:t [(1.2, "b", 'c'), (2.3, "d", 'e')] | |
[(1.2,"b",'c'),(2.3,"d",'e')] :: Fractional a => [(a,[Char],Char)] | |
inc :: Num a => a -> a | |
inc = (+) 1 | |
map inc [1,2,3,4] | |
if 1 == 2 then True else False | |
signum n | n > 0 = 1 | |
| n == 0 = 0 | |
| otherwise = -1 | |
True && b = b | |
False && _ = False | |
1:2:3:[] == [1,2,3] | |
head :: [a] -> a | |
head (x:_) = x | |
second :: [a] -> a | |
second (_:x:_) = x | |
map (\x -> x + 1) [1,2,3,4] | |
1+ 2 | |
(+) 1 2 | |
(1+) 2 | |
(+2) 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment