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
180
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
220
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
430
AACS Ray Marching
filippovitale
0
200
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
童醫院敏捷轉型的實踐經驗
cclai999
0
190
Benchmark
sysong
0
250
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
500
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
250
VS Code Update for GitHub Copilot
74th
1
320
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
230
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
350
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
2
210
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
370
5つのアンチパターンから学ぶLT設計
narihara
1
110
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
11
2k
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
140
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.7k
Building an army of robots
kneath
306
45k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Unsuck your backbone
ammeep
671
58k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
Navigating Team Friction
lara
187
15k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Fireside Chat
paigeccino
37
3.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Music & Morning Musume
bryan
46
6.6k
Balancing Empowerment & Direction
lara
1
360
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
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