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
200
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
380
AACS Ray Marching
filippovitale
0
190
Let’s Blend some Data Structures
filippovitale
0
130
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
290
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
230
Other Decks in Programming
See All in Programming
情報漏洩させないための設計
kubotak
5
1.3k
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
140
2025.01.17_Sansan × DMM.swift
riofujimon
2
560
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
180
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
ASP.NET Core の OpenAPIサポート
h455h1
0
120
Beyond ORM
77web
11
1.6k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
960
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
7
1.4k
AHC041解説
terryu16
0
400
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
410
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Automating Front-end Workflow
addyosmani
1366
200k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Building Your Own Lightsaber
phodgson
104
6.2k
Producing Creativity
orderedlist
PRO
343
39k
Code Reviewing Like a Champion
maltzj
521
39k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
570
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