on master help sign in
Merge pull request #3748 from tsani/pair-is-functor

Prelude: implement Functor for `Pair a`

commit502ad1f57c37241b73200ca199fb7f5ea1b2cedc authorAhmad Salim Al-Sibahi <asal@itu.dk> dateSun 16 Apr 2017, 12:37 (10 years ago) parentbccb3a5ee7a3cb
2 files changed+4
libs/prelude/Prelude/Functor.idr+3 test/docs003/expected+1
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