mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 00:22:51 -06:00
operations in the abstract syntax
This commit is contained in:
13
testsuite/compiler/check/abstract-operations/Nat.gf
Normal file
13
testsuite/compiler/check/abstract-operations/Nat.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
abstract Nat = {
|
||||
|
||||
cat Nat ;
|
||||
data zero : Nat ;
|
||||
succ : Nat -> Nat ;
|
||||
|
||||
oper plus : Nat -> Nat -> Nat ;
|
||||
def plus zero y = y ;
|
||||
plus (succ x) y = succ (plus x y) ;
|
||||
|
||||
oper twice : Nat -> Nat = \x -> plus x x ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user