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
260
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
510
AACS Ray Marching
filippovitale
0
210
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
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.3k
NakouPAY説明用
annouim0
0
170
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
520
Programming with a DJ Controller — not vibe coding
m_seki
3
100
Don't Prompt Harder, Structure Better
kitasuke
0
770
Kingdom of the Machine
yui_knk
2
330
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
180
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
570
事業会社でのセキュリティ長期インターンについて
masachikaura
0
250
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
150
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.4k
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
110
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
370
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
WCS-LA-2024
lcolladotor
0
540
Making Projects Easy
brettharned
120
6.6k
Accessibility Awareness
sabderemane
1
100
Fireside Chat
paigeccino
42
3.9k
Everyday Curiosity
cassininazir
0
200
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
330
Believing is Seeing
oripsolob
1
110
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
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