:: a -> [a] -> [a] package:cabal-install-solver

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"
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