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
200
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
390
AACS Ray Marching
filippovitale
0
190
Let’s Blend some Data Structures
filippovitale
0
130
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
300
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
230
Other Decks in Programming
See All in Programming
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
550
Software Architecture
hschwentner
6
2.1k
Djangoアプリケーション 運用のリアル 〜問題発生から可視化、最適化への道〜 #pyconshizu
kashewnuts
1
250
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
110
仕様変更に耐えるための"今の"DRY原則を考える / Rethinking the "Don't repeat yourself" for resilience to specification changes
mkmk884
0
120
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
6
4k
Compose でデザインと実装の差異を減らすための取り組み
oidy
1
310
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
210
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
Lottieアニメーションをカスタマイズしてみた
tahia910
0
130
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
1
230
Featured
See All Featured
A designer walks into a library…
pauljervisheath
205
24k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
How to Ace a Technical Interview
jacobian
276
23k
We Have a Design System, Now What?
morganepeng
51
7.4k
Speed Design
sergeychernyshev
27
790
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Embracing the Ebb and Flow
colly
84
4.6k
Done Done
chrislema
182
16k
Code Reviewing Like a Champion
maltzj
521
39k
The Cost Of JavaScript in 2023
addyosmani
47
7.3k
GitHub's CSS Performance
jonrohan
1030
460k
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