Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. record Num (A : Set) : Set where
  2. field
  3. +-id : A
  4. *-id : A
  5. _+_ : A -> A -> A
  6. _-_ : A -> A -> A
  7. _*_ : A -> A -> A
  8.  
  9.  
  10. toFuncNum : ∀ {A : Set} (num : Num A) -> Num (A -> A)
  11. toFuncNum record { +-id = +-id ; *-id = *-id ; _+_ = _+_ ; _-_ = _-_ ; _*_ = _*_ }
  12. = record { +-id = const +-id
  13. ; *-id = const *-id
  14. ; _+_ = \f g x -> f x + g x
  15. ; _-_ = \f g x -> f x - g x
  16. ; _*_ = \f g x -> f x * g x
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement