Hoogle Search

Within LTS Haskell 24.67 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. asSDeque :: SDeque s a -> SDeque s a

    mutable-containers Data.Mutable

    Since 0.2.0

  2. asUDeque :: UDeque s a -> UDeque s a

    mutable-containers Data.Mutable

    Since 0.2.0

  3. data NESeq a

    nonempty-containers Data.Sequence.NonEmpty

    A general-purpose non-empty (by construction) finite sequence type. Non-emptiness means that:

    • Functions that take an NESeq can safely operate on it with the assumption that it has at least value.
    • Functions that return an NESeq provide an assurance that the result has at least one value.
    Data.Sequence.NonEmpty re-exports the API of Data.Sequence, faithfully reproducing asymptotics, typeclass constraints, and semantics. Functions that ensure that input and output maps are both non-empty (like <|) return NESeq, but functions that might potentially return an empty map (like tail) return a Seq instead. You can directly construct an NESeq with the API from Data.Sequence.NonEmpty; it's more or less the same as constructing a normal Seq, except you don't have access to empty. There are also a few ways to construct an NESeq from a Seq:
    1. The nonEmptySeq smart constructor will convert a Seq a into a Maybe (NESeq a), returning Nothing if the original Seq was empty.
    2. You can use :<||, :||>, and insertSeqAt to insert a value into a Seq to create a guaranteed NESeq.
    3. You can use the IsNonEmpty and IsEmpty patterns to "pattern match" on a Seq to reveal it as either containing a NESeq or an empty sequence.
    4. withNonEmpty offers a continuation-based interface for deconstructing a Seq and treating it as if it were an NESeq.
    You can convert an NESeq into a Seq with toSeq or IsNonEmpty, essentially "obscuring" the non-empty property from the type.

  4. insertSeqAt :: Int -> a -> Seq a -> NESeq a

    nonempty-containers Data.Sequence.NonEmpty

    Turn a Seq into a guarantted non-empty NESeq by adding an element at a given index.

    insertSeqAt 1 0 (Data.Sequence.fromList [1,2,3]) == fromList (1 :| [0,2,3])
    

  5. nonEmptySeq :: Seq a -> Maybe (NESeq a)

    nonempty-containers Data.Sequence.NonEmpty

    O(1). Smart constructor for an NESeq from a Seq. Returns Nothing if the Seq was originally actually empty, and Just n with an NESeq, if the Seq was not empty. nonEmptySeq and maybe empty toSeq form an isomorphism: they are perfect structure-preserving inverses of eachother. See IsNonEmpty for a pattern synonym that lets you "match on" the possiblity of a Seq being an NESeq.

    nonEmptySeq (Data.Sequence.fromList [1,2,3]) == Just (fromList (1) :| [2,3])
    

  6. toSeq :: NESeq a -> Seq a

    nonempty-containers Data.Sequence.NonEmpty

    O(1). Convert a non-empty sequence back into a normal possibly-empty sequence, for usage with functions that expect Seq. Can be thought of as "obscuring" the non-emptiness of the map in its type. See the IsNotEmpty pattern. nonEmptySeq and maybe empty toSeq form an isomorphism: they are perfect structure-preserving inverses of eachother.

  7. unsafeFromSeq :: Seq a -> NESeq a

    nonempty-containers Data.Sequence.NonEmpty

    O(1). Unsafe version of nonEmptySeq. Coerces a Seq into an NESeq, but is undefined (throws a runtime exception when evaluation is attempted) for an empty Seq.

  8. data NESeq a

    nonempty-containers Data.Sequence.NonEmpty.Internal

    A general-purpose non-empty (by construction) finite sequence type. Non-emptiness means that:

    • Functions that take an NESeq can safely operate on it with the assumption that it has at least value.
    • Functions that return an NESeq provide an assurance that the result has at least one value.
    Data.Sequence.NonEmpty re-exports the API of Data.Sequence, faithfully reproducing asymptotics, typeclass constraints, and semantics. Functions that ensure that input and output maps are both non-empty (like <|) return NESeq, but functions that might potentially return an empty map (like tail) return a Seq instead. You can directly construct an NESeq with the API from Data.Sequence.NonEmpty; it's more or less the same as constructing a normal Seq, except you don't have access to empty. There are also a few ways to construct an NESeq from a Seq:
    1. The nonEmptySeq smart constructor will convert a Seq a into a Maybe (NESeq a), returning Nothing if the original Seq was empty.
    2. You can use :<||, :||>, and insertSeqAt to insert a value into a Seq to create a guaranteed NESeq.
    3. You can use the IsNonEmpty and IsEmpty patterns to "pattern match" on a Seq to reveal it as either containing a NESeq or an empty sequence.
    4. withNonEmpty offers a continuation-based interface for deconstructing a Seq and treating it as if it were an NESeq.
    You can convert an NESeq into a Seq with toSeq or IsNonEmpty, essentially "obscuring" the non-empty property from the type.

  9. NESeq :: a -> !Seq a -> NESeq a

    nonempty-containers Data.Sequence.NonEmpty.Internal

    No documentation available.

  10. toSeq :: NESeq a -> Seq a

    nonempty-containers Data.Sequence.NonEmpty.Internal

    O(1). Convert a non-empty sequence back into a normal possibly-empty sequence, for usage with functions that expect Seq. Can be thought of as "obscuring" the non-emptiness of the map in its type. See the IsNotEmpty pattern. nonEmptySeq and maybe empty toSeq form an isomorphism: they are perfect structure-preserving inverses of eachother.

Page 498 of many | Previous | Next