additional syntactic sugar

- allow multiple names in infix, typesig, and dcon defs
- align fixities with Idris
This commit is contained in:
2024-10-23 21:41:36 -07:00
parent 8c8cdf4f7f
commit 8fe9613c02
8 changed files with 40 additions and 45 deletions

View File

@@ -11,10 +11,8 @@ module Oper
-- long term, I might want TopContext in the parser, and parse a top-level
-- declaration at a time (for incremental updates), but much longer term.
infixl 4 _+_
infixl 4 _-_
infixl 5 _*_
infixl 5 _/_
infixl 8 _+_ _-_
infixl 9 _*_ _/_
ptype Int
ptype String
@@ -33,7 +31,7 @@ _+_ x y = plus x y
test : Int -> Int
test x = 42 + x * 3 + 2
infixr 2 _,_
infixr 0 _,_
data Pair : U -> U -> U where
_,_ : {A B : U} -> A -> B -> Pair A B

View File

@@ -18,7 +18,7 @@ data List : U -> U where
-- Currently if I say _::_ = Cons, it gets curried
infixr 4 _::_
infixr 7 _::_
_::_ : {a : U} -> a -> List a -> List a
_::_ x xs = Cons x xs