SlideShare a Scribd company logo
1 of 76
Download to read offline
From Zero to Haskell: Lessons Learned
ZuriHac 2019
Susan Potter
2019-06-15
finger $(whoami)
Name: Susan Potter
Logged in since Sun Jan 18 18:30 1996 (GMT) on tty1
- 23 years writing software in industry
- Server-side/backend/infrastructure engineering, mostly
- Former SRE; really care about operational ergonomics
Today:
- Building new backend services, test & automation in Haskell
- Infrastructure and CI/CD with Nix/NixOS/Hydra
- Still babysit a bloated Rails webapp
Previously: trading systems and SaaS products
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 1 / 44
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 2 / 44
Overview
Overview
Clickstreams (collecting & reporting API)
Figure 1: High write throughput and unreliable runtime dependencies killed original
Ruby service
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 3 / 44
Overview
Streaming data replication with scrubbing
Figure 2: Soft real-time replication needs to ensure PII data is scrubbed
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 4 / 44
Overview
Developer, testing & deploy tools
Figure 3: Developer tools scattered across copy-pasta Bash/Ruby scripts across
multiple repos
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 5 / 44
Overview
Agenda
Illustrated examples of team feedback:
ā€¢ Security/Privacy Awareness
ā€¢ Operational Debuggability
Human factors review
ā€¢ Teaching/Learning
ā€¢ Managing Up
ā€¢ Setting Expectations
Take-Aways
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 6 / 44
Security/Privacy Awareness
Security/Privacy Awareness
Security/Privacy Awareness: Motivation
Need to scrub sensitive PII:
ā€¢ between production and staging
ā€¢ before sharing with third-parties
Security gates
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 7 / 44
Security/Privacy Awareness
Security/Privacy Awareness: The Big Idea
ā€Susan, you keep telling us about the powers of the Haskell type system,
when do we actually use it for great good?ā€ ā€“Team
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 8 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Challenge Accepted
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 9 / 44
Security/Privacy Awareness
Security/Privacy Awareness: The Big Idea
How do we get type errors when we want them?
ā€¢ Reiļ¬cation turning terms into types
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 10 / 44
Security/Privacy Awareness
Security/Privacy Awareness: The Big Idea
How do we get type errors when we want them?
ā€¢ Reiļ¬cation turning terms into types
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 10 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Language Extensions
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE GADTs #-} -- OPTIONAL
{-# LANGUAGE NoImplicitPrelude #-} -- OPTIONAL
{-# LANGUAGE OverloadedStrings #-} -- OPTIONAL
{-# LANGUAGE TypeApplications #-} -- OPTIONAL
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 11 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Imports
import Control.Applicative
import Control.Monad
import Data.Eq
import Data.Function
import Data.Maybe
import Data.Semigroup
import Data.Text
import GHC.Err (error)
import GHC.Show
import GHC.Types
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 12 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Data Types
EmailState
data EmailState
= Unscrubbed
| Scrubbed
deriving (Eq, Show)
Email
data Email (s :: EmailState)
= MkEmail
{ emailAddress :: Text
} deriving (Eq, Show)
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 13 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Data Types
EmailState
data EmailState
= Unscrubbed
| Scrubbed
deriving (Eq, Show)
Email
data Email (s :: EmailState)
= MkEmail
{ emailAddress :: Text
} deriving (Eq, Show)
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 13 / 44
Security/Privacy Awareness
Security/Privacy Awareness: -XTypeApplications
-- Before enabling TypeApplications
-- >>> MkEmail "me@realemailaddress.com" :: Email 'Scrubbed
-- MkEmail {emailAddress = "me@realemailaddress.com"}
-- it :: Email 'Scrubbed
-- After:
-- >>> MkEmail @'Unscrubbed "me@realemailaddress.com"
-- MkEmail {emailAddress = "me@realemailaddress.com"}
-- it :: Email 'Unscrubbed
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 14 / 44
Security/Privacy Awareness
Security/Privacy Awareness: -XDataKinds
-- >>> import Scrubbed
-- >>> :set -XDataKinds
-- >>> :kind! 'Scrubbed
-- 'Scrubbed :: EmailState
-- = 'Scrubbed
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 15 / 44
Security/Privacy Awareness
Security/Privacy Awareness: -XKindSignatures
Remember this?
data Email
(s :: EmailState) -- this is the kind signature!
= MkEmail
{ emailAddress :: Text } deriving (Eq, Show)
-- >>> :kind! Email Int
-- <interactive>:1:7: error:
-- ā€¢ Expected kind ā€˜EmailStateā€™, but ā€˜Intā€™ has kind ā€˜*ā€™
-- ā€¢ In the first argument of ā€˜Emailā€™, namely ā€˜Intā€™
-- In the type ā€˜Email Intā€™
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 16 / 44
Security/Privacy Awareness
Security/Privacy Awareness: -XKindSignatures
data Email
(s :: EmailState) -- this is the kind signature!
= MkEmail
{ emailAddress :: Text } deriving (Eq, Show)
-- >>> :kind! Email 'Unscrubbed
-- Email 'Unscrubbed :: *
-- = Email 'Unscrubbed
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 17 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Back to the team ā€¦
ā€Nice tricks but what do they buy us, Susan?ā€ ā€“ Team
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 18 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Introducer
-- >>> Just unscrubbedEmail = readEmail
"user@email.address"ā†’
-- unscrubbedEmail :: Email 'Unscrubbed
readEmail :: Text -> Maybe (Email 'Unscrubbed)
readEmail = pure . MkEmail @'Unscrubbed -- silly version
for slidesā†’
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 19 / 44
Security/Privacy Awareness
Security/Privacy Awareness: State Transitions
-- >>> scrubEmail (MkUsername "username0") <$> readEmail
"somethingelse@email.address"ā†’
-- Just (MkEmail {emailAddress =
"username0@some.testing.domain"})ā†’
-- it :: Maybe (Email 'Scrubbed)
scrubEmail :: Username -> Email 'Unscrubbed -> Email
'Scrubbedā†’
scrubEmail username (MkEmail unscrubbedEmail)
= MkEmail @'Scrubbed (mkEmailAddress $ getUsername
username)ā†’
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 20 / 44
Security/Privacy Awareness
Security/Privacy Awareness: State Transitions
-- >>> import Text.StringRandom
-- >>> stringRandomIO "[0-9a-zA-Z][0-9a-zA-Z.+]{2,8}" >>=
pure . randomizeEmailā†’
-- MkEmail {emailAddress = "DIR9qO@some.testing.domain"}
-- it :: Email 'Scrubbed
randomizeEmail :: Text -> Email 'Scrubbed
randomizeEmail randomizedPrefix
= MkEmail @'Scrubbed (mkEmailAddress randomizedPrefix)
-- ^^^^^^^^^^ using -XTypeApplications
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 21 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Relies on two thingsā€¦
ā€¢ Hiding MkEmail data constructor
ā€¢ Only providing functions for valid state transitions
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 22 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Relies on two thingsā€¦
ā€¢ Hiding MkEmail data constructor
ā€¢ Only providing functions for valid state transitions
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 22 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Relies on two thingsā€¦
ā€¢ Hiding MkEmail data constructor
ā€¢ Only providing functions for valid state transitions
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 22 / 44
Security/Privacy Awareness
Security/Privacy Awareness: -XGADTs
Now I started going wild (reļ¬‚ection, going back to terms):
-- OPTIONAL:
-- GADT can act as a witness of EmailState
-- if we need to reflect at runtime
data SEmailState :: EmailState -> Type where
SUnscrubbed :: SEmailState 'Unscrubbed
SScrubbed :: SEmailState 'Scrubbed
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 23 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Team Verdict
ā€Wow, stop! Too much type acrobatics, Susan.ā€ ā€“ Team
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 24 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Oh no!
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 25 / 44
Security/Privacy Awareness
Security/Privacy Awareness: Backtrack to just enough
ā€¢ Didnā€™t really need to reļ¬‚ect using a witness in this case.
ā€¢ Keep is simple, Susan (KISS)
ā€¢ Removed GADT witness and reļ¬‚ection functions and thenā€¦
ā€Cool, we like this just enough solution.ā€ ā€“ Team
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 26 / 44
Operational Debuggability
Operational Debuggability
Operational Debuggability: Motivation
TREND
Our systems are larger today:
ā€¢ more external integrations
ā€¢ more ā€microā€-services
ā€¢ more storage & compute needs
(for new categories of problems)
ā€¢ more runtime dependencies
(monitoring, metrics,
orchestration)
ā€¢ more deployment strategies
And ā€¦
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 27 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
Figure 4: Getting even semi-strutured log records in a Rails app is like herding cats
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 28 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
1 data LogMessage a
2 = MkLogMessage
3 { logMessageService :: !Service -- compile
4 , logMessageVersion :: !Version -- compile
5 , logMessageEnv :: !Env -- on start
6 , logMessageRuntimeId :: !RuntimeId -- on start
7 , logMessageTime :: !UTCTime -- runtime
8 , logMessageThreadId :: !ThreadId -- runtime
9 , logMessagePayload :: a -- runtime
} deriving (Generic)
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 29 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
mkLog :: (Loggable a, MonadIO m) => a -> m (LogMessage a)
class Loggable a where
formatLog :: a -> LogOutputType
instance Loggable a => Loggable (LogMessage a) where
formatLog (MkLogMessage t tid rid v s c e p)
= ...
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 30 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
-- Request/Response specific types
type Username = Text
data PasswordReset
= PasswordReset Username
instance Loggable PasswordReset where
formatLog (PasswordReset username)
= ...
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 31 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
Use formatted protocol and ingest structure. We us CEE-enhanced syslog
@cee: {"time":"20190613T041811654", "tid":167, "pid":33451,
"ver":"f73cfffe", "svc":"dk", "cmp":"tel", "env":"s1",
"p":{"username":"someuser", "action":"password-reset"}}
ā†’
ā†’
Now we can query structured logs not search for arbitrary text
@severity:"error" svc:"dk" env:"prod" payload_status:[500
TO 599]ā†’
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 32 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
Use formatted protocol and ingest structure. We us CEE-enhanced syslog
@cee: {"time":"20190613T041811654", "tid":167, "pid":33451,
"ver":"f73cfffe", "svc":"dk", "cmp":"tel", "env":"s1",
"p":{"username":"someuser", "action":"password-reset"}}
ā†’
ā†’
Now we can query structured logs not search for arbitrary text
@severity:"error" svc:"dk" env:"prod" payload_status:[500
TO 599]ā†’
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 32 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
ā€¢ BAD: Team found logging setup more involved (compared to Rails)
ā€¢ GOOD: First service work easily extracted in to a shared library for the next
ā€¢ GOOD: Simple type features used so far but some boilerplate
ā€¢ GOOD: Structured log record consistency (unlike ļ¬rst pass in Rails)
ā€¢ TODO: Trees That Grow to extend LogMessage in new ways
ā€¢ TODO: Type families to change output type
ā€¢ TODO: instance Generic a => Loggable a where ...
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 33 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
ā€¢ BAD: Team found logging setup more involved (compared to Rails)
ā€¢ GOOD: First service work easily extracted in to a shared library for the next
ā€¢ GOOD: Simple type features used so far but some boilerplate
ā€¢ GOOD: Structured log record consistency (unlike ļ¬rst pass in Rails)
ā€¢ TODO: Trees That Grow to extend LogMessage in new ways
ā€¢ TODO: Type families to change output type
ā€¢ TODO: instance Generic a => Loggable a where ...
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 33 / 44
Operational Debuggability
Operational Debuggability: Semi-Structured Logging
ā€¢ BAD: Team found logging setup more involved (compared to Rails)
ā€¢ GOOD: First service work easily extracted in to a shared library for the next
ā€¢ GOOD: Simple type features used so far but some boilerplate
ā€¢ GOOD: Structured log record consistency (unlike ļ¬rst pass in Rails)
ā€¢ TODO: Trees That Grow to extend LogMessage in new ways
ā€¢ TODO: Type families to change output type
ā€¢ TODO: instance Generic a => Loggable a where ...
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 33 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Kill switches are like feature ļ¬‚ags EXCEPT:
ā€¢ they prevent access to a run-time resources like a database or cache or
ļ¬‚aky API
getKillSwitch :: ??? f => f (Either a b)
gracefullyFail :: ??? f => f (a -> c)
normalOps :: ??? f => f (b -> c)
branch getKillSwitch gracefullyFail normalOps
Look familiar? ;)
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 34 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Selectives allow:
ā€¢ static over- and under-estimation of computation tree
ā€¢ under-estimation can be used to ļ¬nd computations that always run
ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run
ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM
ā€¢ Still a work-in-progress
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Selectives allow:
ā€¢ static over- and under-estimation of computation tree
ā€¢ under-estimation can be used to ļ¬nd computations that always run
ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run
ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM
ā€¢ Still a work-in-progress
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Selectives allow:
ā€¢ static over- and under-estimation of computation tree
ā€¢ under-estimation can be used to ļ¬nd computations that always run
ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run
ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM
ā€¢ Still a work-in-progress
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Selectives allow:
ā€¢ static over- and under-estimation of computation tree
ā€¢ under-estimation can be used to ļ¬nd computations that always run
ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run
ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM
ā€¢ Still a work-in-progress
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Selectives allow:
ā€¢ static over- and under-estimation of computation tree
ā€¢ under-estimation can be used to ļ¬nd computations that always run
ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run
ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM
ā€¢ Still a work-in-progress
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
Operational Debuggability
Operational Debuggability: WIP Kill Switches
Selectives allow:
ā€¢ static over- and under-estimation of computation tree
ā€¢ under-estimation can be used to ļ¬nd computations that always run
ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run
ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM
ā€¢ Still a work-in-progress
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
Human Factors
Human Factors
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 36 / 44
Human Factors
Teaching/Learning in industry
ā€¢ Industry technical leaders untrained at teaching
ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable
ā€¢ Bottom-up foundational learning with top-down practical practice
ā€¢ Setup simple working dev envs; introduce the tools of trade
ā€¢ Team-level learning, not just individual
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
Human Factors
Teaching/Learning in industry
ā€¢ Industry technical leaders untrained at teaching
ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable
ā€¢ Bottom-up foundational learning with top-down practical practice
ā€¢ Setup simple working dev envs; introduce the tools of trade
ā€¢ Team-level learning, not just individual
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
Human Factors
Teaching/Learning in industry
ā€¢ Industry technical leaders untrained at teaching
ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable
ā€¢ Bottom-up foundational learning with top-down practical practice
ā€¢ Setup simple working dev envs; introduce the tools of trade
ā€¢ Team-level learning, not just individual
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
Human Factors
Teaching/Learning in industry
ā€¢ Industry technical leaders untrained at teaching
ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable
ā€¢ Bottom-up foundational learning with top-down practical practice
ā€¢ Setup simple working dev envs; introduce the tools of trade
ā€¢ Team-level learning, not just individual
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
Human Factors
Teaching/Learning in industry
ā€¢ Industry technical leaders untrained at teaching
ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable
ā€¢ Bottom-up foundational learning with top-down practical practice
ā€¢ Setup simple working dev envs; introduce the tools of trade
ā€¢ Team-level learning, not just individual
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
Human Factors
Team-level learning (safe-to-fail experiments)
ā€¢ Deļ¬ne hypothesis
ā€¢ Design experiment
ā€¢ Document results
ā€¢ Share recommendations back to team
ā€¢ Team Discusses
ā€¢ Ticket cleanup for failures and successes
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 38 / 44
Human Factors
Managing Up
ā€¢ Past project failures (postmortems)
ā€¢ Propose solution to core problems
ā€¢ Offer PoC evidence that it satisļ¬es a core requirement
ā€¢ Frame results to your audience (technical vs non-technical)
ā€¢ Incremental rollout, show results early, increase trust
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
Human Factors
Managing Up
ā€¢ Past project failures (postmortems)
ā€¢ Propose solution to core problems
ā€¢ Offer PoC evidence that it satisļ¬es a core requirement
ā€¢ Frame results to your audience (technical vs non-technical)
ā€¢ Incremental rollout, show results early, increase trust
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
Human Factors
Managing Up
ā€¢ Past project failures (postmortems)
ā€¢ Propose solution to core problems
ā€¢ Offer PoC evidence that it satisļ¬es a core requirement
ā€¢ Frame results to your audience (technical vs non-technical)
ā€¢ Incremental rollout, show results early, increase trust
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
Human Factors
Managing Up
ā€¢ Past project failures (postmortems)
ā€¢ Propose solution to core problems
ā€¢ Offer PoC evidence that it satisļ¬es a core requirement
ā€¢ Frame results to your audience (technical vs non-technical)
ā€¢ Incremental rollout, show results early, increase trust
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
Human Factors
Managing Up
ā€¢ Past project failures (postmortems)
ā€¢ Propose solution to core problems
ā€¢ Offer PoC evidence that it satisļ¬es a core requirement
ā€¢ Frame results to your audience (technical vs non-technical)
ā€¢ Incremental rollout, show results early, increase trust
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
Human Factors
Set Expectations
With:
ā€¢ Management (above)
ā€¢ Your technical peers
ā€¢ Your business peers
ā€¢ Your team
By:
ā€¢ Be realistic
ā€¢ Iterative delivery
ā€¢ It will never be rainbows and
unicorns, sorry!
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 40 / 44
Human Factors
Set Expectations
With:
ā€¢ Management (above)
ā€¢ Your technical peers
ā€¢ Your business peers
ā€¢ Your team
By:
ā€¢ Be realistic
ā€¢ Iterative delivery
ā€¢ It will never be rainbows and
unicorns, sorry!
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 40 / 44
In Closing
In Closing
Recap: Takeaways from our experience so far
ā€¢ Stay within a novelty budget
ā€¢ Give people new to Haskell working dev envs from day one! (Frustration
budget)
ā€¢ Teach thinking tools over syntax
ā€¢ Promote team experiments and learning over time
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
In Closing
Recap: Takeaways from our experience so far
ā€¢ Stay within a novelty budget
ā€¢ Give people new to Haskell working dev envs from day one! (Frustration
budget)
ā€¢ Teach thinking tools over syntax
ā€¢ Promote team experiments and learning over time
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
In Closing
Recap: Takeaways from our experience so far
ā€¢ Stay within a novelty budget
ā€¢ Give people new to Haskell working dev envs from day one! (Frustration
budget)
ā€¢ Teach thinking tools over syntax
ā€¢ Promote team experiments and learning over time
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
In Closing
Recap: Takeaways from our experience so far
ā€¢ Stay within a novelty budget
ā€¢ Give people new to Haskell working dev envs from day one! (Frustration
budget)
ā€¢ Teach thinking tools over syntax
ā€¢ Promote team experiments and learning over time
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
Fertig/Fin/The End
Fertig/Fin/The End
Questions?
Accounts
GitHub @mbbx6spp
Keybase @mbbx6spp
LinkedIn /in/susanpotter
Twitter @SusanPotter
I <3 silly hats. Thank you!
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 42 / 44
Appendix: Answers/links to answers in Q&A (post-talk)
Appendix: Answers/links to answers in Q&A (post-talk)
Materials on thinking tools vs syntax
ā€¢ Parametricity
ā€¢ https://www.well-typed.com/blog/2015/05/parametricity/
ā€¢ https://yowconference.com/slides/yowlambdajam2014/
Morris-ParametricityTypesAreDocumentation.pdf
ā€¢ Theorems for free! https:
//homepages.inf.ed.ac.uk/wadler/topics/parametricity.html
ā€¢ The algebra of [algebraic] data types
ā€¢ https://codewords.recurse.com/issues/three/
algebra-and-calculus-of-algebraic-data-types
ā€¢ Abstractions of typed functional programming (aka typeclassopedia)
ā€¢ https://wiki.haskell.org/Typeclassopedia
ā€¢ https:
//www.cs.tufts.edu/comp/150FP/archive/brent-yorgey/tc.pdfSusan Potter From Zero to Haskell: Lessons Learned 2019-06-15 43 / 44
Appendix: Answers/links to answers in Q&A (post-talk)
Examples of Haskell/Nix development environments
ā€¢ Pinned on an aging nixpkgs version though: https://gist.github.
com/mbbx6spp/adc6610892f50f342995d3f5f40e7f6c
ā€¢ NEWER more all-encompassing example coming soon
Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 44 / 44

More Related Content

Similar to From Zero to Haskell: Lessons Learned

Network visibility for efficient Openstack operations
Network visibility for efficient Openstack operationsNetwork visibility for efficient Openstack operations
Network visibility for efficient Openstack operationsYathiraj Udupi, Ph.D.
Ā 
Beyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. Ltd
Beyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. LtdBeyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. Ltd
Beyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. LtdNipun Jaswal
Ā 
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2Chris Gates
Ā 
Azure Machine Learning Intro
Azure Machine Learning IntroAzure Machine Learning Intro
Azure Machine Learning IntroDamir Dobric
Ā 
Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€
Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€
Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€Casey Ellis
Ā 
Big Data Analytics with Spark
Big Data Analytics with SparkBig Data Analytics with Spark
Big Data Analytics with SparkDataStax Academy
Ā 
Ethical_Hacking_ppt
Ethical_Hacking_pptEthical_Hacking_ppt
Ethical_Hacking_pptNarayanan
Ā 
2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...
2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...
2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...Allison Miller
Ā 
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing VulnerabilitiesThe Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing VulnerabilitiesTechWell
Ā 
(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking
(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking
(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent TrackingG. S. McNamara
Ā 
Security and Privacy on the Web in 2015
Security and Privacy on the Web in 2015Security and Privacy on the Web in 2015
Security and Privacy on the Web in 2015Francois Marier
Ā 
Why Web Security Matters!
Why Web Security Matters!Why Web Security Matters!
Why Web Security Matters!Philippe De Ryck
Ā 
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...CzechDreamin
Ā 
2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIAguestfdcb8a
Ā 
Securing Your BBC Identity
Securing Your BBC IdentitySecuring Your BBC Identity
Securing Your BBC IdentityMarc Littlemore
Ā 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with SplunkSplunk
Ā 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Rob Fuller
Ā 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Chris Gates
Ā 
ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?
ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?
ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?FranƧois-Guillaume Ribreau
Ā 
Threat Modelling - It's not just for developers
Threat Modelling - It's not just for developersThreat Modelling - It's not just for developers
Threat Modelling - It's not just for developersMITRE ATT&CK
Ā 

Similar to From Zero to Haskell: Lessons Learned (20)

Network visibility for efficient Openstack operations
Network visibility for efficient Openstack operationsNetwork visibility for efficient Openstack operations
Network visibility for efficient Openstack operations
Ā 
Beyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. Ltd
Beyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. LtdBeyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. Ltd
Beyond Ethical Hacking By Nipun Jaswal , CSA HCF Infosec Pvt. Ltd
Ā 
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
hackcon2013-Dirty Little Secrets They Didn't Teach You In Pentesting Class v2
Ā 
Azure Machine Learning Intro
Azure Machine Learning IntroAzure Machine Learning Intro
Azure Machine Learning Intro
Ā 
Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€
Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€
Release The Hounds: Part 2 ā€œ11 Years Is A Long Ass Timeā€
Ā 
Big Data Analytics with Spark
Big Data Analytics with SparkBig Data Analytics with Spark
Big Data Analytics with Spark
Ā 
Ethical_Hacking_ppt
Ethical_Hacking_pptEthical_Hacking_ppt
Ethical_Hacking_ppt
Ā 
2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...
2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...
2012.09 A Million Mousetraps: Using Big Data and Little Loops to Build Better...
Ā 
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing VulnerabilitiesThe Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
Ā 
(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking
(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking
(ISC)2 CyberSecureGov 2015 - The Next APT: Advanced, Persistent Tracking
Ā 
Security and Privacy on the Web in 2015
Security and Privacy on the Web in 2015Security and Privacy on the Web in 2015
Security and Privacy on the Web in 2015
Ā 
Why Web Security Matters!
Why Web Security Matters!Why Web Security Matters!
Why Web Security Matters!
Ā 
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Black Hat Session: Exploring and Exploiting Aura based Experiences, Christian...
Ā 
2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA2 Roads to Redemption - Thoughts on XSS and SQLIA
2 Roads to Redemption - Thoughts on XSS and SQLIA
Ā 
Securing Your BBC Identity
Securing Your BBC IdentitySecuring Your BBC Identity
Securing Your BBC Identity
Ā 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
Ā 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Ā 
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
Ā 
ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?
ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?
ā›³ļø Votre API passe-t-elle le contrĆ“le technique ?
Ā 
Threat Modelling - It's not just for developers
Threat Modelling - It's not just for developersThreat Modelling - It's not just for developers
Threat Modelling - It's not just for developers
Ā 

More from Susan Potter

Thinking in Properties
Thinking in PropertiesThinking in Properties
Thinking in PropertiesSusan Potter
Ā 
Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)Susan Potter
Ā 
Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...Susan Potter
Ā 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Susan Potter
Ā 
From Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSFrom Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSSusan Potter
Ā 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016Susan Potter
Ā 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Susan Potter
Ā 
Ricon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeRicon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeSusan Potter
Ā 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedSusan Potter
Ā 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresSusan Potter
Ā 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using GitSusan Potter
Ā 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with RiakSusan Potter
Ā 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptSusan Potter
Ā 
Twitter4R OAuth
Twitter4R OAuthTwitter4R OAuth
Twitter4R OAuthSusan Potter
Ā 
Deploying distributed software services to the cloud without breaking a sweat
Deploying distributed software services to the cloud without breaking a sweatDeploying distributed software services to the cloud without breaking a sweat
Deploying distributed software services to the cloud without breaking a sweatSusan Potter
Ā 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for ConcurrencySusan Potter
Ā 

More from Susan Potter (17)

Thinking in Properties
Thinking in PropertiesThinking in Properties
Thinking in Properties
Ā 
Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Champaign-Urbana Javascript Meetup Talk (Jan 2020)
Ā 
Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Dynamically scaling a political news and activism hub (up to 5x the traffic i...
Ā 
Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)Functional Operations (Functional Programming at Comcast Labs Connect)
Functional Operations (Functional Programming at Comcast Labs Connect)
Ā 
From Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOSFrom Zero to Application Delivery with NixOS
From Zero to Application Delivery with NixOS
Ā 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
Ā 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Ā 
Ricon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak PipeRicon/West 2013: Adventures with Riak Pipe
Ricon/West 2013: Adventures with Riak Pipe
Ā 
Functional Algebra: Monoids Applied
Functional Algebra: Monoids AppliedFunctional Algebra: Monoids Applied
Functional Algebra: Monoids Applied
Ā 
Why Haskell
Why HaskellWhy Haskell
Why Haskell
Ā 
Dynamo: Not Just For Datastores
Dynamo: Not Just For DatastoresDynamo: Not Just For Datastores
Dynamo: Not Just For Datastores
Ā 
Distributed Developer Workflows using Git
Distributed Developer Workflows using GitDistributed Developer Workflows using Git
Distributed Developer Workflows using Git
Ā 
Link Walking with Riak
Link Walking with RiakLink Walking with Riak
Link Walking with Riak
Ā 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScript
Ā 
Twitter4R OAuth
Twitter4R OAuthTwitter4R OAuth
Twitter4R OAuth
Ā 
Deploying distributed software services to the cloud without breaking a sweat
Deploying distributed software services to the cloud without breaking a sweatDeploying distributed software services to the cloud without breaking a sweat
Deploying distributed software services to the cloud without breaking a sweat
Ā 
Designing for Concurrency
Designing for ConcurrencyDesigning for Concurrency
Designing for Concurrency
Ā 

Recently uploaded

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
Ā 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
Ā 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
Ā 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
Ā 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
Ā 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
Ā 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
Ā 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
Ā 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
Ā 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
Ā 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
Ā 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp KrisztiƔn
Ā 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
Ā 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
Ā 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
Ā 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
Ā 

Recently uploaded (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
Ā 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
Ā 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
Ā 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Ā 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
Ā 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
Ā 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Ā 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
Ā 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
Ā 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
Ā 
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
Ā 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
Ā 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
Ā 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Ā 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
Ā 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
Ā 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
Ā 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Ā 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
Ā 

From Zero to Haskell: Lessons Learned

  • 1. From Zero to Haskell: Lessons Learned ZuriHac 2019 Susan Potter 2019-06-15
  • 2. finger $(whoami) Name: Susan Potter Logged in since Sun Jan 18 18:30 1996 (GMT) on tty1 - 23 years writing software in industry - Server-side/backend/infrastructure engineering, mostly - Former SRE; really care about operational ergonomics Today: - Building new backend services, test & automation in Haskell - Infrastructure and CI/CD with Nix/NixOS/Hydra - Still babysit a bloated Rails webapp Previously: trading systems and SaaS products Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 1 / 44
  • 3. Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 2 / 44
  • 5. Overview Clickstreams (collecting & reporting API) Figure 1: High write throughput and unreliable runtime dependencies killed original Ruby service Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 3 / 44
  • 6. Overview Streaming data replication with scrubbing Figure 2: Soft real-time replication needs to ensure PII data is scrubbed Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 4 / 44
  • 7. Overview Developer, testing & deploy tools Figure 3: Developer tools scattered across copy-pasta Bash/Ruby scripts across multiple repos Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 5 / 44
  • 8. Overview Agenda Illustrated examples of team feedback: ā€¢ Security/Privacy Awareness ā€¢ Operational Debuggability Human factors review ā€¢ Teaching/Learning ā€¢ Managing Up ā€¢ Setting Expectations Take-Aways Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 6 / 44
  • 10. Security/Privacy Awareness Security/Privacy Awareness: Motivation Need to scrub sensitive PII: ā€¢ between production and staging ā€¢ before sharing with third-parties Security gates Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 7 / 44
  • 11. Security/Privacy Awareness Security/Privacy Awareness: The Big Idea ā€Susan, you keep telling us about the powers of the Haskell type system, when do we actually use it for great good?ā€ ā€“Team Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 8 / 44
  • 12. Security/Privacy Awareness Security/Privacy Awareness: Challenge Accepted Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 9 / 44
  • 13. Security/Privacy Awareness Security/Privacy Awareness: The Big Idea How do we get type errors when we want them? ā€¢ Reiļ¬cation turning terms into types Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 10 / 44
  • 14. Security/Privacy Awareness Security/Privacy Awareness: The Big Idea How do we get type errors when we want them? ā€¢ Reiļ¬cation turning terms into types Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 10 / 44
  • 15. Security/Privacy Awareness Security/Privacy Awareness: Language Extensions {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE GADTs #-} -- OPTIONAL {-# LANGUAGE NoImplicitPrelude #-} -- OPTIONAL {-# LANGUAGE OverloadedStrings #-} -- OPTIONAL {-# LANGUAGE TypeApplications #-} -- OPTIONAL Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 11 / 44
  • 16. Security/Privacy Awareness Security/Privacy Awareness: Imports import Control.Applicative import Control.Monad import Data.Eq import Data.Function import Data.Maybe import Data.Semigroup import Data.Text import GHC.Err (error) import GHC.Show import GHC.Types Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 12 / 44
  • 17. Security/Privacy Awareness Security/Privacy Awareness: Data Types EmailState data EmailState = Unscrubbed | Scrubbed deriving (Eq, Show) Email data Email (s :: EmailState) = MkEmail { emailAddress :: Text } deriving (Eq, Show) Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 13 / 44
  • 18. Security/Privacy Awareness Security/Privacy Awareness: Data Types EmailState data EmailState = Unscrubbed | Scrubbed deriving (Eq, Show) Email data Email (s :: EmailState) = MkEmail { emailAddress :: Text } deriving (Eq, Show) Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 13 / 44
  • 19. Security/Privacy Awareness Security/Privacy Awareness: -XTypeApplications -- Before enabling TypeApplications -- >>> MkEmail "me@realemailaddress.com" :: Email 'Scrubbed -- MkEmail {emailAddress = "me@realemailaddress.com"} -- it :: Email 'Scrubbed -- After: -- >>> MkEmail @'Unscrubbed "me@realemailaddress.com" -- MkEmail {emailAddress = "me@realemailaddress.com"} -- it :: Email 'Unscrubbed Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 14 / 44
  • 20. Security/Privacy Awareness Security/Privacy Awareness: -XDataKinds -- >>> import Scrubbed -- >>> :set -XDataKinds -- >>> :kind! 'Scrubbed -- 'Scrubbed :: EmailState -- = 'Scrubbed Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 15 / 44
  • 21. Security/Privacy Awareness Security/Privacy Awareness: -XKindSignatures Remember this? data Email (s :: EmailState) -- this is the kind signature! = MkEmail { emailAddress :: Text } deriving (Eq, Show) -- >>> :kind! Email Int -- <interactive>:1:7: error: -- ā€¢ Expected kind ā€˜EmailStateā€™, but ā€˜Intā€™ has kind ā€˜*ā€™ -- ā€¢ In the first argument of ā€˜Emailā€™, namely ā€˜Intā€™ -- In the type ā€˜Email Intā€™ Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 16 / 44
  • 22. Security/Privacy Awareness Security/Privacy Awareness: -XKindSignatures data Email (s :: EmailState) -- this is the kind signature! = MkEmail { emailAddress :: Text } deriving (Eq, Show) -- >>> :kind! Email 'Unscrubbed -- Email 'Unscrubbed :: * -- = Email 'Unscrubbed Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 17 / 44
  • 23. Security/Privacy Awareness Security/Privacy Awareness: Back to the team ā€¦ ā€Nice tricks but what do they buy us, Susan?ā€ ā€“ Team Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 18 / 44
  • 24. Security/Privacy Awareness Security/Privacy Awareness: Introducer -- >>> Just unscrubbedEmail = readEmail "user@email.address"ā†’ -- unscrubbedEmail :: Email 'Unscrubbed readEmail :: Text -> Maybe (Email 'Unscrubbed) readEmail = pure . MkEmail @'Unscrubbed -- silly version for slidesā†’ Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 19 / 44
  • 25. Security/Privacy Awareness Security/Privacy Awareness: State Transitions -- >>> scrubEmail (MkUsername "username0") <$> readEmail "somethingelse@email.address"ā†’ -- Just (MkEmail {emailAddress = "username0@some.testing.domain"})ā†’ -- it :: Maybe (Email 'Scrubbed) scrubEmail :: Username -> Email 'Unscrubbed -> Email 'Scrubbedā†’ scrubEmail username (MkEmail unscrubbedEmail) = MkEmail @'Scrubbed (mkEmailAddress $ getUsername username)ā†’ Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 20 / 44
  • 26. Security/Privacy Awareness Security/Privacy Awareness: State Transitions -- >>> import Text.StringRandom -- >>> stringRandomIO "[0-9a-zA-Z][0-9a-zA-Z.+]{2,8}" >>= pure . randomizeEmailā†’ -- MkEmail {emailAddress = "DIR9qO@some.testing.domain"} -- it :: Email 'Scrubbed randomizeEmail :: Text -> Email 'Scrubbed randomizeEmail randomizedPrefix = MkEmail @'Scrubbed (mkEmailAddress randomizedPrefix) -- ^^^^^^^^^^ using -XTypeApplications Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 21 / 44
  • 27. Security/Privacy Awareness Security/Privacy Awareness: Relies on two thingsā€¦ ā€¢ Hiding MkEmail data constructor ā€¢ Only providing functions for valid state transitions Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 22 / 44
  • 28. Security/Privacy Awareness Security/Privacy Awareness: Relies on two thingsā€¦ ā€¢ Hiding MkEmail data constructor ā€¢ Only providing functions for valid state transitions Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 22 / 44
  • 29. Security/Privacy Awareness Security/Privacy Awareness: Relies on two thingsā€¦ ā€¢ Hiding MkEmail data constructor ā€¢ Only providing functions for valid state transitions Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 22 / 44
  • 30. Security/Privacy Awareness Security/Privacy Awareness: -XGADTs Now I started going wild (reļ¬‚ection, going back to terms): -- OPTIONAL: -- GADT can act as a witness of EmailState -- if we need to reflect at runtime data SEmailState :: EmailState -> Type where SUnscrubbed :: SEmailState 'Unscrubbed SScrubbed :: SEmailState 'Scrubbed Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 23 / 44
  • 31. Security/Privacy Awareness Security/Privacy Awareness: Team Verdict ā€Wow, stop! Too much type acrobatics, Susan.ā€ ā€“ Team Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 24 / 44
  • 32. Security/Privacy Awareness Security/Privacy Awareness: Oh no! Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 25 / 44
  • 33. Security/Privacy Awareness Security/Privacy Awareness: Backtrack to just enough ā€¢ Didnā€™t really need to reļ¬‚ect using a witness in this case. ā€¢ Keep is simple, Susan (KISS) ā€¢ Removed GADT witness and reļ¬‚ection functions and thenā€¦ ā€Cool, we like this just enough solution.ā€ ā€“ Team Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 26 / 44
  • 35. Operational Debuggability Operational Debuggability: Motivation TREND Our systems are larger today: ā€¢ more external integrations ā€¢ more ā€microā€-services ā€¢ more storage & compute needs (for new categories of problems) ā€¢ more runtime dependencies (monitoring, metrics, orchestration) ā€¢ more deployment strategies And ā€¦ Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 27 / 44
  • 36. Operational Debuggability Operational Debuggability: Semi-Structured Logging Figure 4: Getting even semi-strutured log records in a Rails app is like herding cats Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 28 / 44
  • 37. Operational Debuggability Operational Debuggability: Semi-Structured Logging 1 data LogMessage a 2 = MkLogMessage 3 { logMessageService :: !Service -- compile 4 , logMessageVersion :: !Version -- compile 5 , logMessageEnv :: !Env -- on start 6 , logMessageRuntimeId :: !RuntimeId -- on start 7 , logMessageTime :: !UTCTime -- runtime 8 , logMessageThreadId :: !ThreadId -- runtime 9 , logMessagePayload :: a -- runtime } deriving (Generic) Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 29 / 44
  • 38. Operational Debuggability Operational Debuggability: Semi-Structured Logging mkLog :: (Loggable a, MonadIO m) => a -> m (LogMessage a) class Loggable a where formatLog :: a -> LogOutputType instance Loggable a => Loggable (LogMessage a) where formatLog (MkLogMessage t tid rid v s c e p) = ... Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 30 / 44
  • 39. Operational Debuggability Operational Debuggability: Semi-Structured Logging -- Request/Response specific types type Username = Text data PasswordReset = PasswordReset Username instance Loggable PasswordReset where formatLog (PasswordReset username) = ... Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 31 / 44
  • 40. Operational Debuggability Operational Debuggability: Semi-Structured Logging Use formatted protocol and ingest structure. We us CEE-enhanced syslog @cee: {"time":"20190613T041811654", "tid":167, "pid":33451, "ver":"f73cfffe", "svc":"dk", "cmp":"tel", "env":"s1", "p":{"username":"someuser", "action":"password-reset"}} ā†’ ā†’ Now we can query structured logs not search for arbitrary text @severity:"error" svc:"dk" env:"prod" payload_status:[500 TO 599]ā†’ Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 32 / 44
  • 41. Operational Debuggability Operational Debuggability: Semi-Structured Logging Use formatted protocol and ingest structure. We us CEE-enhanced syslog @cee: {"time":"20190613T041811654", "tid":167, "pid":33451, "ver":"f73cfffe", "svc":"dk", "cmp":"tel", "env":"s1", "p":{"username":"someuser", "action":"password-reset"}} ā†’ ā†’ Now we can query structured logs not search for arbitrary text @severity:"error" svc:"dk" env:"prod" payload_status:[500 TO 599]ā†’ Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 32 / 44
  • 42. Operational Debuggability Operational Debuggability: Semi-Structured Logging ā€¢ BAD: Team found logging setup more involved (compared to Rails) ā€¢ GOOD: First service work easily extracted in to a shared library for the next ā€¢ GOOD: Simple type features used so far but some boilerplate ā€¢ GOOD: Structured log record consistency (unlike ļ¬rst pass in Rails) ā€¢ TODO: Trees That Grow to extend LogMessage in new ways ā€¢ TODO: Type families to change output type ā€¢ TODO: instance Generic a => Loggable a where ... Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 33 / 44
  • 43. Operational Debuggability Operational Debuggability: Semi-Structured Logging ā€¢ BAD: Team found logging setup more involved (compared to Rails) ā€¢ GOOD: First service work easily extracted in to a shared library for the next ā€¢ GOOD: Simple type features used so far but some boilerplate ā€¢ GOOD: Structured log record consistency (unlike ļ¬rst pass in Rails) ā€¢ TODO: Trees That Grow to extend LogMessage in new ways ā€¢ TODO: Type families to change output type ā€¢ TODO: instance Generic a => Loggable a where ... Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 33 / 44
  • 44. Operational Debuggability Operational Debuggability: Semi-Structured Logging ā€¢ BAD: Team found logging setup more involved (compared to Rails) ā€¢ GOOD: First service work easily extracted in to a shared library for the next ā€¢ GOOD: Simple type features used so far but some boilerplate ā€¢ GOOD: Structured log record consistency (unlike ļ¬rst pass in Rails) ā€¢ TODO: Trees That Grow to extend LogMessage in new ways ā€¢ TODO: Type families to change output type ā€¢ TODO: instance Generic a => Loggable a where ... Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 33 / 44
  • 45. Operational Debuggability Operational Debuggability: WIP Kill Switches Kill switches are like feature ļ¬‚ags EXCEPT: ā€¢ they prevent access to a run-time resources like a database or cache or ļ¬‚aky API getKillSwitch :: ??? f => f (Either a b) gracefullyFail :: ??? f => f (a -> c) normalOps :: ??? f => f (b -> c) branch getKillSwitch gracefullyFail normalOps Look familiar? ;) Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 34 / 44
  • 46. Operational Debuggability Operational Debuggability: WIP Kill Switches Selectives allow: ā€¢ static over- and under-estimation of computation tree ā€¢ under-estimation can be used to ļ¬nd computations that always run ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM ā€¢ Still a work-in-progress Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
  • 47. Operational Debuggability Operational Debuggability: WIP Kill Switches Selectives allow: ā€¢ static over- and under-estimation of computation tree ā€¢ under-estimation can be used to ļ¬nd computations that always run ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM ā€¢ Still a work-in-progress Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
  • 48. Operational Debuggability Operational Debuggability: WIP Kill Switches Selectives allow: ā€¢ static over- and under-estimation of computation tree ā€¢ under-estimation can be used to ļ¬nd computations that always run ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM ā€¢ Still a work-in-progress Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
  • 49. Operational Debuggability Operational Debuggability: WIP Kill Switches Selectives allow: ā€¢ static over- and under-estimation of computation tree ā€¢ under-estimation can be used to ļ¬nd computations that always run ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM ā€¢ Still a work-in-progress Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
  • 50. Operational Debuggability Operational Debuggability: WIP Kill Switches Selectives allow: ā€¢ static over- and under-estimation of computation tree ā€¢ under-estimation can be used to ļ¬nd computations that always run ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM ā€¢ Still a work-in-progress Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
  • 51. Operational Debuggability Operational Debuggability: WIP Kill Switches Selectives allow: ā€¢ static over- and under-estimation of computation tree ā€¢ under-estimation can be used to ļ¬nd computations that always run ā€¢ over-estimation can be used to ļ¬nd computations that sometimes run ā€¢ generate an on-call endpoint mapping to help tired brain debug at 3AM ā€¢ Still a work-in-progress Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 35 / 44
  • 53. Human Factors Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 36 / 44
  • 54. Human Factors Teaching/Learning in industry ā€¢ Industry technical leaders untrained at teaching ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable ā€¢ Bottom-up foundational learning with top-down practical practice ā€¢ Setup simple working dev envs; introduce the tools of trade ā€¢ Team-level learning, not just individual Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
  • 55. Human Factors Teaching/Learning in industry ā€¢ Industry technical leaders untrained at teaching ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable ā€¢ Bottom-up foundational learning with top-down practical practice ā€¢ Setup simple working dev envs; introduce the tools of trade ā€¢ Team-level learning, not just individual Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
  • 56. Human Factors Teaching/Learning in industry ā€¢ Industry technical leaders untrained at teaching ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable ā€¢ Bottom-up foundational learning with top-down practical practice ā€¢ Setup simple working dev envs; introduce the tools of trade ā€¢ Team-level learning, not just individual Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
  • 57. Human Factors Teaching/Learning in industry ā€¢ Industry technical leaders untrained at teaching ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable ā€¢ Bottom-up foundational learning with top-down practical practice ā€¢ Setup simple working dev envs; introduce the tools of trade ā€¢ Team-level learning, not just individual Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
  • 58. Human Factors Teaching/Learning in industry ā€¢ Industry technical leaders untrained at teaching ā€¢ ā€Successā€ criteria often ļ¬‚awed or unmeasurable ā€¢ Bottom-up foundational learning with top-down practical practice ā€¢ Setup simple working dev envs; introduce the tools of trade ā€¢ Team-level learning, not just individual Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 37 / 44
  • 59. Human Factors Team-level learning (safe-to-fail experiments) ā€¢ Deļ¬ne hypothesis ā€¢ Design experiment ā€¢ Document results ā€¢ Share recommendations back to team ā€¢ Team Discusses ā€¢ Ticket cleanup for failures and successes Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 38 / 44
  • 60. Human Factors Managing Up ā€¢ Past project failures (postmortems) ā€¢ Propose solution to core problems ā€¢ Offer PoC evidence that it satisļ¬es a core requirement ā€¢ Frame results to your audience (technical vs non-technical) ā€¢ Incremental rollout, show results early, increase trust Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
  • 61. Human Factors Managing Up ā€¢ Past project failures (postmortems) ā€¢ Propose solution to core problems ā€¢ Offer PoC evidence that it satisļ¬es a core requirement ā€¢ Frame results to your audience (technical vs non-technical) ā€¢ Incremental rollout, show results early, increase trust Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
  • 62. Human Factors Managing Up ā€¢ Past project failures (postmortems) ā€¢ Propose solution to core problems ā€¢ Offer PoC evidence that it satisļ¬es a core requirement ā€¢ Frame results to your audience (technical vs non-technical) ā€¢ Incremental rollout, show results early, increase trust Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
  • 63. Human Factors Managing Up ā€¢ Past project failures (postmortems) ā€¢ Propose solution to core problems ā€¢ Offer PoC evidence that it satisļ¬es a core requirement ā€¢ Frame results to your audience (technical vs non-technical) ā€¢ Incremental rollout, show results early, increase trust Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
  • 64. Human Factors Managing Up ā€¢ Past project failures (postmortems) ā€¢ Propose solution to core problems ā€¢ Offer PoC evidence that it satisļ¬es a core requirement ā€¢ Frame results to your audience (technical vs non-technical) ā€¢ Incremental rollout, show results early, increase trust Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 39 / 44
  • 65. Human Factors Set Expectations With: ā€¢ Management (above) ā€¢ Your technical peers ā€¢ Your business peers ā€¢ Your team By: ā€¢ Be realistic ā€¢ Iterative delivery ā€¢ It will never be rainbows and unicorns, sorry! Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 40 / 44
  • 66. Human Factors Set Expectations With: ā€¢ Management (above) ā€¢ Your technical peers ā€¢ Your business peers ā€¢ Your team By: ā€¢ Be realistic ā€¢ Iterative delivery ā€¢ It will never be rainbows and unicorns, sorry! Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 40 / 44
  • 68. In Closing Recap: Takeaways from our experience so far ā€¢ Stay within a novelty budget ā€¢ Give people new to Haskell working dev envs from day one! (Frustration budget) ā€¢ Teach thinking tools over syntax ā€¢ Promote team experiments and learning over time Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
  • 69. In Closing Recap: Takeaways from our experience so far ā€¢ Stay within a novelty budget ā€¢ Give people new to Haskell working dev envs from day one! (Frustration budget) ā€¢ Teach thinking tools over syntax ā€¢ Promote team experiments and learning over time Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
  • 70. In Closing Recap: Takeaways from our experience so far ā€¢ Stay within a novelty budget ā€¢ Give people new to Haskell working dev envs from day one! (Frustration budget) ā€¢ Teach thinking tools over syntax ā€¢ Promote team experiments and learning over time Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
  • 71. In Closing Recap: Takeaways from our experience so far ā€¢ Stay within a novelty budget ā€¢ Give people new to Haskell working dev envs from day one! (Frustration budget) ā€¢ Teach thinking tools over syntax ā€¢ Promote team experiments and learning over time Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 41 / 44
  • 73. Fertig/Fin/The End Questions? Accounts GitHub @mbbx6spp Keybase @mbbx6spp LinkedIn /in/susanpotter Twitter @SusanPotter I <3 silly hats. Thank you! Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 42 / 44
  • 74. Appendix: Answers/links to answers in Q&A (post-talk)
  • 75. Appendix: Answers/links to answers in Q&A (post-talk) Materials on thinking tools vs syntax ā€¢ Parametricity ā€¢ https://www.well-typed.com/blog/2015/05/parametricity/ ā€¢ https://yowconference.com/slides/yowlambdajam2014/ Morris-ParametricityTypesAreDocumentation.pdf ā€¢ Theorems for free! https: //homepages.inf.ed.ac.uk/wadler/topics/parametricity.html ā€¢ The algebra of [algebraic] data types ā€¢ https://codewords.recurse.com/issues/three/ algebra-and-calculus-of-algebraic-data-types ā€¢ Abstractions of typed functional programming (aka typeclassopedia) ā€¢ https://wiki.haskell.org/Typeclassopedia ā€¢ https: //www.cs.tufts.edu/comp/150FP/archive/brent-yorgey/tc.pdfSusan Potter From Zero to Haskell: Lessons Learned 2019-06-15 43 / 44
  • 76. Appendix: Answers/links to answers in Q&A (post-talk) Examples of Haskell/Nix development environments ā€¢ Pinned on an aging nixpkgs version though: https://gist.github. com/mbbx6spp/adc6610892f50f342995d3f5f40e7f6c ā€¢ NEWER more all-encompassing example coming soon Susan Potter From Zero to Haskell: Lessons Learned 2019-06-15 44 / 44