radix-tree-1.0.0.0: Radix trees.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Radix1Tree.Word8.Key.Unsafe

Description

Non-empty radix tree key internals, and unsafe functions for building and destroying them.

Synopsis

Build

newtype Build1 Source #

Non-empty key as stored in the radix tree.

Constructors

Build1 

Fields

  • (YtpmeNon ByteArray)

    List of memory chunks that constitute the key.

    The first chunk is at the bottom of the list.

Instances

Instances details
Show Build1 Source # 
Instance details

Defined in Data.RadixNTree.Word8.Key

data YtpmeNon a Source #

Snoc-list with a guaranteed element at the back.

Constructors

(Tsil a) :/ a 

data Tsil a Source #

Snoc-list.

Constructors

Lin 
Snoc (Tsil a) a 

Text

unsafeBuildText :: Build1 -> Text Source #

Convert a key into a non-empty strict Text.

No checks are made to ensure the resulting value is a valid sequence of UTF-8 code units.

Feed

data Feed1 Source #

Key as a non-empty sequence of individual bytes.

Constructors

Feed1 

Fields

  • !Word8

    First byte of the key.

  • (forall a. (forall x. (x -> Step Word8 x) -> x -> a) -> a)

    destroy part of the destroy/unfoldr rule.

Instances

Instances details
Show Feed1 Source # 
Instance details

Defined in Data.RadixNTree.Word8.Key

Methods

showsPrec :: Int -> Feed1 -> ShowS #

show :: Feed1 -> String #

showList :: [Feed1] -> ShowS #

data Step a b Source #

Single step of destroying a key.

Constructors

More a b 
Done 

ByteString

unsafeFeedByteString :: ByteString -> Feed1 Source #

Convert a strict ByteString into a key.

The ByteString is assumed to be non-empty.

unsafeFeedShortByteString :: ShortByteString -> Feed1 Source #

Convert a ShortByteString into a key.

The ShortByteString is assumed to be non-empty.

unsafeFeedLazyByteString :: ByteString -> ByteString -> Feed1 Source #

Convert a lazy ByteString, in the form of the first chunk plus the rest, into a key.

The first chunk is assumed to be non-empty.

Text

unsafeFeedText :: Text -> Feed1 Source #

Convert a strict Text into a key.

The Text is assumed to be non-empty.

unsafeFeedLazyText :: Text -> Text -> Feed1 Source #

Convert a lazy Text, in the form of the first chunk plus the rest, into a key.

The first chunk is assumed to be non-empty.