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
140
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
180
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
160
Product and Sum types
filippovitale
0
140
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
310
AACS Ray Marching
filippovitale
0
190
Let’s Blend some Data Structures
filippovitale
0
120
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
270
Using Eta for what you don't like writing in Scala
filippovitale
0
1.4k
Come risolvere un puzzle crypto-aritmetico in Scala
filippovitale
0
220
Other Decks in Programming
See All in Programming
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
170
Doctrine ORMでValue Objectを扱う方法4選 #phpstudy / 4 ways to handle Value Objects with Doctrine ORM
77web
4
110
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
Tailwind CSSを本気でカスタマイズする方法
fsubal
2
280
[SF Ruby, March 2024] Rails on Wasm
palkan
0
380
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
190
Folding Cheat Sheet #3
philipschwarz
PRO
0
110
Ruby製社内ツールのGo移行
bgpat
2
330
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
120
甘い香りに誘われてVanilla Extractを1年間運用してみた
miyahkun
1
110
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
250
Featured
See All Featured
Gamification - CAS2011
davidbonilla
76
4.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
2k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
BBQ
matthewcrist
80
8.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
1
1.3k
The Cult of Friendly URLs
andyhume
74
5.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
321
20k
Navigating Team Friction
lara
177
13k
Visualization
eitanlees
135
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
Adopting Sorbet at Scale
ufuk
67
8.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
258
12k
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