From ee7a3cb9b9a1a7272bd7dbde1198626ad7849077 Mon Sep 17 00:00:00 2001 From: Jacob Errington Date: Sat, 8 Apr 2017 12:07:15 -0400 Subject: [PATCH] Prelude: implement Functor for `Pair a` This patch also adjusts the documentation test for Functor. --- libs/prelude/Prelude/Functor.idr | 3 +++ test/docs003/expected | 1 + 2 files changed, 4 insertions(+) diff --git a/libs/prelude/Prelude/Functor.idr b/libs/prelude/Prelude/Functor.idr index b60a1e02cc..db18e4858b 100644 --- a/libs/prelude/Prelude/Functor.idr +++ b/libs/prelude/Prelude/Functor.idr @@ -1,5 +1,6 @@ module Prelude.Functor +import Builtins import Prelude.Basics %access public export @@ -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) diff --git a/test/docs003/expected b/test/docs003/expected index ee3825eea8..b7e649ba14 100644 --- a/test/docs003/expected +++ b/test/docs003/expected @@ -10,6 +10,7 @@ Methods: The function is Total Implementations: + Functor (Pair a) Functor List Functor (IO' ffi) Functor Stream