on master help sign in
Change documentation of map

Accurate as it is, it's not necessarily useful to explain concepts using category theory terminology. Ideally, the documentation should give some intuition for those not yet familiar with the concepts.

commit3268c1bf5a25ab87b417334a80742bc952d7a26b authorEdwin Brady <ecb10@st-andrews.ac.uk> dateFri 9 Oct 2015, 14:57 (11 years ago) parentc7efd0a
1 file changed+10−8
libs/prelude/Prelude/Functor.idr+10−8
libs/prelude/Prelude/Functor.idr+10−8
@@ -2,19 +2,21 @@ module Prelude.Functor
22
33import Prelude.Basics
44
5−||| Functors
6−||| @ f the action of the functor on objects
5+||| Functors allow a uniform action over a parameterised type.
6+||| @ f a parameterised type
77class Functor (f : Type -> Type) where
8− ||| The action of the functor on morphisms
9− ||| @ f the functor
10− ||| @ m the morphism
8+ ||| Apply a function across everything of type 'a' in a
9+ ||| parameterised type
10+ ||| @ f the parameterised type
11+ ||| @ m the function to apply
1112 map : (m : a -> b) -> f a -> f b
1213
1314infixl 4 <$>
1415
15−||| An infix alias for `map`: the action of a functor on morphisms.
16−||| @ f the functor
17−||| @ m the morphism
16+||| An infix alias for `map`, applying a function across everything of
17+||| type 'a' in a parameterised type
18+||| @ f the parameterised type
19+||| @ m the function to apply
1820(<$>) : Functor f => (m : a -> b) -> f a -> f b
1921m <$> x = map m x
2022