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
170
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
リアルな遅延を測る仕様
kota_yata
1
130
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.1k
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
110
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
440
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
400
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
130
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
300
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
550
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
2
440
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
210
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
720
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
340
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
310
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
How to build a perfect <img>
jonoalderson
1
5.9k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
How to Ace a Technical Interview
jacobian
281
24k
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