Files
newt/tests/black/Prelude.newt
Steve Dunham c7593e831e Get AOC day1 working
- Fixes to codegen for literal cases.
- Fix parsing of string literals
- Work around stack overflow in Prettier
2024-10-22 20:30:20 -07:00

25 lines
487 B
Plaintext

module Prelude
data Nat : U where
Z : Nat
S : Nat -> Nat
data Maybe : U -> U where
Just : {a : U} -> a -> Maybe a
Nothing : {a : U} -> Maybe a
data Either : U -> U -> U where
Left : {a b : U} -> a -> Either a b
Right : {a b : U} -> b -> Either a b
data List : U -> U where
Nil : {a : U} -> List a
Cons : {a : U} -> a -> List a -> List a
-- Currently if I say _::_ = Cons, it gets curried
infixr 4 _::_
_::_ : {a : U} -> a -> List a -> List a
_::_ x xs = Cons x xs