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
Either Error Success
Search
Tim McGilchrist
May 24, 2018
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Either Error Success
Tim McGilchrist
May 24, 2018
More Decks by Tim McGilchrist
See All by Tim McGilchrist
Dependently Typed State Machines
lambda_foo
0
210
Code reuse through polymorphic variants
lambda_foo
1
260
Idris States: Dependent types, not just for vectors?
lambda_foo
0
290
RAFT: Implementing Distributed Consensus with Erlang
lambda_foo
4
710
Other Decks in Programming
See All in Programming
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
320
速習iPhone Duo対応
yuukiw00w
1
500
Family mrubyの進捗
kishima
1
120
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
190
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
330
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
690
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
460
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.4k
What We Talk About When We Talk About XP
m_seki
2
630
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.5k
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.5k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Raft: Consensus for Rubyists
vanstee
142
7.7k
A Soul's Torment
seathinner
8
3.6k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Utilizing Notion as your number one productivity tool
mfonobong
4
590
Faster Mobile Websites
deanohume
310
32k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Unsuck your backbone
ammeep
672
58k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
GitHub's CSS Performance
jonrohan
1033
470k
Building AI with AI
inesmontani
PRO
1
1.2k
Transcript
None
Either Error Success FP-SYD 2018
Introduction • who, what, why, where, how questions • who
-> Tim McGilchrist @lambda_foo • what -> exciting area of error handling • where -> in Haskell mostly • how -> with functions and data types
–Mark H “I have people sitting around solutionizing”
Examples • Code
–Nick H “I will admit human error played a large
part”
The Async Problem • Asynchronous exceptions are a feature of
Haskell • No fancy effect systems or modular IO effects • Deal with it! • Code in IO can fail at any point with an exception
Exception Pattern • Code
Exception Pattern • type signature doesn’t indicate errors • exceptions
compose without effort • no stack traces by default • dealing with exceptions properly is hard
EitherT Pattern • Code
EitherT Pattern • pattern matching has your back • composition
is explicit (you need to think) • application stack traces • constrained exception handling • extra work • interfacing with exception heavy code
Transformers Either • Code
Either Examples • mismi - wrapper around Amazonka • mafia
- cabal build tool • boris - continuous integration / builds
Exception Examples • http-client - http library • stack -
Haskell build tool ++ • hs-tls - Native Haskell TLS / SSL implementation
Conclusion • make error behaviour explicit • use appropriate tool
for the job • EitherT yields more maintainable code • similar or less effort to exceptions
Resources • https://simonmar.github.io/posts/2017-01-24- asynchronous-exceptions.html • https://haskell-lang.org/library/safe-exceptions • https://www.fpcomplete.com/blog/2016/11/exceptions- best-practices-haskell •
https://simonmar.github.io/bib/papers/async.pdf