Skip to content

Commit

Permalink
Merge pull request idris-lang#3748 from tsani/pair-is-functor
Browse files Browse the repository at this point in the history
Prelude: implement Functor for `Pair a`
  • Loading branch information
Ahmad Salim Al-Sibahi committed Apr 16, 2017
2 parents bccb3a5 + ee7a3cb commit 502ad1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/prelude/Prelude/Functor.idr
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Prelude.Functor

import Builtins
import Prelude.Basics

%access public export
Expand All @@ -22,3 +23,5 @@ infixl 4 <$>
(<$>) : Functor f => (func : a -> b) -> f a -> f b
func <$> x = map func x

Functor (Pair a) where
map f (x, y) = (x, f y)
1 change: 1 addition & 0 deletions test/docs003/expected
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Methods:

The function is Total
Implementations:
Functor (Pair a)
Functor List
Functor (IO' ffi)
Functor Stream
Expand Down

0 comments on commit 502ad1f

Please sign in to comment.