This tutorial explores how Haskell's pure functional paradigm aligns with λιβι.λ's λ-calculus foundations. You'll learn to:
- → Convert Haskell lambdas to λιβι.λ syntax
- → Implement currying patterns
- → Create interactive λ-calc exercises in GHCi
Haskell's Λ Functions
Haskell
identity :: a -> a identity = λx.x add :: a -> a -> a add = λx.λy.x
λιβι.λ Notation
(λx.x) -- Identity (λx.λy.x) -- Add
GHCi tip: Use :{
for blocks
λ> :{
add = λx -> λy -> x
λ> :}
Convert & Reduce
Result will appear here...
Currying Deep Dive
Concept | Haskell | λιβι.λ |
---|---|---|
Church Numeral |
two = λf → λx → f (f x)
|
(λf.λx.f(f x))
|
Partial Application |
succ two
|
(λn.λf.λx.f(n f x)) two
|
Reduction Visualizer
(λx.x) (λy.y) → <--β--> λy.y