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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
160
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
350
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
Modding RubyKaigi for Myself
yui_knk
0
900
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
470
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
180
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
550
ふつうのFeature Flag実践入門
irof
7
3.6k
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
320
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
17
6.1k
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
420
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
450
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
500
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
150
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
Mobile First: as difficult as doing things right
swwweet
225
10k
Designing Experiences People Love
moore
143
24k
Abbi's Birthday
coloredviolet
2
7.9k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
ラッコキーワード サービス紹介資料
rakko
1
3.6M
The Cost Of JavaScript in 2023
addyosmani
55
10k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
300
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
Optimizing for Happiness
mojombo
378
71k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
350
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