71. 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.”
72. 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…”
73. 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.”
74. 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?”
75. 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 :)”
80. Input: 25GB/day
Throughput: 500GB/day
DOM-Style selectors
O(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’”
81. Input: 25GB/day
Throughput: 500GB/day
DOM-Style selectors
O(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’”
82. Input: 25GB/day
Throughput: 500GB/day
DOM-Style selectors
O(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 :)”
83. 2005: Pugs
Feb 1: Started on Freenode #haskell
Lambdas & Camels joined in #perl6
Specification revised, iterated, tested
Concurrency, Coroutines, Commit Bits!
84. 2006: Erdősing
YAPC: Worst is Best on targeting JS
OOPSLA: Reconciling the Irreconcilable
Succeeded by Moose & Rakudo
Perl 5 runtime became Modern Perl
Concluding talk: Optimizing for Fun
楽
⼟土
85. 2007: S-Team
New tech stack: Jifty, Moose, and GHC
OpenAFP Utilities: Report Generation,
Extraction, Management, Distribution,
Conversion…
Enhanced & eventually replaced IBM
OnDemand with PDF-based workflow
86. 2008: Socialtext
Midlife 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)?
87. 2009: SocialCalc
Worked 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
90. May 2011
✤ “Can you write me some code that takes a regular expression
and enumerates the domain it accepts?”
91. 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.
92. 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? :-)”
101. 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[CHMNOR]*
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*
.*(.)(.)(.)(.)4321.*
(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]|MM|CC)*
.*(.)C1X1.*
F.*[AO].*[AO].*
[^M]*M[^M]*
.*H.*H.*
.*
.*
N H P E H A S
D I O M O M T H
F O X N X A X P H
M M O M M M M R H H
M C X N M M C R X E M
C M C C C C M M M M M M
H R X R C M I I I H X L S
O R E O R E O R E O R E
V C X C C H H M X C C
R R R R H H H R R U
N C X D X E X L E
R R D D M M M M
G C C H H C C
103. 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]
104. 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]
108. 2012: LiveScript
Feb 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
109. 2013: MoeDict
Feb 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
萌典
111. May 2014: CUFP Program Committee
✤ “I enjoyed @simonmar's slides The Haxl Project at
Facebook and the related /r/haskell discussions.
112. 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.
113. 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?”
115. Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
116. Fighting Spam with Pure Functions
✤ Nov 2012: Simon Marlow joins Facebook
✤ Jan 2013: FXL — Subset of ML, interpreted in C++
117. 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 []
118. 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
119. 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
120. 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
121. FXL on Haxl
If (Average(Map(Reputation,
PreviousSharedUrls(User, 5))) < 0)
Then [WarnUser, LogRequest] Else []
122. FXL on Haxl
If (Average(Map(Reputation,
PreviousSharedUrls(User, 5))) < 0)
Then [WarnUser, LogRequest] Else []
123. FXL on Haxl
If (Average(Map(Reputation,
PreviousSharedUrls(User, 5))) < 0)
Then [WarnUser, LogRequest] Else []
Marlow et al, The Haxl Project at Facebook
124. FXL on Haxl
If (Average(Map(Reputation,
PreviousSharedUrls(User, 5))) < 0)
Then [WarnUser, LogRequest] Else []
Marlow et al, The Haxl Project at Facebook
126. Concurrency & Caching
✤ With the Applicative Do macro:
fun :: Haxl String
fun = [ado|
x <- fetch “A”
y <- fetch “B”
z <- fetch y
x ++ y ++ z
|]
127. 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”
128. 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
129. 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
130. 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
135. main :: IO ()
Functional Programming as a means —
136. main :: IO a
Functional Programming as a means —
137. main :: IO a
Functional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
138. main :: IO a
Functional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
main :: State# RealWorld
-> (# State# RealWorld, a #)
139. main :: IO a
Functional Programming as a means —
newtype IO a =
IO ( State# RealWorld
-> (# State# RealWorld, a #))
main :: State# RealWorld
-> (# State# RealWorld, a #)
to observe the world,
140. main :: IO a
Functional 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.