Prelude: implement Functor for `Pair a`
This patch also adjusts the documentation test for Functor.
commitee7a3cb9b9a1a7272bd7dbde1198626ad7849077
authorJacob Errington <git@mail.jerrington.me>
dateSat 8 Apr 2017, 12:07 (10 years ago)
parent7bd33c2
libs/prelude/Prelude/Functor.idr+3
@@ -1,5 +1,6 @@
11module Prelude.Functor
22
3+import Builtins
34import Prelude.Basics
45
56%access public export
@@ -22,3 +23,5 @@ infixl 4 <$>
2223(<$>) : Functor f => (func : a -> b) -> f a -> f b
2324func <$> x = map func x
2425
26+Functor (Pair a) where
27+ map f (x, y) = (x, f y)
test/docs003/expected+1
@@ -10,6 +10,7 @@ Methods:
1010
1111 The function is Total
1212Implementations:
13+ Functor (Pair a)
1314 Functor List
1415 Functor (IO' ffi)
1516 Functor Stream