Skip to content

Instantly share code, notes, and snippets.

@wouter-swierstra
Created September 23, 2016 03:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wouter-swierstra/7eac78aaa45cec2602b4246ec1e06823 to your computer and use it in GitHub Desktop.
Save wouter-swierstra/7eac78aaa45cec2602b4246ec1e06823 to your computer and use it in GitHub Desktop.
Haskell Symposium Lightning Talk
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
@nrolland
Copy link

nrolland commented Oct 12, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment