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
200
0
Share
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
270
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
190
Product and Sum types
filippovitale
0
170
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
150
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
340
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
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
5
640
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
170
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
1
480
CSC307 Lecture 17
javiergs
PRO
0
240
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
410
AI時代になぜ書くのか
mutsumix
0
450
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
2.3k
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
340
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1k
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
0
100
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
2.2k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
200
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
270
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Abbi's Birthday
coloredviolet
2
7.7k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
390
How to Think Like a Performance Engineer
csswizardry
28
2.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
260
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
400
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
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