@@ -21,12 +21,12 @@ nonEmptyList = 0 :| empty
21
21
22
22
##### Instances
23
23
``` purescript
24
- instance showNonEmpty :: (Show a, Show (f a)) => Show (NonEmpty f a)
25
- instance eqNonEmpty :: (Eq a, Eq (f a)) => Eq (NonEmpty f a)
26
- instance ordNonEmpty :: (Ord a, Ord (f a)) => Ord (NonEmpty f a)
27
- instance functorNonEmpty :: (Functor f) => Functor (NonEmpty f)
28
- instance foldableNonEmpty :: (Foldable f) => Foldable (NonEmpty f)
29
- instance traversableNonEmpty :: (Traversable f) => Traversable (NonEmpty f)
24
+ (Show a, Show (f a)) => Show (NonEmpty f a)
25
+ (Eq a, Eq (f a)) => Eq (NonEmpty f a)
26
+ (Ord a, Ord (f a)) => Ord (NonEmpty f a)
27
+ (Functor f) => Functor (NonEmpty f)
28
+ (Foldable f) => Foldable (NonEmpty f)
29
+ (Traversable f) => Traversable (NonEmpty f)
30
30
```
31
31
32
32
#### ` singleton `
@@ -50,7 +50,7 @@ An infix synonym for `NonEmpty`.
50
50
#### ` foldl1 `
51
51
52
52
``` purescript
53
- foldl1 :: forall f a s . (Foldable f) => (a -> a -> a) -> NonEmpty f a -> a
53
+ foldl1 :: forall f a. (Foldable f) => (a -> a -> a) -> NonEmpty f a -> a
54
54
```
55
55
56
56
Fold a non-empty structure, collecting results using a binary operation.
@@ -83,4 +83,20 @@ fromNonEmpty :: forall f a r. (a -> f a -> r) -> NonEmpty f a -> r
83
83
oneOf :: forall f a. (Alternative f) => NonEmpty f a -> f a
84
84
```
85
85
86
+ #### ` head `
87
+
88
+ ``` purescript
89
+ head :: forall f a. NonEmpty f a -> a
90
+ ```
91
+
92
+ Get the 'first' element of a non-empty container.
93
+
94
+ #### ` tail `
95
+
96
+ ``` purescript
97
+ tail :: forall f a. NonEmpty f a -> f a
98
+ ```
99
+
100
+ Get everything but the 'first' element of a non-empty container.
101
+
86
102
0 commit comments