Traverable
ListTraversable
This class implements the Traversable behavior for the built-in list type.
Source code in funclift/traverable.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
Traversable
Bases: Generic[F, A]
, Protocol
Traversable F is a Functor and also a Foldable.
Need to provide default implementations for the following two methods: mapM :: Monad m => (a -> m b) -> t a -> m (t b) sequence :: Monad m => t (m a) -> m (t a)
Source code in funclift/traverable.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
traverse(f)
AP[B] is an Applicative. traverse :: F[A] -> (A -> AP[B]) -> AP[F[B]]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
f |
Callable[[A], Applicative[AP, B]]
|
description |
required |
Returns:
Type | Description |
---|---|
Applicative[AP, Functor[F, B]]
|
Applicative[AP, Functor[F, B]]: description |
Source code in funclift/traverable.py
29 30 31 32 33 34 35 36 37 38 39 40 41 |
|