SlideShare a Scribd company logo
1 of 22
Download to read offline
Revisiting
Combinators
Edward Kmett
data LC a
= Var a
| App (LC a) (LC a)
| Lam (LC (Maybe a))
deriving (Functor, Foldable, Traversable)
instance Applicative LC where pure = Var; (<*>) = ap
instance Monad LC where
Var a >>= f = f a
App l r >>= f = App (l >>= f) (r >>= f)
Lam k >>= f = Lam $ k >>= case
Nothing -> pure Nothing
Just a -> Just <$> f a
lam :: Eq a => a -> LC a -> LC a
lam v b = Lam $ bind v <$> b where
bind v u = u <$ guard (u /= v)
A Toy Lambda Calculus
A combinator is a function that has no free
variables.
What is a Combinator?
• Moses Shönfinkel (Моисей Исаевич Шейнфинкель), “Über die Bausteine der
mathematischen Logik” 1924
• Haskell Curry, “Grundlagen der Kombinatorischen Logik” 1930
• David Turner, “Another Algorithm for Bracket Abstraction” 1979
• Smullyan “To Mock a Mockingbird” 1985
• Sabine Broda and Lúis Damas “Bracket abstraction in the combinator system Cl(K)”
1987(?)
Introducing Combinators
data CL a = V a | A (CL a) (CL a) | S | K | I | B | C
deriving (Functor, Foldable, Traversable)
instance Applicative CL where pure = V; (<*>) = ap
instance Monad CL where
V a >>= f = f a
A l r >>= f = A (l >>= f) (r >>= f)
S >>= _ = S
K >>= _ = K
I >>= _ = I
B >>= _ = B
C >>= _ = C
A Toy Combinatory Logic
S x y z = (x z) (y z) -- (<*>)
K x y = x -- const
I x = x -- id
B x y z = x (y z) -- (.)
C x y z = x z y -- flip
Y f = f (Y f) = let x = f x in x -- fix
A Field Guide
infixl 1 %
(%) = A
compile :: LC a -> CL a
compile (Var a) = V a
compile (App l r) = compile l % compile r
compile (Lam b) = compileLam b
compileLam :: LC (Maybe a) -> CL a
compileLam (Var Nothing)) = I
compileLam (Var (Just y)) = K % V y
compileLam (Ap l r) = case (sequence l, sequence r) of
(Nothing, Nothing) -> S % compileLam l % compileLam r
(Nothing, Just r') -> C % compileLam l % compile r
(Just l', Nothing) -> B % compile l' % compileLam r
(Just l', Just r') -> K % (compile l' % compile r')
compileLam (Lam b) = join $ compileLam $ dist $ compileLam b where
dist :: C (Maybe a) -> L (Maybe (C a))
dist (A l r) = App (dist l) (dist r)
dist xs = Var (sequence xs)
Abstraction Elimination
Play with this at http://pointfree.io/ or with @pl on lambdabot
a la Shönfinkel
• John Hughes, “Super Combinators: A New Implementation Method for Applicative
Languages” 1982
• Lennart Augustsson, “A compiler for Lazy ML” 1984
• Simon Peyton Jones “Implementing lazy functional languages on stock hardware: the
Spineless Tagless G-machine” 1992
• Simon Marlow, Alexey Rodriguez Yakushev and Simon Peyton Jones “Faster laziness
using dynamic pointer tagging” 2007
Supercombinators
jmp %eax
Unknown Thunk Evaluation
Every Thunk in GHC is a SPECTRE v2 Vulnerability
• Small evaluator that immediately recovers
coherence between instructions.
• Scales with the product of the SIMD-width and # of
cores, rather than one or the other
• This bypasses the spectre issues.
• This generalizes to GPU compute shading
SPMD-on-SIMD Evaluation
Why are combinator terms
bigger?
• S x y z = (x z) (y z) — application with environment
• K x y = x — ignores environment
• I x — uses environment
• These all work “one variable at a time”
We need to be able to build and manipulate ‘partial’ environments in sublinear time.
Some references:
• Abadi, Cardelli, Curien, Lévy “Explicit Substitutions” 1990
• Lescanne, “From λσ to λν a journey through calculi of explicit substitutions” 1994
• Mazzoli, “A Well-Typed Suspension Calculus” 2017
Sketching an “improved”
abstraction elimination algorithm
fst (a,b) ~> a
snd (a,b) ~> b
Evaluation by Collection
• John Hughes, “The design and implementation of programming languages” 1983
• Philip Wadler, “Fixing some space leaks with a garbage collector” 1987
• Christina von Dorrien, “Stingy Evaluation” 1989
Some extra stingy combinator evaluation rules:
A (A K x) _ -> Just x -- def K
A I x -> Just x -- def I
A S K -> Just K_ -- Hudak 1
A S K_ -> Just I -- Hudak 2
A S k@(A K (A K _)) -> Just k -- Hudak 3
A (A S (A K x)) I -> Just x -- Hudak 4, Turner p35 2
A Y k@(A K _) -> Just k -- Hudak 9
(Be careful, not all of Hudak’s rules are stingy!)
• Paul Hudak and David Kranz, “A Combinator-based Compiler for a Functional
Language” 1984
One Bit Reference Counting
S
x
y
z
x yz z
(<*>)
W.R. Stoye, T.J.W. Clarke and A.C. Norman “Some Practical Methods for Rapid Combinator Reduction”
1984
One Bit Reference Counting
C
x
y
z
x
y
z
flip
One Bit Reference Counting
B
x
y
z
x
y z
(.)
K
x
y x
const
Extra reductions that require “uniqueness” to be stingy:
A (A (A C f) x) y -> Just $ A (A f y) x
A (A (A B f) g) x -> Just $ A f (A g x)
A (A S (A K x)) (A K y) -> Just $ A K (A x y) -- Hudak 5, Turner p35 1
A (A S (A K x)) y -> Just $ A (A B x) y -- Turner p35 3
A (A S x) (A K y) -> Just $ A (A C x) y -- Turner p35 4
fst p = p (xy.x)
pair x y z = z x y
snd p = p (xy.y)
fst = CIK
snd = CI(KI)
pair = BC(CI)
Can we reduce fst (x, y) ~> x by stingy evaluation
without special casing Wadler’s rules?
• None of the S,B,C,K,I… rules introduce new cycles
on the heap except Y.
• Hash-consing!
• Eiichi Goto “Monocopy and associative
algorithms in extended Lisp” 1974
• Eelco Dolstra, “Maximal Laziness” 2008
Optionally Acyclic Heaps
• Compilers for dependently typed languages are slow. Hash consign is usually bolted in as
an afterthought. I’d like an efficient default evaluator that automatically memoizes and
addresses unification and substitution concerns.
• Daniel Dougherty “Higher-order unification via combinators” 1993
Why I Care?

More Related Content

What's hot

Cysts of oral region (5)
Cysts of oral region (5)Cysts of oral region (5)
Cysts of oral region (5)
Janmi Pascual
 
Clinicopathologic Case Studies
Clinicopathologic Case StudiesClinicopathologic Case Studies
Clinicopathologic Case Studies
narayannaik
 

What's hot (20)

Cysts of oral region (5)
Cysts of oral region (5)Cysts of oral region (5)
Cysts of oral region (5)
 
Oroantral Fistula
Oroantral FistulaOroantral Fistula
Oroantral Fistula
 
Lipoma and liposarcoma
Lipoma and liposarcoma Lipoma and liposarcoma
Lipoma and liposarcoma
 
Ranula
RanulaRanula
Ranula
 
DALF C1
DALF C1DALF C1
DALF C1
 
Peripheral and central giant cell granuloma
Peripheral and central giant cell granulomaPeripheral and central giant cell granuloma
Peripheral and central giant cell granuloma
 
DEVELOPMENTAL DISTURBANCES OF SALIVARY GLAND.pptx
DEVELOPMENTAL DISTURBANCES OF SALIVARY GLAND.pptxDEVELOPMENTAL DISTURBANCES OF SALIVARY GLAND.pptx
DEVELOPMENTAL DISTURBANCES OF SALIVARY GLAND.pptx
 
peripheral ossifying fibroma
peripheral ossifying fibromaperipheral ossifying fibroma
peripheral ossifying fibroma
 
oral submucous fibrosis
oral submucous fibrosisoral submucous fibrosis
oral submucous fibrosis
 
Ameloblastoma
AmeloblastomaAmeloblastoma
Ameloblastoma
 
Mid facial fractures and their management
Mid facial fractures and their managementMid facial fractures and their management
Mid facial fractures and their management
 
Odontogenic tumors
Odontogenic tumorsOdontogenic tumors
Odontogenic tumors
 
Pharyngeal spaces
Pharyngeal spacesPharyngeal spaces
Pharyngeal spaces
 
Deep vein thrombosis agp
Deep vein thrombosis agpDeep vein thrombosis agp
Deep vein thrombosis agp
 
Salivary gland infections
Salivary gland infectionsSalivary gland infections
Salivary gland infections
 
Intestinal Obstruction, MUDASIR BASHIR
Intestinal Obstruction, MUDASIR BASHIRIntestinal Obstruction, MUDASIR BASHIR
Intestinal Obstruction, MUDASIR BASHIR
 
Non odontogenic cyst
Non odontogenic cystNon odontogenic cyst
Non odontogenic cyst
 
Clinicopathologic Case Studies
Clinicopathologic Case StudiesClinicopathologic Case Studies
Clinicopathologic Case Studies
 
Okc cp
Okc cpOkc cp
Okc cp
 
Seminar on Ameloblastoma
Seminar on AmeloblastomaSeminar on Ameloblastoma
Seminar on Ameloblastoma
 

Similar to Revisiting Combinators

Microsoft Word Practice Exercise Set 2
Microsoft Word   Practice Exercise Set 2Microsoft Word   Practice Exercise Set 2
Microsoft Word Practice Exercise Set 2
rampan
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5
Bryan O'Sullivan
 
TI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class FunctionsTI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class Functions
Eelco Visser
 
Laplace1 8merged
Laplace1 8mergedLaplace1 8merged
Laplace1 8merged
cohtran
 

Similar to Revisiting Combinators (20)

Optimization introduction
Optimization introductionOptimization introduction
Optimization introduction
 
Comonads in Haskell
Comonads in HaskellComonads in Haskell
Comonads in Haskell
 
Convergence Criteria
Convergence CriteriaConvergence Criteria
Convergence Criteria
 
Relaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networksRelaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networks
 
Monadologie
MonadologieMonadologie
Monadologie
 
Strong functional programming
Strong functional programmingStrong functional programming
Strong functional programming
 
Matrix calculus
Matrix calculusMatrix calculus
Matrix calculus
 
Good functional programming is good programming
Good functional programming is good programmingGood functional programming is good programming
Good functional programming is good programming
 
Planning Under Uncertainty With Markov Decision Processes
Planning Under Uncertainty With Markov Decision ProcessesPlanning Under Uncertainty With Markov Decision Processes
Planning Under Uncertainty With Markov Decision Processes
 
Microsoft Word Practice Exercise Set 2
Microsoft Word   Practice Exercise Set 2Microsoft Word   Practice Exercise Set 2
Microsoft Word Practice Exercise Set 2
 
FirstAndSecond.pptx.pdf
FirstAndSecond.pptx.pdfFirstAndSecond.pptx.pdf
FirstAndSecond.pptx.pdf
 
Real World Haskell: Lecture 5
Real World Haskell: Lecture 5Real World Haskell: Lecture 5
Real World Haskell: Lecture 5
 
TI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class FunctionsTI1220 Lecture 6: First-class Functions
TI1220 Lecture 6: First-class Functions
 
Introduction to complex networks
Introduction to complex networksIntroduction to complex networks
Introduction to complex networks
 
PARSING.ppt
PARSING.pptPARSING.ppt
PARSING.ppt
 
ML+Hadoop at NYC Predictive Analytics
ML+Hadoop at NYC Predictive AnalyticsML+Hadoop at NYC Predictive Analytics
ML+Hadoop at NYC Predictive Analytics
 
Applied Machine Learning For Search Engine Relevance
Applied Machine Learning For Search Engine Relevance Applied Machine Learning For Search Engine Relevance
Applied Machine Learning For Search Engine Relevance
 
lecture01_lecture01_lecture0001_ceva.pdf
lecture01_lecture01_lecture0001_ceva.pdflecture01_lecture01_lecture0001_ceva.pdf
lecture01_lecture01_lecture0001_ceva.pdf
 
QMC: Operator Splitting Workshop, A New (More Intuitive?) Interpretation of I...
QMC: Operator Splitting Workshop, A New (More Intuitive?) Interpretation of I...QMC: Operator Splitting Workshop, A New (More Intuitive?) Interpretation of I...
QMC: Operator Splitting Workshop, A New (More Intuitive?) Interpretation of I...
 
Laplace1 8merged
Laplace1 8mergedLaplace1 8merged
Laplace1 8merged
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Revisiting Combinators

  • 2. data LC a = Var a | App (LC a) (LC a) | Lam (LC (Maybe a)) deriving (Functor, Foldable, Traversable) instance Applicative LC where pure = Var; (<*>) = ap instance Monad LC where Var a >>= f = f a App l r >>= f = App (l >>= f) (r >>= f) Lam k >>= f = Lam $ k >>= case Nothing -> pure Nothing Just a -> Just <$> f a lam :: Eq a => a -> LC a -> LC a lam v b = Lam $ bind v <$> b where bind v u = u <$ guard (u /= v) A Toy Lambda Calculus
  • 3. A combinator is a function that has no free variables. What is a Combinator?
  • 4. • Moses Shönfinkel (Моисей Исаевич Шейнфинкель), “Über die Bausteine der mathematischen Logik” 1924 • Haskell Curry, “Grundlagen der Kombinatorischen Logik” 1930 • David Turner, “Another Algorithm for Bracket Abstraction” 1979 • Smullyan “To Mock a Mockingbird” 1985 • Sabine Broda and Lúis Damas “Bracket abstraction in the combinator system Cl(K)” 1987(?) Introducing Combinators
  • 5. data CL a = V a | A (CL a) (CL a) | S | K | I | B | C deriving (Functor, Foldable, Traversable) instance Applicative CL where pure = V; (<*>) = ap instance Monad CL where V a >>= f = f a A l r >>= f = A (l >>= f) (r >>= f) S >>= _ = S K >>= _ = K I >>= _ = I B >>= _ = B C >>= _ = C A Toy Combinatory Logic
  • 6. S x y z = (x z) (y z) -- (<*>) K x y = x -- const I x = x -- id B x y z = x (y z) -- (.) C x y z = x z y -- flip Y f = f (Y f) = let x = f x in x -- fix A Field Guide
  • 7. infixl 1 % (%) = A compile :: LC a -> CL a compile (Var a) = V a compile (App l r) = compile l % compile r compile (Lam b) = compileLam b compileLam :: LC (Maybe a) -> CL a compileLam (Var Nothing)) = I compileLam (Var (Just y)) = K % V y compileLam (Ap l r) = case (sequence l, sequence r) of (Nothing, Nothing) -> S % compileLam l % compileLam r (Nothing, Just r') -> C % compileLam l % compile r (Just l', Nothing) -> B % compile l' % compileLam r (Just l', Just r') -> K % (compile l' % compile r') compileLam (Lam b) = join $ compileLam $ dist $ compileLam b where dist :: C (Maybe a) -> L (Maybe (C a)) dist (A l r) = App (dist l) (dist r) dist xs = Var (sequence xs) Abstraction Elimination Play with this at http://pointfree.io/ or with @pl on lambdabot a la Shönfinkel
  • 8. • John Hughes, “Super Combinators: A New Implementation Method for Applicative Languages” 1982 • Lennart Augustsson, “A compiler for Lazy ML” 1984 • Simon Peyton Jones “Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine” 1992 • Simon Marlow, Alexey Rodriguez Yakushev and Simon Peyton Jones “Faster laziness using dynamic pointer tagging” 2007 Supercombinators
  • 9. jmp %eax Unknown Thunk Evaluation Every Thunk in GHC is a SPECTRE v2 Vulnerability
  • 10. • Small evaluator that immediately recovers coherence between instructions. • Scales with the product of the SIMD-width and # of cores, rather than one or the other • This bypasses the spectre issues. • This generalizes to GPU compute shading SPMD-on-SIMD Evaluation
  • 11. Why are combinator terms bigger? • S x y z = (x z) (y z) — application with environment • K x y = x — ignores environment • I x — uses environment • These all work “one variable at a time”
  • 12. We need to be able to build and manipulate ‘partial’ environments in sublinear time. Some references: • Abadi, Cardelli, Curien, Lévy “Explicit Substitutions” 1990 • Lescanne, “From λσ to λν a journey through calculi of explicit substitutions” 1994 • Mazzoli, “A Well-Typed Suspension Calculus” 2017 Sketching an “improved” abstraction elimination algorithm
  • 13. fst (a,b) ~> a snd (a,b) ~> b Evaluation by Collection • John Hughes, “The design and implementation of programming languages” 1983 • Philip Wadler, “Fixing some space leaks with a garbage collector” 1987 • Christina von Dorrien, “Stingy Evaluation” 1989
  • 14. Some extra stingy combinator evaluation rules: A (A K x) _ -> Just x -- def K A I x -> Just x -- def I A S K -> Just K_ -- Hudak 1 A S K_ -> Just I -- Hudak 2 A S k@(A K (A K _)) -> Just k -- Hudak 3 A (A S (A K x)) I -> Just x -- Hudak 4, Turner p35 2 A Y k@(A K _) -> Just k -- Hudak 9 (Be careful, not all of Hudak’s rules are stingy!) • Paul Hudak and David Kranz, “A Combinator-based Compiler for a Functional Language” 1984
  • 15. One Bit Reference Counting S x y z x yz z (<*>) W.R. Stoye, T.J.W. Clarke and A.C. Norman “Some Practical Methods for Rapid Combinator Reduction” 1984
  • 16. One Bit Reference Counting C x y z x y z flip
  • 17. One Bit Reference Counting B x y z x y z (.)
  • 19. Extra reductions that require “uniqueness” to be stingy: A (A (A C f) x) y -> Just $ A (A f y) x A (A (A B f) g) x -> Just $ A f (A g x) A (A S (A K x)) (A K y) -> Just $ A K (A x y) -- Hudak 5, Turner p35 1 A (A S (A K x)) y -> Just $ A (A B x) y -- Turner p35 3 A (A S x) (A K y) -> Just $ A (A C x) y -- Turner p35 4
  • 20. fst p = p (xy.x) pair x y z = z x y snd p = p (xy.y) fst = CIK snd = CI(KI) pair = BC(CI) Can we reduce fst (x, y) ~> x by stingy evaluation without special casing Wadler’s rules?
  • 21. • None of the S,B,C,K,I… rules introduce new cycles on the heap except Y. • Hash-consing! • Eiichi Goto “Monocopy and associative algorithms in extended Lisp” 1974 • Eelco Dolstra, “Maximal Laziness” 2008 Optionally Acyclic Heaps
  • 22. • Compilers for dependently typed languages are slow. Hash consign is usually bolted in as an afterthought. I’d like an efficient default evaluator that automatically memoizes and addresses unification and substitution concerns. • Daniel Dougherty “Higher-order unification via combinators” 1993 Why I Care?