module Data.TypeID.V7
(
TypeID
, TypeIDV7
, getPrefix
, getUUID
, getTime
, genTypeID
, genTypeID'
, genTypeIDs
, decorateTypeID
, genID
, genID'
, genIDs
, decorate
, checkPrefix
, checkTypeID
, checkTypeIDWithEnv
, checkID
, checkIDWithEnv
, toString
, toText
, toByteString
, parseString
, parseText
, parseByteString
, parseStringM
, parseTextM
, parseByteStringM
, id2String
, id2Text
, id2ByteString
, string2ID
, text2ID
, byteString2ID
, string2IDM
, text2IDM
, byteString2IDM
) where
import Control.Monad.IO.Class
import Data.ByteString.Lazy (ByteString)
import Data.Text (Text)
import Data.TypeID.Class
import Data.TypeID.Error
import qualified Data.TypeID.Internal as TID
import Data.UUID.Types (UUID)
import Data.UUID.Versions
import Data.Word
type TypeID = TID.TypeID' 'V7
type TypeIDV7 = TypeID
genTypeID :: MonadIO m => Text -> m TypeID
genTypeID :: forall (m :: * -> *). MonadIO m => Text -> m TypeID
genTypeID = Text -> m TypeID
forall (m :: * -> *). MonadIO m => Text -> m TypeID
TID.genTypeID
{-# INLINE genTypeID #-}
genTypeID' :: MonadIO m => Text -> m TypeID
genTypeID' :: forall (m :: * -> *). MonadIO m => Text -> m TypeID
genTypeID' = Text -> m TypeID
forall (m :: * -> *). MonadIO m => Text -> m TypeID
TID.genTypeID'
{-# INLINE genTypeID' #-}
genTypeIDs :: MonadIO m => Text -> Word16 -> m [TypeID]
genTypeIDs :: forall (m :: * -> *). MonadIO m => Text -> Word16 -> m [TypeID]
genTypeIDs = Text -> Word16 -> m [TypeID]
forall (m :: * -> *). MonadIO m => Text -> Word16 -> m [TypeID]
TID.genTypeIDs
{-# INLINE genTypeIDs #-}
decorateTypeID :: Text -> UUID -> Either TypeIDError TypeID
decorateTypeID :: Text -> UUID -> Either TypeIDError TypeID
decorateTypeID = Text -> UUID -> Either TypeIDError TypeID
forall (version :: UUIDVersion).
Text -> UUID -> Either TypeIDError (TypeID' version)
TID.decorateTypeID
{-# INLINE decorateTypeID #-}
checkPrefix :: Text -> Maybe TypeIDError
checkPrefix :: Text -> Maybe TypeIDError
checkPrefix = Text -> Maybe TypeIDError
TID.checkPrefix
{-# INLINE checkPrefix #-}
checkTypeID :: TypeID -> Maybe TypeIDError
checkTypeID :: TypeID -> Maybe TypeIDError
checkTypeID = TypeID -> Maybe TypeIDError
TID.checkTypeID
{-# INLINE checkTypeID #-}
checkTypeIDWithEnv :: MonadIO m => TypeID -> m (Maybe TypeIDError)
checkTypeIDWithEnv :: forall (m :: * -> *). MonadIO m => TypeID -> m (Maybe TypeIDError)
checkTypeIDWithEnv = TypeID -> m (Maybe TypeIDError)
forall (m :: * -> *). MonadIO m => TypeID -> m (Maybe TypeIDError)
TID.checkTypeIDWithEnv
{-# INLINE checkTypeIDWithEnv #-}
toString :: TypeID -> String
toString :: TypeID -> String
toString = TypeID -> String
forall (version :: UUIDVersion). TypeID' version -> String
TID.toString
{-# INLINE toString #-}
toText :: TypeID -> Text
toText :: TypeID -> Text
toText = TypeID -> Text
forall (version :: UUIDVersion). TypeID' version -> Text
TID.toText
{-# INLINE toText #-}
toByteString :: TypeID -> ByteString
toByteString :: TypeID -> ByteString
toByteString = TypeID -> ByteString
forall (version :: UUIDVersion). TypeID' version -> ByteString
TID.toByteString
{-# INLINE toByteString #-}
parseString :: String -> Either TypeIDError TypeID
parseString :: String -> Either TypeIDError TypeID
parseString = String -> Either TypeIDError TypeID
forall (version :: UUIDVersion).
String -> Either TypeIDError (TypeID' version)
TID.parseString
{-# INLINE parseString #-}
parseText :: Text -> Either TypeIDError TypeID
parseText :: Text -> Either TypeIDError TypeID
parseText = Text -> Either TypeIDError TypeID
forall (version :: UUIDVersion).
Text -> Either TypeIDError (TypeID' version)
TID.parseText
{-# INLINE parseText #-}
parseByteString :: ByteString -> Either TypeIDError TypeID
parseByteString :: ByteString -> Either TypeIDError TypeID
parseByteString = ByteString -> Either TypeIDError TypeID
forall (version :: UUIDVersion).
ByteString -> Either TypeIDError (TypeID' version)
TID.parseByteString
{-# INLINE parseByteString #-}
parseStringM :: MonadIO m => String -> m TypeID
parseStringM :: forall (m :: * -> *). MonadIO m => String -> m TypeID
parseStringM = String -> m TypeID
forall (m :: * -> *) (version :: UUIDVersion).
MonadIO m =>
String -> m (TypeID' version)
TID.parseStringM
{-# INLINE parseStringM #-}
parseTextM :: MonadIO m => Text -> m TypeID
parseTextM :: forall (m :: * -> *). MonadIO m => Text -> m TypeID
parseTextM = Text -> m TypeID
forall (m :: * -> *) (version :: UUIDVersion).
MonadIO m =>
Text -> m (TypeID' version)
TID.parseTextM
{-# INLINE parseTextM #-}
parseByteStringM :: MonadIO m => ByteString -> m TypeID
parseByteStringM :: forall (m :: * -> *). MonadIO m => ByteString -> m TypeID
parseByteStringM = ByteString -> m TypeID
forall (m :: * -> *) (version :: UUIDVersion).
MonadIO m =>
ByteString -> m (TypeID' version)
TID.parseByteStringM
{-# INLINE parseByteStringM #-}