Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to Haskell and its REPL
Search
Filippo Vitale
July 27, 2017
Programming
0
170
Introduction to Haskell and its REPL
Brief and gentle introduction to Haskell and its REPL
Filippo Vitale
July 27, 2017
Tweet
Share
More Decks by Filippo Vitale
See All by Filippo Vitale
Side-effects within the Business Logic core
filippovitale
1
210
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
180
Product and Sum types
filippovitale
0
150
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
410
AACS Ray Marching
filippovitale
0
190
Let’s Blend some Data Structures
filippovitale
0
130
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
310
Using Eta for what you don't like writing in Scala
filippovitale
0
1.6k
Come risolvere un puzzle crypto-aritmetico in Scala
filippovitale
0
230
Other Decks in Programming
See All in Programming
Dissecting and Reconstructing Ruby Syntactic Structures
ydah
2
1.2k
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
130
Make Parsers Compatible Using Automata Learning
makenowjust
2
5.7k
VitestのIn-Source Testingが便利
taro28
8
2.2k
実践Webフロントパフォーマンスチューニング
cp20
36
8.4k
REALITY コマンド作成チュートリアル
nishiuriraku
0
110
generative-ai-use-cases(GenU)の推しポイント ~2025年4月版~
hideg
1
310
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
1.1k
Making TCPSocket.new "Happy"!
coe401_
1
2k
七輪ライブラリー: Claude AI で作る Next.js アプリ
suneo3476
1
130
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
1
3.5k
Browser and UI #2 HTML/ARIA
ken7253
2
120
Featured
See All Featured
Unsuck your backbone
ammeep
670
57k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Fireside Chat
paigeccino
37
3.4k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Rails Girls Zürich Keynote
gr2m
94
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
9
760
KATA
mclloyd
29
14k
Code Reviewing Like a Champion
maltzj
523
40k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
4 Signs Your Business is Dying
shpigford
183
22k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Transcript
Introduction to Haskell and its REPL
None
$ docker run -it --rm \ mitchty/alpine-ghc ghci 1.
$ docker run -it --rm \ mitchty/alpine-ghc ghci docker pull
mitchty/alpine-ghc:latest 1.
▪ 1 + 2 ▪ 2^1000 ▪ (+) 1 2
▪ :t (+) ▪ :i (+) So... what now?
▪ (+) :: a -> a -> a Functions Everywhere
▪ [1, 2, 3] ▪ [1..] ▪ [1..10] ▪ [1,
1.25 .. 4.0] List
▪ (:) :: a -> [a] -> [a] ▪ (++)
:: [a] -> [a] -> [a] List
▪ head :: [a] -> a ▪ tail :: [a]
-> [a] ▪ take :: Int -> [a] -> [a] ▪ drop :: Int -> [a] -> [a] List
▪ map :: (a -> b) -> [a] -> [b]
▪ filter :: (a -> Bool) -> [a] -> [a] List
▪ :t <espression> ← type inspection ▪ :i <espression> ←
info ▪ :l <filename> ← load .hs file ▪ :r ← reload files GHCi
BYO Editor ▪ Spacemacs http://spacemacs.org/ ▪ Atom https://atom.io/ ▪ Visual
Studio https://code.visualstudio.com/
$ docker run -it --rm \ -v `pwd`:/root \ mitchty/alpine-ghc
ghci 2.
Wanna try an exercise together? Let’s reverse a list
Theorems for free! – Philip Walder, 1989 https://people.mpi-sws.org/~dreyer/tor/papers/wadler.pdf
▪ foo :: a -> a ▪ foo2 :: b
-> a ▪ foo3 :: a -> b -> a What’s the only possible implementation of `foo`?
None
Thanks! Any questions? @filippovitale