SPECIMENS CATALOGED 0000
haskell.monster

GLYPTOTHEK ANNEX

Nocturnal Acquisitions Bureau

VOL. VII · MMXXVI

After-Hours Edition

PLATE · I

THE PURE FUNCTION Kouros torso, headless. Parian marble, c. 530 BCE. Recovered from the eastern ambulatory. The figure declares only itself — input enters, identity emerges, nothing is altered, nothing is added.

PLATE · I

λ

THE PURE FUNCTION

A specimen of unmediated mapping

id :: a -> a
id x = x

const :: a -> b -> a
const x _ = x
  1. F.1Reflexivityid ∘ f ≡ f
  2. F.2Right Identityf ∘ id ≡ f

A function in this register is not a procedure but a mapping: a finished correspondence between two sets, written once, never edited. It does not consult the world; it does not return on a Tuesday with different news. The kouros stands without a head because the head, like a side effect, was never the point.

See: Kahnweiler, "Notes sur la fonction pure" (Galerie Vollard, 1909) — though the manuscript is, like much of this collection, a fiction.

SPEC-0007 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 02:14 AM 7a5230-3e2f1f-b9a88e-c4a878

PLATE · II

THE LAZY LIST Roman aqueduct fragment, travertine. Reconstructed from sixteen drum-sections still embedded in the substructure. The arches continue beyond the photograph; one might descend any one of them, but the visitor will never reach the spring.

PLATE · II

λ

THE LAZY LIST

A specimen of postponed enumeration

data List a = Nil | Cons a (List a)

repeat :: a -> List a
repeat x = Cons x (repeat x)

take :: Int -> List a -> List a
take 0 _           = Nil
take _ Nil         = Nil
take n (Cons x xs) = Cons x (take (n-1) xs)
  1. L.1Productivityhead (repeat x) ≡ x
  2. L.2Termination by demandtake 0 ⊥ ≡ Nil
  3. L.3Coinductive identityrepeat x ≡ Cons x (repeat x)

The lazy list is the aqueduct that runs forever because no one has yet asked the next stone for its weight. Demand, in this gallery, is the only force that can quarry a value from the dark. Until the visitor's hand is offered, the marble is content to remain unevaluated.

SPEC-0014 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 02:31 AM 3e2f1f-7a5230-15110d-c4a878

PLATE · III

THE MONAD Cracked oil amphora, neck only. The body lost to the bombardment of 1944. What remains is the vessel's permission — the channel through which one liquid passed into the next, in order, with a memory of order.

PLATE · III

λ

THE MONAD

A specimen of computational sequencing

class Applicative m => Monad m where
    return :: a -> m a
    (>>=)  :: m a -> (a -> m b) -> m b

-- the kleisli composition
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
f >=> g = \x -> f x >>= g
  1. M.1Left Identityreturn a >>= f ≡ f a
  2. M.2Right Identitym >>= return ≡ m
  3. M.3Associativity(m >>= f) >>= g ≡ m >>= (\x -> f x >>= g)

The amphora's neck is the bind: it is what lets one stage pour into the next without spilling the world. The pure value is poured in at the top and falls cleanly through the channel, but the channel itself remembers — every effect is carried in the curve of the clay.

SPEC-0023 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 02:47 AM 15110d-7a5230-3e2f1f-8a2a1f

PLATE · IV

THE FUNCTOR Chipped marble hand grasping a scroll. The scroll's text was lost to the abrasion of pilgrim thumbs over six centuries. Only the gesture of holding remains, transferring its meaning to whatever is placed inside it.

PLATE · IV

λ

THE FUNCTOR

A specimen of structure-preserving transport

class Functor f where
    fmap :: (a -> b) -> f a -> f b

-- the contextual lift
(<$>) :: Functor f => (a -> b) -> f a -> f b
(<$>) = fmap
  1. U.1Identityfmap id ≡ id
  2. U.2Compositionfmap (g ∘ f) ≡ fmap g ∘ fmap f

The hand is the vessel of transport: whatever you place into it is carried, intact, from one column of meaning to another, without the hand itself being changed. The functor is the gesture, not the gripped thing.

Compare: Boulez, "Notations II — Sur la transposition de la forme" (Universal, 1980), in which an analogous idea is set in the upper voice.

SPEC-0031 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 03:02 AM b9a88e-3e2f1f-5c4a2e-c4a878

PLATE · V

THE TYPECLASS Caryatid silhouette, missing arms. The figure bore the entablature for nineteen centuries before the arms gave way; the burden remains, distributed now across the contract of all who follow her.

PLATE · V

λ

THE TYPECLASS

A specimen of named obligation

class Eq a where
    (==) :: a -> a -> Bool
    (/=) :: a -> a -> Bool
    x /= y = not (x == y)

class Eq a => Ord a where
    compare :: a -> a -> Ordering
  1. T.1Reflexivityx == x ≡ True
  2. T.2Symmetryx == y ≡ y == x
  3. T.3Transitivityx == y ∧ y == z ⇒ x == z

A typeclass is a vow of bearing. The caryatid does not say I am marble; she says I will hold the architrave. Any stone that takes that vow becomes, for the purposes of the temple, a caryatid. The contract is not the substance — it is the labour.

SPEC-0042 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 03:18 AM 5c4a2e-7a5230-b9a88e-1f2a1e

PLATE · VI

THE CATAMORPHISM Weathered bronze chimera head. The patina has settled into the eye sockets and between the teeth in nocturnal verdigris. The chimera is not built from her parts; she is what remains when each part has been folded into the next.

PLATE · VI

λ

THE CATAMORPHISM

A specimen of generalized fold

cata :: Functor f => (f a -> a) -> Fix f -> a
cata alg = alg . fmap (cata alg) . unFix

-- Recovered as a fold over List
foldr :: (a -> b -> b) -> b -> [a] -> b
foldr _ z []     = z
foldr f z (x:xs) = f x (foldr f z xs)
  1. C.1Universal propertyh ≡ cata φ ⇔ h ∘ in ≡ φ ∘ fmap h
  2. C.2Fusiong ∘ cata φ ≡ cata ψ when g ∘ φ ≡ ψ ∘ fmap g
  3. C.3Reflectioncata in ≡ id

The chimera is a fold. Lion, goat, serpent — three algebras laid one against the next, each consuming the previous shape and returning a new one. By the time you reach her teeth, the lion is gone; only the bronze that was lion remains, recombined.

SPEC-0058 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 03:36 AM 1f2a1e-7a5230-3e2f1f-c4a878

PLATE · VII

THE FINAL COALGEBRA Empty pedestal at night. The figure that stood here is unrecorded; the dust pattern on the plinth suggests a foot, a stride, a continuation that has already begun. The pedestal does not end — it is the place where ending becomes another departure.

PLATE · VII

λ

THE FINAL COALGEBRA

A specimen of unbounded continuation

data Stream a = a :> Stream a

ana :: Functor f => (a -> f a) -> a -> Nu f
ana coalg = wrap . fmap (ana coalg) . coalg

unfold :: (b -> (a, b)) -> b -> Stream a
unfold f b = let (a, b') = f b in a :> unfold f b'
  1. N.1Universal propertyh ≡ ana ψ ⇔ out ∘ h ≡ fmap h ∘ ψ
  2. N.2Reflectionana out ≡ id
  3. N.3Productivityhead (unfold f b) is well-defined for total f

The pedestal is empty because the specimen has not stopped arriving. A coalgebra is the law of the next step; the final coalgebra is the law that is large enough to contain every step that follows. The visitor leaves the gallery, but the catalog continues — somewhere, an unobserved register is still incrementing.

SPEC-0079 RECOVERED 0 GLYPTOTHEK ANNEX · CATALOGED 03:51 AM 0e0c0a-15110d-3e2f1f-8a2a1f