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
190
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
450
AACS Ray Marching
filippovitale
0
200
Let’s Blend some Data Structures
filippovitale
0
140
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
240
Other Decks in Programming
See All in Programming
Devoxx BE - Local Development in the AI Era
kdubois
0
130
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
11
6.8k
Go言語はstack overflowの夢を見るか?
logica0419
0
370
デミカツ切り抜きで面倒くさいことはPythonにやらせよう
aokswork3
0
250
株式会社 Sun terras カンパニーデック
sunterras
0
340
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
200
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
0
1.3k
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
260
CSC305 Lecture 08
javiergs
PRO
0
220
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
210
CSC509 Lecture 06
javiergs
PRO
0
260
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Become a Pro
speakerdeck
PRO
29
5.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
35
6.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
How to train your dragon (web standard)
notwaldorf
97
6.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Code Reviewing Like a Champion
maltzj
526
40k
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