Skip to content

Commit

Permalink
Merge pull request #3782 from tokiwa-software/lib_add_composition_own…
Browse files Browse the repository at this point in the history
…_and_becard

lib: Added composition operations O/B3 (owl and becard)
  • Loading branch information
michaellilltokiwa committed Sep 13, 2024
2 parents 8a1104b + ec2171c commit d523f47
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions lib/composition.fz
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
# To Dissect a Mockingbird: A Graphical Notation for the Lambda Calculus with Animated Reduction
# https://dkeenan.com/Lambda/
#
# Haskell package data.aviary.birds:
# https://hackage.haskell.org/package/data-aviary-0.4.0/docs/Data-Aviary-Birds.html
#
# Bird names from Raymond M Smullyan. 2000. To Mock a Mockingbird: and other
# logic puzzles including an amazing adventure in combinatory logic. Oxford
# University Press, USA.
Expand Down Expand Up @@ -88,7 +91,7 @@ public composition is
# Haskell: ?
# public Mstar(f (T->T,T)->T) T->T => x-> f f x

# ?
# I*
# reverse apply
# Bird: thrush
# BQN: ?
Expand Down Expand Up @@ -134,12 +137,19 @@ public composition is
public compose(f U -> V, g T -> U) T -> V => f ∘ g

# B1
# Elementare Compositor, 1° <- 2° composition
# Elementary Compositor, 1° <- 2° composition
# Bird: Blackbird
# BQN: ∘
# Haskell: .: or ...
public atop(f V -> W, g (T,U) -> V) (T,U) -> W => (x,y) -> f (g x y)

# B3
# triple compositor
# Bird: Becard
# BQN:
# Haskell:
public becard(f C -> D, g B -> C, h A -> B) A -> D => f ∘ g ∘ h

# B
# composition of one unary function f and one binary function g...
# Bird: Bluebird
Expand Down Expand Up @@ -213,6 +223,12 @@ public composition is
public const1(T, U type, v T) U -> T => x -> v
public const2(T, U, V type, v T) (U,V) -> T => (x,y) -> v

# O
#
# Bird: Owl
# BQN: ?
# Haskell: ?
public owl(f (A -> B) -> A, g A -> B) B => (g ∘ f).call g

# The Y fixed-point combinator
# \f.(\x.f(xx))(\x.f(xx))
Expand Down

0 comments on commit d523f47

Please sign in to comment.