moving on to the next revision and refinement. revisiting ideas.

This commit is contained in:
Pat Garrity 2026-01-16 21:17:57 -06:00
parent 825980ca31
commit 75ee8f04e5
Signed by: pfm
GPG key ID: 5CA5D21BAB7F3A76

75
docs/revision3.md Normal file
View file

@ -0,0 +1,75 @@
```
given A
def identity: A -> A
λ x => x
end def
given A
class Semigroup A
def combine: A -> A -> A
end class
given A :: Semigroup
class Monoid A
def empty: A
end class
given F *
class Functor
given A
given B
def map: F A -> (A -> B) -> F B
end class
given F * :: Functor
class Apply
given A
given B
def ap: F (A -> B) -> F A -> F B
end class
given F * :: Apply
class Applicative
given A
def pure: A -> F A
def unit: F ()
pure ()
end def
end class
given F * :: Apply
class FlatMap
given A
given B
def fmap: F A -> (A -> F B) -> F B
given A
def flatten: F (F A) -> F A
λ ffa => fmap ffa identity
end def
end class
given F * :: FlatMap, Applicative
class Monad
end class
instance Semigroup Int32
def combine: Int32 -> Int32 -> Int32
int32_add
end def
end instance
given A :: Semigroup
def +: A -> A -> A
combine
end def
def ex1: Int32 -> Int32
λ x => x + x
end def
def ex2: Int32 -> Int32
λ x => combine x x
end def
```