[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn] [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]If the first list is not finite, the result is the first list. WARNING: This function takes linear time in the number of elements of the first list.
>>> Just 2 *> Just 3 Just 3
>>> Nothing *> Just 3 NothingOf course a more interesting use case would be to have effectful computations instead of just returning pure values.
>>> import Data.Char >>> import Text.ParserCombinators.ReadP >>> let p = string "my name is " *> munch1 isAlpha <* eof >>> readP_to_S p "my name is Simon" [("Simon","")]