packages feed

antelude-0.1.0: src/Antelude/Sequence.hs

{- |
Module      : Antelude.Sequence
Description : Contains some functions for numeric-types.
 Maintainer  : dneavesdev@pm.me
-}
module Antelude.Sequence
    ( module SeqExport
    , append
    , concat
    , prepend
    ) where

import safe           Antelude.Function ( flip )

import safe           Data.Sequence     as SeqExport hiding
    ( index
    , (!?)
    , (<|)
    , (><)
    , (|>)
    )
import safe qualified Data.Sequence     as Seq

-- | Add an element to the left (beginning) of a sequence
prepend :: a -> Seq a -> Seq a
prepend = (Seq.<|)

-- | Add an element to the right (end) of a sequence
append :: a -> Seq a -> Seq a
append = flip (Seq.|>)

-- | Concatenate two sequences
concat :: Seq a -> Seq a -> Seq a
concat = (Seq.><)