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
280
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
200
Product and Sum types
filippovitale
0
180
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
530
AACS Ray Marching
filippovitale
0
230
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
260
Other Decks in Programming
See All in Programming
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
170
5分で問診!Composer セキュリティ健康診断
codmoninc
0
790
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
490
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
800
What's New in Android 2026
veronikapj
0
240
Claude Team Plan導入・ガイド
tk3fftk
0
250
Android CLI
fornewid
0
200
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
330
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
560
今さら聞けない .NET CLI
htkym
0
170
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
770
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
630
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.7k
Leo the Paperboy
mayatellez
8
2.1k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.8k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
560
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
230
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.2k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Designing for humans not robots
tammielis
254
26k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
A better future with KSS
kneath
240
18k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
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