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
160
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
190
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
170
Product and Sum types
filippovitale
0
140
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
360
AACS Ray Marching
filippovitale
0
190
Let’s Blend some Data Structures
filippovitale
0
130
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
280
Using Eta for what you don't like writing in Scala
filippovitale
0
1.5k
Come risolvere un puzzle crypto-aritmetico in Scala
filippovitale
0
220
Other Decks in Programming
See All in Programming
Golang と Erlang
taiyow
8
1.9k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
僕がつくった48個のWebサービス達
yusukebe
18
17k
CSC305 Lecture 13
javiergs
PRO
0
130
Identifying User Idenity
moro
6
7.8k
Honoの来た道とこれから
yusukebe
19
3k
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
220
Macとオーディオ再生 2024/11/02
yusukeito
0
150
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
3
2.2k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
240
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
540
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.3k
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Optimizing for Happiness
mojombo
376
69k
Facilitating Awesome Meetings
lara
49
6k
Making Projects Easy
brettharned
115
5.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Faster Mobile Websites
deanohume
304
30k
Why You Should Never Use an ORM
jnunemaker
PRO
53
9k
For a Future-Friendly Web
brad_frost
175
9.4k
Git: the NoSQL Database
bkeepers
PRO
425
64k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
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