mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-10 05:29:30 -06:00
16 lines
404 B
Plaintext
16 lines
404 B
Plaintext
Additive : Type -> Type
|
|
Additive A = { zero : A; plus : A -> A -> A }
|
|
|
|
additive_Integer : Additive Integer
|
|
additive_Integer = { zero = 0; plus = prim_add_Int }
|
|
|
|
sum : (A:Type) -> Additive A -> List A -> A
|
|
sum _ d (Nil _) = d.zero
|
|
sum A d (Cons _ x xs) = d.plus x (sum A d xs)
|
|
|
|
Showable : Type -> Type
|
|
Showable A = { show : A -> String }
|
|
|
|
|
|
--Compositional : Type -> Type
|
|
--Compositional A = { composOp : } |