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
Either Error Success
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Tim McGilchrist
May 24, 2018
Programming
0
150
Either Error Success
Tim McGilchrist
May 24, 2018
Tweet
Share
More Decks by Tim McGilchrist
See All by Tim McGilchrist
Dependently Typed State Machines
lambda_foo
0
180
Code reuse through polymorphic variants
lambda_foo
1
220
Idris States: Dependent types, not just for vectors?
lambda_foo
0
230
RAFT: Implementing Distributed Consensus with Erlang
lambda_foo
4
690
Other Decks in Programming
See All in Programming
「ブロックテーマでは再現できない」は本当か?
inc2734
0
130
Implementation Patterns
denyspoltorak
0
280
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
ThorVG Viewer In VS Code
nors
0
760
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
2026年 エンジニアリング自己学習法
yumechi
0
130
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
940
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.7k
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
AtCoder Conference 2025
shindannin
0
1k
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Optimizing for Happiness
mojombo
379
71k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Designing for humans not robots
tammielis
254
26k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.6k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
150
Become a Pro
speakerdeck
PRO
31
5.8k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
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