@@ -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