Skip to content

Commit cd501b6

Browse files
aestevebishabosha
andauthored
less concrete and more accurate definition of a Functor
Co-Authored-By: Jamie Thompson <[email protected]>
1 parent 334c4b4 commit cd501b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/reference/contextual/typeclasses-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ assert(3 == List(1, 2).combineAll)
7979

8080
### Functors:
8181

82-
A `Functor` represents the ability for a type containing zero or more elements to be "mapped over", i.e. apply a function to every of its elements.
82+
A `Functor` for a type provides the ability for its values to be "mapped over", i.e. apply a function that transforms inside a value while remembering its shape. For example, to modify every element of a collection without dropping or adding elements.
8383
Let's name our "type containing zero or more elements" `F`. It's a type constructor: the type of its values becomes concrete when provided a type argument.
8484
Therefore we'll write it `F[_]` since we don't really care about the type of the elements it contains.
8585
The definition of the `Functor` ability would thus be written as:

0 commit comments

Comments
 (0)