gluon 0.13.1

A static, type inferred programming language for application embedding
Documentation
//@NO-IMPLICIT-PRELUDE
//! Implementation of the `Category` type

#[implicit]
type Category (cat : Type -> Type -> Type) = {
    id : forall a . cat a a,
    compose : forall a b c . cat b c -> cat a b -> cat a c
}

let id ?cat : forall cat a . [Category cat] -> cat a a = cat.id
let compose ?cat : forall a b c . [Category cat] -> cat b c -> cat a b -> cat a c = cat.compose

/// Right-to-left composition. Alias for `compose`.
#[infix(right, 9)]
let (<<) : forall a b c . [Category cat] -> cat b c -> cat a b -> cat a c = compose

/// Left-to-right composition. Alias for `compose`, but with the arguments flipped.
#[infix(left, 9)]
let (>>) f g : forall a b c . [Category cat] -> cat a b -> cat b c -> cat a c = compose g f

{
    Category,
    id, compose,

    (<<),
    (>>),
}