Skip to content

Instantly share code, notes, and snippets.

@zraffer
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zraffer/a33d32bd9d629bce0f1b to your computer and use it in GitHub Desktop.
Save zraffer/a33d32bd9d629bce0f1b to your computer and use it in GitHub Desktop.
infixr 1 ~>
Relation_Arrow : Type -> Type
Relation_Arrow ob = (source, target: ob) -> Type
class RelationClass (ob: Type) where
(~>) : Relation_Arrow ob
record RelationRecord : Type where
MkRelation : (recOb: Type) -> (recInst: RelationClass recOb) -> RelationRecord
IsProductMorphism' : (RelationClass l, RelationClass r) => Relation_Arrow (l, r)
IsProductMorphism' (lS, rS) (lT, rT) = ((lS ~> lT), (rS ~> rT))
IsProductMorphism : (rL, rR: RelationRecord) -> Relation_Arrow ((recOb rL), (recOb rR))
IsProductMorphism rL rR = IsProductMorphism' @{recInst rL} @{recInst rR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment