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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Filippo Vitale
July 27, 2017
Programming
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to Haskell and its REPL
Brief and gentle introduction to Haskell and its REPL
Filippo Vitale
July 27, 2017
More Decks by Filippo Vitale
See All by Filippo Vitale
Side-effects within the Business Logic core
filippovitale
1
280
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
190
Product and Sum types
filippovitale
0
180
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
520
AACS Ray Marching
filippovitale
0
220
Let’s Blend some Data Structures
filippovitale
0
160
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
350
Using Eta for what you don't like writing in Scala
filippovitale
0
1.7k
Come risolvere un puzzle crypto-aritmetico in Scala
filippovitale
0
250
Other Decks in Programming
See All in Programming
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
380
Vite+ Unified Toolchain for the Web
naokihaba
0
600
Performance Engineering for Everyone
elenatanasoiu
0
250
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
450
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
820
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
270
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
320
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
250
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
330
関数型プログラミングのメリットって何だろう?
wanko_it
0
130
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
250
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
From π to Pie charts
rasagy
0
230
Why Our Code Smells
bkeepers
PRO
340
58k
RailsConf 2023
tenderlove
30
1.5k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
400
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
450
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
Producing Creativity
orderedlist
PRO
348
40k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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