{- |
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 :: forall a. a -> Seq a -> Seq a
prepend = a -> Seq a -> Seq a
forall a. a -> Seq a -> Seq a
(Seq.<|)

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

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