:: a -> [a] -> [a] -package:hpp -package:frisby

The intersperse function takes an element and a list and `intersperses' that element between the elements of the list.

Laziness

intersperse has the following properties
>>> take 1 (intersperse undefined ('a' : undefined))
"a"
>>> take 2 (intersperse ',' ('a' : undefined))
"a*** Exception: Prelude.undefined

Examples

>>> intersperse ',' "abcde"
"a,b,c,d,e"
>>> intersperse 1 [3, 4, 5]
[3,1,4,1,5]
Append an element to the start of a list, an alias for (:).
cons 't' "est" == "test"
\x xs -> uncons (cons x xs) == Just (x,xs)
The intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example,
>>> intersperse ',' "abcde"
"a,b,c,d,e"
intersperse has the following laziness properties:
>>> take 1 (intersperse undefined ('a' : undefined))
"a"

>>> take 2 (intersperse ',' ('a' : undefined))
"a*** Exception: Prelude.undefined
The intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example,
>>> intersperse ',' "abcde"
"a,b,c,d,e"
init of non-empty list, safe. O(n). init1 a as = init (a:as)
O(n) Prepend an element.
O(n) Prepend an element
Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.

Examples

Perform a computation with Maybe and replace the result with a constant value if it is Just:
>>> 'a' <$ Just 2
Just 'a'

>>> 'a' <$ Nothing
Nothing
Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.
Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version. Using ApplicativeDo: 'a <$ bs' can be understood as the do expression
do bs
pure a
with an inferred Functor constraint.
Cons element to the vector
Append element to the vector
delete x removes the first occurrence of x from its list argument. It is a special case of deleteBy, which allows the programmer to supply their own equality test.

Examples

>>> delete 'a' "banana"
"bnana"
>>> delete "not" ["haskell", "is", "not", "awesome"]
["haskell","is","awesome"]
Cons an element on to the front of a list unless it is already there.
delete x removes the first occurrence of x from its list argument. For example,
>>> delete 'a' "banana"
"bnana"
It is a special case of deleteBy, which allows the programmer to supply their own equality test.