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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
680
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
720
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
510
AIを紡ぐPMのお話
swdtkuy
0
100
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
170
Foundation Models frameworkで画像分析
ryodeveloper
1
610
「人を評価する AI」の設計と実装
ryoyanara
0
200
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.5k
源内ハンズオン概要編
hideg
0
180
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
18k
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
380
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
530
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Facilitating Awesome Meetings
lara
57
7.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
470
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Embracing the Ebb and Flow
colly
88
5.1k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
280
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
890
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
エンジニアに許された特別な時間の終わり
watany
108
250k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
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