Skip to content

Commit 7755eb4

Browse files
committed
Added Foldable and Functor as supers of Traversable
1 parent 750642a commit 7755eb4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525

2626
### Values
2727

28-
all :: forall a f. (Foldable f) => (a -> Prim.Boolean) -> f a -> Prim.Boolean
28+
all :: forall a f. (Foldable f) => (a -> Boolean) -> f a -> Boolean
2929

30-
and :: forall f. (Foldable f) => f Prim.Boolean -> Prim.Boolean
30+
and :: forall f. (Foldable f) => f Boolean -> Boolean
3131

32-
any :: forall a f. (Foldable f) => (a -> Prim.Boolean) -> f a -> Prim.Boolean
32+
any :: forall a f. (Foldable f) => (a -> Boolean) -> f a -> Boolean
3333

34-
elem :: forall a f. (Eq a, Foldable f) => a -> f a -> Prim.Boolean
34+
elem :: forall a f. (Eq a, Foldable f) => a -> f a -> Boolean
3535

36-
find :: forall a f. (Foldable f) => (a -> Prim.Boolean) -> f a -> Maybe a
36+
find :: forall a f. (Foldable f) => (a -> Boolean) -> f a -> Maybe a
3737

3838
fold :: forall f m. (Foldable f, Monoid m) => f m -> m
3939

@@ -47,15 +47,15 @@
4747

4848
mconcat :: forall f m. (Foldable f, Monoid m) => f m -> m
4949

50-
notElem :: forall a f. (Eq a, Foldable f) => a -> f a -> Prim.Boolean
50+
notElem :: forall a f. (Eq a, Foldable f) => a -> f a -> Boolean
5151

52-
or :: forall f. (Foldable f) => f Prim.Boolean -> Prim.Boolean
52+
or :: forall f. (Foldable f) => f Boolean -> Boolean
5353

54-
product :: forall f. (Foldable f) => f Prim.Number -> Prim.Number
54+
product :: forall f. (Foldable f) => f Number -> Number
5555

5656
sequence_ :: forall a f m. (Applicative m, Foldable f) => f (m a) -> m Unit
5757

58-
sum :: forall f. (Foldable f) => f Prim.Number -> Prim.Number
58+
sum :: forall f. (Foldable f) => f Number -> Number
5959

6060
traverse_ :: forall a b f m. (Applicative m, Foldable f) => (a -> m b) -> f a -> m Unit
6161

@@ -64,7 +64,7 @@
6464

6565
### Type Classes
6666

67-
class Traversable t where
67+
class (Functor t, Foldable t) <= Traversable t where
6868
traverse :: forall a b m. (Applicative m) => (a -> m b) -> t a -> m (t b)
6969
sequence :: forall a m. (Applicative m) => t (m a) -> m (t a)
7070

@@ -86,4 +86,4 @@
8686

8787
for :: forall a b m t. (Applicative m, Traversable t) => t a -> (a -> m b) -> m (t b)
8888

89-
zipWithA :: forall m a b c. (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m [c]
89+
zipWithA :: forall m a b c. (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m [c]

src/Data/Traversable.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Data.Foldable
88
import Data.Maybe
99
import Data.Tuple
1010

11-
class Traversable t where
11+
class (Functor t, Foldable t) <= Traversable t where
1212
traverse :: forall a b m. (Applicative m) => (a -> m b) -> t a -> m (t b)
1313
sequence :: forall a m. (Applicative m) => t (m a) -> m (t a)
1414

0 commit comments

Comments
 (0)