Prelude.agda 590 B

1234567891011121314151617181920212223242526272829303132333435
  1. module Lib.Prelude where
  2. infixr 90 _∘_
  3. infixr 1 _,_
  4. id : {A : Set} -> A -> A
  5. id x = x
  6. _∘_ : {A : Set}{B : A -> Set}{C : {x : A} -> B x -> Set}
  7. (f : {x : A}(y : B x) -> C y)(g : (x : A) -> B x)(x : A) ->
  8. C (g x)
  9. (f ∘ g) x = f (g x)
  10. data Unit : Set where
  11. unit : Unit
  12. {-# COMPILE GHC Unit = data () (()) #-}
  13. postulate String : Set
  14. {-# BUILTIN STRING String #-}
  15. data _×_ (A B : Set) : Set where
  16. _,_ : A -> B -> A × B
  17. {-# COMPILE GHC _×_ = data (,) ((,)) #-}
  18. fst : {A B : Set} -> A × B -> A
  19. fst (x , y) = x
  20. snd : {A B : Set} -> A × B -> B
  21. snd (x , y) = y