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
160
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
190
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
170
Product and Sum types
filippovitale
0
140
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
370
AACS Ray Marching
filippovitale
0
190
Let’s Blend some Data Structures
filippovitale
0
130
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
290
Using Eta for what you don't like writing in Scala
filippovitale
0
1.5k
Come risolvere un puzzle crypto-aritmetico in Scala
filippovitale
0
220
Other Decks in Programming
See All in Programming
Recoilを剥がしている話
kirik
5
6.8k
情報漏洩させないための設計
kubotak
3
320
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
480
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
840
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.4k
Exploring: Partial and Independent Composables
blackbracken
0
100
From Translations to Multi Dimension Entities
alexanderschranz
2
130
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
1
140
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Agile that works and the tools we love
rasmusluckow
328
21k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Rails Girls Zürich Keynote
gr2m
94
13k
How STYLIGHT went responsive
nonsquared
95
5.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Typedesign – Prime Four
hannesfritz
40
2.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Making the Leap to Tech Lead
cromwellryan
133
9k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
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