Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to Haskell and its REPL
Search
Filippo Vitale
July 27, 2017
Programming
210
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
Transcript
18 slides
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
More Decks by Filippo Vitale
See All by Filippo Vitale
Side-effects within the Business Logic core
filippovitale
1
300
Come risolvere un puzzle cripto-aritmetico in Scala
filippovitale
0
220
Product and Sum types
filippovitale
0
190
Solving a CSP with Monad Transformers and a Genetic Algorithm
filippovitale
0
540
AACS Ray Marching
filippovitale
0
240
Let’s Blend some Data Structures
filippovitale
0
180
Lazy Evaluation: Haskell vs. Scala
filippovitale
0
380
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
270
Other Decks in Programming
See All in Programming
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
260
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
370
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
190
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
360
SODA - FACT BOOK(JP)
sodainc
1
40k
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
160
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
310
Distance field of Julia set
kinakomoti321
0
330
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
220
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
220
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
430
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
4
570
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
490
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
670
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Deep Space Network (abreviated)
tonyrice
0
420
It's Worth the Effort
3n
188
29k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
300
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k