commercial uses of functional programming
DESCRIPTION
FLOLAC'14 talk on using Haskell in commercial settings.TRANSCRIPT
![Page 1: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/1.jpg)
2014-07-01 FLOLAC’14
Commercial Uses of Functional ProgrammingFunctional Programming as a means — not an end
![Page 2: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/2.jpg)
01
![Page 3: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/3.jpg)
01
✤ ICFP 2014: September 1~3
![Page 4: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/4.jpg)
01
✤ ICFP 2014: September 1~3
✤ CUFP 2014: September 4~6
![Page 5: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/5.jpg)
01
✤ ICFP 2014: September 1~3
✤ CUFP 2014: September 4~6
✤ 6-Hour Workday: July 1
![Page 6: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/6.jpg)
01
✤ ICFP 2014: September 1~3
✤ CUFP 2014: September 4~6
✤ 6-Hour Workday: July 1
![Page 7: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/7.jpg)
01
![Page 8: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/8.jpg)
01
![Page 9: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/9.jpg)
01
Worse is Better
![Page 10: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/10.jpg)
01
Worse is Better
![Page 11: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/11.jpg)
01
Worse is Better
Less is More!
![Page 12: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/12.jpg)
Less is more!
λClosure ⊂ Value
![Page 13: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/13.jpg)
Less is more!
λClosure ⊂ Value f . g =
![Page 14: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/14.jpg)
Less is more!
λClosure ⊂ Value f . g = \x -> f (g x)
![Page 15: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/15.jpg)
Less is more!
λClosure ⊂ Value f . g = \x -> f (g x)
((+1) . (*2)) 3
![Page 16: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/16.jpg)
Less is more!
λClosure ⊂ Value
function compose (f, g) { return function (x) { return f( g(x) ) } }
f . g = \x -> f (g x)
((+1) . (*2)) 3
![Page 17: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/17.jpg)
ANSI C AdaFortran Cobol
![Page 18: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/18.jpg)
ANSI C AdaFortran Cobol
![Page 19: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/19.jpg)
ANSI C AdaFortran Cobol
![Page 20: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/20.jpg)
ANSI C AdaFortran Cobol
![Page 21: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/21.jpg)
ANSI C AdaFortran Cobol
![Page 22: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/22.jpg)
ANSI C AdaFortran Cobol
![Page 23: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/23.jpg)
ANSI C AdaFortran Cobol
![Page 24: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/24.jpg)
ANSI C AdaFortran Cobol
![Page 25: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/25.jpg)
ANSI C AdaFortran Cobol
![Page 26: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/26.jpg)
ANSI C AdaFortran Cobol
![Page 27: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/27.jpg)
ANSI C AdaFortran Cobol
![Page 28: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/28.jpg)
ANSI C AdaFortran Cobol
![Page 29: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/29.jpg)
ANSI C AdaFortran Cobol
![Page 30: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/30.jpg)
Generators: List Fusion
![Page 31: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/31.jpg)
Generators: List Fusion
fibs = 1:1:[ x+y | x <- fibs | y <- tail fibs ]
take 6 (map (*10) fibs) [10,10,20,30,50,80]
![Page 32: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/32.jpg)
Generators: List Fusion
fibs = 1:1:[ x+y | x <- fibs | y <- tail fibs ]
take 6 (map (*10) fibs) [10,10,20,30,50,80]
take 6 (map (*5) (map (*2) fibs))[10,10,20,30,50,80]
![Page 33: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/33.jpg)
Generators: List Fusion
fibs = 1:1:[ x+y | x <- fibs | y <- tail fibs ]
take 6 (map (*10) fibs) [10,10,20,30,50,80]
take 6 (map (*5) (map (*2) fibs))[10,10,20,30,50,80]
take 6 (map ((*5) . (*2)) fibs)
![Page 34: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/34.jpg)
QuickCheck: Property Testing
![Page 35: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/35.jpg)
QuickCheck: Property Testing
import Test.QuickCheck prop :: [Int] -> [Int] -> Bool prop xs ys = reverse (xs ++ ys) == reverse xs ++ reverse ys
quickCheck prop -- Failed!
![Page 36: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/36.jpg)
QuickCheck: Property Testing
import Test.QuickCheck prop :: [Int] -> [Int] -> Bool prop xs ys = reverse (xs ++ ys) == reverse xs ++ reverse ys
quickCheck prop -- Failed!
reverse xs ++ reverse ys
![Page 37: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/37.jpg)
QuickCheck: Property Testing
import Test.QuickCheck prop :: [Int] -> [Int] -> Bool prop xs ys = reverse (xs ++ ys) == reverse xs ++ reverse ys
quickCheck prop -- Failed!
reverse xs ++ reverse ys
quickCheck prop -- Failed!
![Page 38: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/38.jpg)
QuickCheck: Property Testing
import Test.QuickCheck prop :: [Int] -> [Int] -> Bool prop xs ys = reverse (xs ++ ys) == reverse xs ++ reverse ys
quickCheck prop -- Failed!
reverse ys ++ reverse xs
quickCheck prop -- Passed!
![Page 39: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/39.jpg)
Macros: Multi-Stage Programming
![Page 40: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/40.jpg)
Macros: Multi-Stage Programming
import Text.InterpolatedString.Perl6 user = "world" putStrLn [qq| Hello, $user! Your lucky number: { 6*7 } |]
![Page 41: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/41.jpg)
2011 20142004
![Page 42: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/42.jpg)
2011 20142004
2005
![Page 43: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/43.jpg)
2011 20142004
2005 2012
![Page 44: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/44.jpg)
![Page 45: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/45.jpg)
ES/9000 R46 4CPU, 8GB RAM
50MTWD
![Page 46: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/46.jpg)
RS/6000 H70 340MHz 1MTWD
ES/9000 R46 4CPU, 8GB RAM
50MTWD
![Page 47: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/47.jpg)
InfoPrint/4000 ID5 1000 PPM 15MTWD
RS/6000 H70 340MHz 1MTWD
ES/9000 R46 4CPU, 8GB RAM
50MTWD
![Page 48: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/48.jpg)
InfoPrint/4000 ID5 1000 PPM 15MTWD
RS/6000 H70 340MHz 1MTWD
ES/9000 R46 4CPU, 8GB RAM
50MTWD
![Page 49: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/49.jpg)
InfoPrint/4000 ID5 1000 PPM 15MTWD
RS/6000 H70 340MHz 1MTWD
ES/9000 R46 4CPU, 8GB RAM
50MTWDCOBOL RPG
PL/1 REXX SQL
![Page 50: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/50.jpg)
InfoPrint/4000 ID5 1000 PPM 15MTWD
RS/6000 H70 340MHz 1MTWD
ES/9000 R46 4CPU, 8GB RAM
50MTWDCOBOL RPG
PL/1 REXX SQL
![Page 51: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/51.jpg)
Content Manager OnDemand
Feb 2004
![Page 52: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/52.jpg)
Content Manager OnDemand
Feb 2004
![Page 53: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/53.jpg)
Content Manager OnDemand
Encode::IBM Parse::AFP
Feb 2004
![Page 54: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/54.jpg)
Content Manager OnDemand
Encode::IBM Parse::AFP
Feb 2004
![Page 55: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/55.jpg)
Content Manager OnDemand
Encode::IBM Parse::AFP
Feb 2004
![Page 56: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/56.jpg)
September 2004
![Page 57: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/57.jpg)
September 2004
![Page 58: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/58.jpg)
September 2004
![Page 59: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/59.jpg)
September 2004
![Page 60: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/60.jpg)
September 2004
SAX-style iterators
![Page 61: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/61.jpg)
September 2004
SAX-style iteratorsO(n) memory use
![Page 62: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/62.jpg)
September 2004
SAX-style iteratorsO(n) memory use
300KB/sec (my laptop)
![Page 63: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/63.jpg)
September 2004
SAX-style iteratorsO(n) memory use
300KB/sec (my laptop)30KB/sec (production)
![Page 64: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/64.jpg)
September 2004
SAX-style iteratorsO(n) memory use
300KB/sec (my laptop)30KB/sec (production)
Input: 25GB/dayThroughput: 2.5GB/day
![Page 65: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/65.jpg)
September 2004
SAX-style iteratorsO(n) memory use
300KB/sec (my laptop)30KB/sec (production)
Input: 25GB/dayThroughput: 2.5GB/day
Deadline:Feb 2005
![Page 66: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/66.jpg)
October—November 2004
![Page 67: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/67.jpg)
October—November 2004
![Page 68: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/68.jpg)
October—November 2004
![Page 69: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/69.jpg)
December 2004: Freenode
![Page 70: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/70.jpg)
December 2004: Freenode
✤ “Yeah, CosmicRay recently ported GHC to AIX.”
![Page 71: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/71.jpg)
December 2004: Freenode
✤ “Yeah, CosmicRay recently ported GHC to AIX.”
✤ “Defining a functor instance as liftM works I'm pretty sure, so… all Monads are Functors (theoretically), instance Monad a => Functor a where fmap = liftM would cover all monads.”
![Page 72: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/72.jpg)
December 2004: Freenode
✤ “Yeah, CosmicRay recently ported GHC to AIX.”
✤ “Defining a functor instance as liftM works I'm pretty sure, so… all Monads are Functors (theoretically), instance Monad a => Functor a where fmap = liftM would cover all monads.”✤ “Elaborate please? <- have only learned haskell for 5 days…”
![Page 73: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/73.jpg)
December 2004: Freenode
✤ “Yeah, CosmicRay recently ported GHC to AIX.”
✤ “Defining a functor instance as liftM works I'm pretty sure, so… all Monads are Functors (theoretically), instance Monad a => Functor a where fmap = liftM would cover all monads.”✤ “Elaborate please? <- have only learned haskell for 5 days…”
✤ “unsafeInterleaveIO is the best thing since sliced bread.”
![Page 74: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/74.jpg)
December 2004: Freenode
✤ “Yeah, CosmicRay recently ported GHC to AIX.”
✤ “Defining a functor instance as liftM works I'm pretty sure, so… all Monads are Functors (theoretically), instance Monad a => Functor a where fmap = liftM would cover all monads.”✤ “Elaborate please? <- have only learned haskell for 5 days…”
✤ “unsafeInterleaveIO is the best thing since sliced bread.”
✤ “What do I do with a compiler with exploding brains?”
![Page 75: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/75.jpg)
December 2004: Freenode
✤ “Yeah, CosmicRay recently ported GHC to AIX.”
✤ “Defining a functor instance as liftM works I'm pretty sure, so… all Monads are Functors (theoretically), instance Monad a => Functor a where fmap = liftM would cover all monads.”✤ “Elaborate please? <- have only learned haskell for 5 days…”
✤ “unsafeInterleaveIO is the best thing since sliced bread.”
✤ “What do I do with a compiler with exploding brains?”
✤ “Haskell has a solid niche as a PhD generator :)”
![Page 76: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/76.jpg)
January 2005
![Page 77: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/77.jpg)
January 2005
✤ OpenAFP.hs delivered —
![Page 78: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/78.jpg)
Input: 25GB/dayThroughput: 500GB/day
DOM-Style selectorsO(1) Memory Use!
January 2005
✤ OpenAFP.hs delivered —
![Page 79: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/79.jpg)
Input: 25GB/dayThroughput: 500GB/day
DOM-Style selectorsO(1) Memory Use!
January 2005
✤ OpenAFP.hs delivered — ✤ NTD$3k/hr * 3 months
![Page 80: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/80.jpg)
Input: 25GB/dayThroughput: 500GB/day
DOM-Style selectorsO(1) Memory Use!
January 2005
✤ OpenAFP.hs delivered — ✤ NTD$3k/hr * 3 months
✤ “You don't need category theory, you need BC Pierce's 'Types and Programming Languages’”
![Page 81: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/81.jpg)
Input: 25GB/dayThroughput: 500GB/day
DOM-Style selectorsO(1) Memory Use!
January 2005
✤ OpenAFP.hs delivered — ✤ NTD$3k/hr * 3 months
✤ “You don't need category theory, you need BC Pierce's 'Types and Programming Languages’”
![Page 82: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/82.jpg)
Input: 25GB/dayThroughput: 500GB/day
DOM-Style selectorsO(1) Memory Use!
January 2005
✤ OpenAFP.hs delivered — ✤ NTD$3k/hr * 3 months
✤ “You don't need category theory, you need BC Pierce's 'Types and Programming Languages’”
✤ “My target language is huge. I need all the help I can get :)”
![Page 83: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/83.jpg)
2005: PugsFeb 1: Started on Freenode #haskellLambdas & Camels joined in #perl6Specification revised, iterated, testedConcurrency, Coroutines, Commit Bits!
![Page 84: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/84.jpg)
2006: Erdős ingYAPC: Worst is Best on targeting JSOOPSLA: Reconciling the IrreconcilableSucceeded by Moose & RakudoPerl 5 runtime became Modern PerlConcluding talk: Optimizing for Fun
楽⼟土
![Page 85: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/85.jpg)
2007: S-TeamNew tech stack: Jifty, Moose, and GHCOpenAFP Utilities: Report Generation, Extraction, Management, Distribution, Conversion…Enhanced & eventually replaced IBM OnDemand with PDF-based workflow
![Page 86: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/86.jpg)
2008: SocialtextMidlife crisis — Becoming a PHB?Hierarchical organization & culture — can we change that with technology?Decided to telecommute full time: - ST (social workplace), or - FB (social media)?
![Page 87: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/87.jpg)
2009: SocialCalcWorked with Dan Bricklin & friends
Summarized into three book chapters: - Architecture of Open Source Applications - Performance of Open Source Applications - 500 lines or less (in progress)
EtherCalc: Backend of g0v.today
![Page 88: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/88.jpg)
2010: AppleCloud Service Localization
Everything under NDA……with one single exception
![Page 89: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/89.jpg)
May 2011
![Page 90: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/90.jpg)
May 2011
✤ “Can you write me some code that takes a regular expression and enumerates the domain it accepts?”
![Page 91: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/91.jpg)
May 2011
✤ “Can you write me some code that takes a regular expression and enumerates the domain it accepts?”
✤ “I think I can do this with the yices2 SMT solver and the SBV Haskell library to turn regexes into satisfiability problems, and so we can get all examples.
![Page 92: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/92.jpg)
May 2011
✤ “Can you write me some code that takes a regular expression and enumerates the domain it accepts?”
✤ “I think I can do this with the yices2 SMT solver and the SBV Haskell library to turn regexes into satisfiability problems, and so we can get all examples.
✤ But this is too much fun for an one-off script… Would you mind if I do this pro bono so I can release it into public domain? :-)”
![Page 93: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/93.jpg)
SMT Constraint Solving
![Page 94: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/94.jpg)
SMT Constraint Solving
✤ Genex: Regex as predicates on integer variables
/([AB]C)\1/
![Page 95: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/95.jpg)
SMT Constraint Solving
✤ Genex: Regex as predicates on integer variables
✤ Solve for [x, y, z, w]: /([AB]C)\1/
(x=‘A’ ∨ x=‘B’) ∧ (y=‘C’) ∧
(z=x) ∧ (w=y)
![Page 96: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/96.jpg)
SMT Constraint Solving
✤ Genex: Regex as predicates on integer variables
✤ Solve for [x, y, z, w]:
✤ “ACAC”“BCBC”
/([AB]C)\1/
(x=‘A’ ∨ x=‘B’) ∧ (y=‘C’) ∧
(z=x) ∧ (w=y)
![Page 97: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/97.jpg)
SMT Constraint Solving
✤ Genex: Regex as predicates on integer variables
✤ Solve for [x, y, z, w]:
✤ “ACAC”“BCBC”
✤ Supports \b \1 ^ $
/([AB]C)\1/
(x=‘A’ ∨ x=‘B’) ∧ (y=‘C’) ∧
(z=x) ∧ (w=y)
![Page 98: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/98.jpg)
A Regular Crossword
(ND|ET|IN)[^X]*
(DI|NS|TH|OM)*
.*(IN|SE|HI)
[CHMNOR]*I[CHM
NOR]*
C*MC(CCC|MM)*
([^EMC]|EM
)*
[CEIMU]*OH[AEMOR]*
[AM]*CM
(RC)*R?
N.*X.X.X.*E
.*XHCR.*X.*
(RR|HHH)*.?
(...?)\1*
.*XEXM*
[CR]*
[^C]*MMM[^C]*
(E|CR|MN)*
([^X]|XCC)*
.*OXR.*.*PRR.*DDC.*
R*D*M*
.*(.)(.)(.)(.)\4\3\2\1.*
(RX|[^R])*
.*SE.*UE.*.*LR.*RL.*
(S|MM|HHH)*
.*G.*V.*H.*
[^C]*[^R]*III.*
(HHX|[^HX])*
.(C|HH)*
.*DD.*CCM.*
P+(..)\1.*(O|RHH|MM)*
([^MC]|M
M|CC)*
.*(.)C\1X\1.*
F.*[AO].*[AO].*
[^M]*M[^M]*
.*H.*H.*
.*
.*
![Page 99: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/99.jpg)
A Regular Crossword
✤ Source: MIT Mystery Hunt 2013
(ND|ET|IN)[^X]*
(DI|NS|TH|OM)*
.*(IN|SE|HI)
[CHMNOR]*I[CHM
NOR]*
C*MC(CCC|MM)*
([^EMC]|EM
)*
[CEIMU]*OH[AEMOR]*
[AM]*CM
(RC)*R?
N.*X.X.X.*E
.*XHCR.*X.*
(RR|HHH)*.?
(...?)\1*
.*XEXM*
[CR]*
[^C]*MMM[^C]*
(E|CR|MN)*
([^X]|XCC)*
.*OXR.*.*PRR.*DDC.*
R*D*M*
.*(.)(.)(.)(.)\4\3\2\1.*
(RX|[^R])*
.*SE.*UE.*.*LR.*RL.*
(S|MM|HHH)*
.*G.*V.*H.*
[^C]*[^R]*III.*
(HHX|[^HX])*
.(C|HH)*
.*DD.*CCM.*
P+(..)\1.*(O|RHH|MM)*
([^MC]|M
M|CC)*
.*(.)C\1X\1.*
F.*[AO].*[AO].*
[^M]*M[^M]*
.*H.*H.*
.*
.*
![Page 100: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/100.jpg)
A Regular Crossword
✤ Source: MIT Mystery Hunt 2013
✤ Solved in ~40 lines of Haskell with Genex!
(ND|ET|IN)[^X]*
(DI|NS|TH|OM)*
.*(IN|SE|HI)
[CHMNOR]*I[CHM
NOR]*
C*MC(CCC|MM)*
([^EMC]|EM
)*
[CEIMU]*OH[AEMOR]*
[AM]*CM
(RC)*R?
N.*X.X.X.*E
.*XHCR.*X.*
(RR|HHH)*.?
(...?)\1*
.*XEXM*
[CR]*
[^C]*MMM[^C]*
(E|CR|MN)*
([^X]|XCC)*
.*OXR.*.*PRR.*DDC.*
R*D*M*
.*(.)(.)(.)(.)\4\3\2\1.*
(RX|[^R])*
.*SE.*UE.*.*LR.*RL.*
(S|MM|HHH)*
.*G.*V.*H.*
[^C]*[^R]*III.*
(HHX|[^HX])*
.(C|HH)*
.*DD.*CCM.*
P+(..)\1.*(O|RHH|MM)*
([^MC]|M
M|CC)*
.*(.)C\1X\1.*
F.*[AO].*[AO].*
[^M]*M[^M]*
.*H.*H.*
.*
.*
![Page 101: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/101.jpg)
A Regular Crossword
✤ Source: MIT Mystery Hunt 2013
✤ Solved in ~40 lines of Haskell with Genex!
(ND|ET|IN)[^X]*
(DI|NS|TH|OM)*
.*(IN|SE|HI)
[CHMNOR]*I[CHM
NOR]*
C*MC(CCC|MM)*
([^EMC]|EM
)*
[CEIMU]*OH[AEMOR]*
[AM]*CM
(RC)*R?
N.*X.X.X.*E
.*XHCR.*X.*
(RR|HHH)*.?
(...?)\1*
.*XEXM*
[CR]*
[^C]*MMM[^C]*
(E|CR|MN)*
([^X]|XCC)*
.*OXR.*.*PRR.*DDC.*
R*D*M*
.*(.)(.)(.)(.)\4\3\2\1.*
(RX|[^R])*
.*SE.*UE.*.*LR.*RL.*
(S|MM|HHH)*
.*G.*V.*H.*
[^C]*[^R]*III.*
(HHX|[^HX])*
.(C|HH)*
.*DD.*CCM.*
P+(..)\1.*(O|RHH|MM)*
([^MC]|M
M|CC)*
.*(.)C\1X\1.*
F.*[AO].*[AO].*
[^M]*M[^M]*
.*H.*H.*
.*
.*
N H P E H A SD I O M O M T H
F O X N X A X P HM M O M M M M R H H
M C X N M M C R X E MC M C C C C M M M M M MH R X R C M I I I H X L SO R E O R E O R E O R EV C X C C H H M X C CR R R R H H H R R UN C X D X E X L ER R D D M M M MG C C H H C C
![Page 102: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/102.jpg)
SmallCheck: Enumerated Series
![Page 103: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/103.jpg)
SmallCheck: Enumerated Series
✤ Type-Level Literals: Numbers and Symbols
xs :: [Matching "a?b?c?"] xs = list 100 series
[,a,b,ab,c,ac,bc,abc]
![Page 104: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/104.jpg)
SmallCheck: Enumerated Series
✤ Type-Level Literals: Numbers and Symbols
✤ Check properties for all strings matching a regex
xs :: [Matching "a?b?c?"] xs = list 100 series
[,a,b,ab,c,ac,bc,abc]
![Page 105: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/105.jpg)
QuickCheck: Random Sampling
![Page 106: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/106.jpg)
QuickCheck: Random Sampling
✤ Regular Expressions and XML Schemata:
generate (matching rfc2822) "9%[email protected]"
![Page 107: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/107.jpg)
QuickCheck: Random Sampling
✤ Regular Expressions and XML Schemata:
generate (matching rfc2822) "9%[email protected]"
putStr . showXmlTree =<< generate . matchingRNG =<< loadRNG “book.rng”
<?xml version="1.0" encoding="UTF-8"?><book>
<author>[email protected]</author>
<author>[email protected]</author>
<author>[email protected]</author>
</book>
![Page 108: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/108.jpg)
2012: LiveScriptFeb 1: @gkz forked @satyr’s fork of .coffee
“Like a smaller language within Perl 6, struggling to get out…”
May 1: ST joined PeopleFluent at Bedford
June 1: CoffeeRedux by @michaelficarra
Launched JS2LS: @clkao, @gkz, @mpgutta
Coco
![Page 109: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/109.jpg)
2013: MoeDictFeb 1: Revised MoE Dictionary in HTML5
- Every word linked to its definition
- Fair Use and CC0 as legal frameworks
moedict.tw: Android, iOS, Firefox OS
Holo, Hakka, Cross-Strait Language DB
萌典
![Page 110: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/110.jpg)
May 2014: CUFP Program Committee
![Page 111: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/111.jpg)
May 2014: CUFP Program Committee
✤ “I enjoyed @simonmar's slides The Haxl Project at Facebook and the related /r/haskell discussions.
![Page 112: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/112.jpg)
May 2014: CUFP Program Committee
✤ “I enjoyed @simonmar's slides The Haxl Project at Facebook and the related /r/haskell discussions.
✤ It’s a reasonably easy-to-understand Commercial Use of Functional Programming that I plan to talk about in my FLOLAC’14 talk.
![Page 113: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/113.jpg)
May 2014: CUFP Program Committee
✤ “I enjoyed @simonmar's slides The Haxl Project at Facebook and the related /r/haskell discussions.
✤ It’s a reasonably easy-to-understand Commercial Use of Functional Programming that I plan to talk about in my FLOLAC’14 talk.
✤ Would it make sense to invite @simonmar to the CUFP keynote?”
![Page 114: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/114.jpg)
Fighting Spam with Pure Functions
![Page 115: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/115.jpg)
Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
![Page 116: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/116.jpg)
Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
✤ Jan 2013: FXL — Subset of ML, interpreted in C++
![Page 117: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/117.jpg)
Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
✤ Jan 2013: FXL — Subset of ML, interpreted in C++
If (Average(Map(Reputation, PreviousSharedUrls(User, 5))) < 0) Then [WarnUser, LogRequest] Else []
![Page 118: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/118.jpg)
Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
✤ Jan 2013: FXL — Subset of ML, interpreted in C++
✤ Aug 2013: Haxl compiler implemented in GHC
![Page 119: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/119.jpg)
Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
✤ Jan 2013: FXL — Subset of ML, interpreted in C++
✤ Aug 2013: Haxl compiler implemented in GHC
✤ Jun 2014: Deployed and Open Sourced
![Page 120: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/120.jpg)
Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
✤ Jan 2013: FXL — Subset of ML, interpreted in C++
✤ Aug 2013: Haxl compiler implemented in GHC
✤ Jun 2014: Deployed and Open Sourced
✤ Sep 2014: There is no fork @ ICFP
![Page 121: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/121.jpg)
FXL on Haxl
If (Average(Map(Reputation, PreviousSharedUrls(User, 5))) < 0) Then [WarnUser, LogRequest] Else []
![Page 122: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/122.jpg)
FXL on Haxl
If (Average(Map(Reputation, PreviousSharedUrls(User, 5))) < 0) Then [WarnUser, LogRequest] Else []
![Page 123: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/123.jpg)
FXL on Haxl
If (Average(Map(Reputation, PreviousSharedUrls(User, 5))) < 0) Then [WarnUser, LogRequest] Else []
Marlow et al, The Haxl Project at Facebook
![Page 124: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/124.jpg)
FXL on Haxl
If (Average(Map(Reputation, PreviousSharedUrls(User, 5))) < 0) Then [WarnUser, LogRequest] Else []
Marlow et al, The Haxl Project at Facebook
![Page 125: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/125.jpg)
Concurrency & Caching
![Page 126: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/126.jpg)
Concurrency & Caching
✤ With the Applicative Do macro:
fun :: Haxl String fun = [ado| x <- fetch “A” y <- fetch “B” z <- fetch y x ++ y ++ z |]
![Page 127: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/127.jpg)
Concurrency & Caching
✤ With the Applicative Do macro:
fun :: Haxl String fun = [ado| x <- fetch “A” y <- fetch “B” z <- fetch y x ++ y ++ z |]
fetch “A”
fetch “B”
![Page 128: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/128.jpg)
Concurrency & Caching
✤ With the Applicative Do macro:
fun :: Haxl String fun = [ado| x <- fetch “A” y <- fetch “B” z <- fetch y x ++ y ++ z |]
fetch “A”
fetch “B”
H A
![Page 129: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/129.jpg)
Concurrency & Caching
✤ With the Applicative Do macro:
fun :: Haxl String fun = [ado| x <- fetch “A” y <- fetch “B” z <- fetch y x ++ y ++ z |]
fetch “A”
fetch “B”
H A
fetch “A”
H
cached
![Page 130: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/130.jpg)
Concurrency & Caching
✤ With the Applicative Do macro:
fun :: Haxl String fun = [ado| x <- fetch “A” y <- fetch “B” z <- fetch y x ++ y ++ z |]
fetch “A”
fetch “B”
H A++
fetch “A”
H
cached
++
HAH
![Page 131: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/131.jpg)
Recap
![Page 132: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/132.jpg)
Recap
✤ Generators: List Fusion
![Page 133: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/133.jpg)
Recap
✤ Generators: List Fusion
✤ QuickCheck: Property Testing
![Page 134: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/134.jpg)
Recap
✤ Generators: List Fusion
✤ QuickCheck: Property Testing
✤ Macros: Multi-Stage Programming
![Page 135: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/135.jpg)
main :: IO ()Functional Programming as a means —
![Page 136: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/136.jpg)
main :: IO aFunctional Programming as a means —
![Page 137: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/137.jpg)
main :: IO aFunctional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
![Page 138: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/138.jpg)
main :: IO aFunctional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
main :: State# RealWorld
-> (# State# RealWorld, a #)
![Page 139: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/139.jpg)
main :: IO aFunctional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
main :: State# RealWorld
-> (# State# RealWorld, a #)
to observe the world,
![Page 140: Commercial Uses of Functional Programming](https://reader037.vdocuments.net/reader037/viewer/2022103016/554ab2b6b4c905ec668b5746/html5/thumbnails/140.jpg)
main :: IO aFunctional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
main :: State# RealWorld
-> (# State# RealWorld, a #)
to observe the world,to change it, and to create a new value.