Created
September 23, 2016 03:05
-
-
Save wouter-swierstra/7eac78aaa45cec2602b4246ec1e06823 to your computer and use it in GitHub Desktop.
Haskell Symposium Lightning Talk
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
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help | |
Prelude> 1 + 2 | |
3 | |
Prelude> minimum(100,1) | |
1 | |
Prelude> minimum(1,100) | |
100 | |
Prelude> let splat = splitAt 5 [0..10] | |
Prelude> splat | |
([0,1,2,3,4],[5,6,7,8,9,10]) | |
Prelude> concat splat | |
[5,6,7,8,9,10] | |
Prelude> fmap (+1) [1,2] | |
[2,3] | |
Prelude> fmap (+1) (1,2) | |
(1,3) | |
Prelude> let xs = [(1,"hello"),(2,"world")] | |
Prelude> length "world" | |
5 | |
Prelude> length (lookup 2 xs) | |
1 | |
Prelude> let y = lookup 100 xs | |
Prelude> null y | |
True | |
Prelude> length y | |
0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's hilarious. we need more tools to print types. in excel, doing Alt + ~ (?) would show formulas and not numbers. We need an Alt + ~ which adds all the types, and can remove them as well when not needed.
Types are code.