Prelude.agda 550 B

123456789101112131415161718192021222324252627282930
  1. module Prelude where
  2. infixr 90 _∘_
  3. infixr 50 _∧_
  4. infix 20 _⟸⇒_
  5. infixl 3 _from_
  6. _from_ : (A : Set) -> A -> A
  7. A from a = a
  8. _∘_ : {A B C : Set} -> (A -> B) -> (C -> A) -> C -> B
  9. (f ∘ g) x = f (g x)
  10. record _∧_ (A B : Set) : Set where
  11. field
  12. p₁ : A
  13. p₂ : B
  14. open _∧_ public renaming (p₁ to fst; p₂ to snd)
  15. _,_ : {A B : Set} -> A -> B -> A ∧ B
  16. x , y = record { p₁ = x; p₂ = y }
  17. swap : {A B : Set} -> A ∧ B -> B ∧ A
  18. swap p = (snd p , fst p)
  19. _⇐⇒_ : Set -> Set -> Set
  20. A ⇐⇒ B = (A -> B) ∧ (B -> A)