61 lines · 1.1 KB · Text
RawDownload
-- a mini prelude module Stuff public exportdata Bool = True | False public exportnot : Bool -> Boolnot True = Falsenot False = True public exportdata Maybe a = Nothing | Just a public exportintToBool : Int -> BoolintToBool 0 = FalseintToBool x = True public exportifThenElse : Bool -> Lazy a -> Lazy a -> aifThenElse True t e = tifThenElse False t e = e public exportdata Nat = Z | S Nat public exportfromInteger : Integer -> NatfromInteger x = ifThenElse (intToBool (prim__eq_Integer x 0))                      Z (S (fromInteger (prim__sub_Integer x 1))) public exportplus : Nat -> Nat -> Natplus Z y = yplus (S k) y = S (plus k y) infixr 5 :: public exportdata List a = Nil | (::) a (List a) public exportdata Equal : a -> b -> Type where     Refl : (0 x : a) -> Equal x x public exportdata Unit = MkUnit public exportdata Pair : Type -> Type -> Type where     MkPair : {0 a, b : Type} -> (1 x : a) -> (1 y : b) -> Pair a b public exportdata Unrestricted : Type -> Type where     Un : (x : a) -> Unrestricted a public exportthe : (a : Type) -> a -> athe _ x = x

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t