mmzk-typeid-0.6.0.1: A TypeID implementation for Haskell
LicenseMIT
Maintainermmzk1526@outlook.com
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.TypeID.Unsafe

Description

Unsafe TypeID functions.

It is a re-export of Data.TypeID.V7.Unsafe.

Synopsis

Unsafe TypeID generation

unsafeGenTypeID :: MonadIO m => Text -> m TypeID Source #

Generate a new TypeID from a prefix, but without checking if the prefix is valid.

unsafeGenTypeID' :: MonadIO m => Text -> m TypeID Source #

Generate a new TypeID from a prefix based on stateless UUIDv7, but without checking if the prefix is valid.

unsafeGenTypeIDs :: MonadIO m => Text -> Word16 -> m [TypeID] Source #

Generate n TypeIDs from a prefix, but without checking if the prefix is valid.

It tries its best to generate TypeIDs at the same timestamp, but it may not be possible if we are asking too many UUIDs at the same time.

It is guaranteed that the first 32768 TypeIDs are generated at the same timestamp.

Unsafe decoding (TypeID-specific)

unsafeParseString :: String -> TypeID Source #

Parse a TypeID from its String representation, but crashes when parsing fails.

unsafeParseText :: Text -> TypeID Source #

Parse a TypeID from its string representation as a strict Text, but crashes when parsing fails.

unsafeParseByteString :: ByteString -> TypeID Source #

Parse a TypeID from its string representation as a lazy ByteString, but crashes when parsing fails.

Unsafe decoding (class methods)

unsafeString2ID :: IDConv a => String -> a Source #

Parse the identifier from its String representation, but crashes when the parsing fails.

unsafeText2ID :: IDConv a => Text -> a Source #

Parse the identifier from its string representation as a strict Text, but crashes when the parsing fails.

unsafeByteString2ID :: IDConv a => ByteString -> a Source #

Parse the identifier from its string representation as a lazy ByteString, but crashes when the parsing fails.