module Data.KindID.V7
(
KindID
, KindIDV7
, getPrefix
, getUUID
, getTime
, genKindID
, genKindID'
, genKindIDs
, decorateKindID
, genID
, genID'
, genIDs
, decorate
, checkKindID
, checkKindIDWithEnv
, checkID
, checkIDWithEnv
, toString
, toText
, toByteString
, parseString
, parseText
, parseByteString
, parseStringM
, parseTextM
, parseByteStringM
, id2String
, id2Text
, id2ByteString
, string2ID
, text2ID
, byteString2ID
, string2IDM
, text2IDM
, byteString2IDM
, toTypeID
, fromTypeID
) where
import Control.Monad.IO.Class
import Data.ByteString.Lazy (ByteString)
import Data.KindID.Class
import Data.KindID.Internal (KindID'(..))
import qualified Data.KindID.Internal as KID
import Data.Text (Text)
import Data.TypeID.Class
import Data.TypeID.Error
import Data.TypeID.V7 (TypeID)
import Data.UUID.Types.Internal (UUID)
import Data.UUID.Versions
import Data.Word
type KindID = KID.KindID' 'V7
type KindIDV7 = KindID
genKindID :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m)
=> m (KindID prefix)
genKindID :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
m (KindID prefix)
genKindID = m (KindID' 'V7 prefix)
forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
m (KindID prefix)
KID.genKindID
{-# INLINE genKindID #-}
genKindID' :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m)
=> m (KindID prefix)
genKindID' :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
m (KindID prefix)
genKindID' = m (KindID' 'V7 prefix)
forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
m (KindID prefix)
KID.genKindID'
{-# INLINE genKindID' #-}
genKindIDs :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m)
=> Word16 -> m [KindID prefix]
genKindIDs :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
Word16 -> m [KindID prefix]
genKindIDs = Word16 -> m [KindID' 'V7 prefix]
forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
Word16 -> m [KindID prefix]
KID.genKindIDs
{-# INLINE genKindIDs #-}
decorateKindID :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> UUID -> KindID prefix
decorateKindID :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
UUID -> KindID prefix
decorateKindID = UUID -> KindID' 'V7 prefix
forall {k} (prefix :: k) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
UUID -> KindID' version prefix
KID.decorateKindID
{-# INLINE decorateKindID #-}
checkKindID :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> KindID prefix -> Maybe TypeIDError
checkKindID :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID prefix -> Maybe TypeIDError
checkKindID = KindID' 'V7 prefix -> Maybe TypeIDError
forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID prefix -> Maybe TypeIDError
KID.checkKindID
{-# INLINE checkKindID #-}
checkKindIDWithEnv :: ( ToPrefix prefix
, ValidPrefix (PrefixSymbol prefix)
, MonadIO m )
=> KindID' 'V7 prefix -> m (Maybe TypeIDError)
checkKindIDWithEnv :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
KindID' 'V7 prefix -> m (Maybe TypeIDError)
checkKindIDWithEnv = KindID' 'V7 prefix -> m (Maybe TypeIDError)
forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
KindID' 'V7 prefix -> m (Maybe TypeIDError)
KID.checkKindIDWithEnv
{-# INLINE checkKindIDWithEnv #-}
toString :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> KindID prefix -> String
toString :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID prefix -> String
toString = KindID' 'V7 prefix -> String
forall {k} (prefix :: k) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID' version prefix -> String
KID.toString
{-# INLINE toString #-}
toText :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> KindID prefix -> Text
toText :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID prefix -> Text
toText = KindID' 'V7 prefix -> Text
forall {k} (prefix :: k) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID' version prefix -> Text
KID.toText
{-# INLINE toText #-}
toByteString :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> KindID prefix -> ByteString
toByteString :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID prefix -> ByteString
toByteString = KindID' 'V7 prefix -> ByteString
forall {k} (prefix :: k) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID' version prefix -> ByteString
KID.toByteString
{-# INLINE toByteString #-}
parseString :: forall prefix
. (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> String -> Either TypeIDError (KindID prefix)
parseString :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
String -> Either TypeIDError (KindID prefix)
parseString = String -> Either TypeIDError (KindID' 'V7 prefix)
forall {k} (version :: UUIDVersion) (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
String -> Either TypeIDError (KindID' version prefix)
KID.parseString
{-# INLINE parseString #-}
parseText :: forall prefix
. (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> Text -> Either TypeIDError (KindID prefix)
parseText :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
Text -> Either TypeIDError (KindID prefix)
parseText = Text -> Either TypeIDError (KindID' 'V7 prefix)
forall {k} (version :: UUIDVersion) (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
Text -> Either TypeIDError (KindID' version prefix)
KID.parseText
{-# INLINE parseText #-}
parseByteString :: forall prefix
. (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> ByteString -> Either TypeIDError (KindID prefix)
parseByteString :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
ByteString -> Either TypeIDError (KindID prefix)
parseByteString = ByteString -> Either TypeIDError (KindID' 'V7 prefix)
forall {k} (version :: UUIDVersion) (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
ByteString -> Either TypeIDError (KindID' version prefix)
KID.parseByteString
parseStringM :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m)
=> String -> m (KindID prefix)
parseStringM :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
String -> m (KindID prefix)
parseStringM = String -> m (KindID' 'V7 prefix)
forall {k} (prefix :: k) (m :: * -> *) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
String -> m (KindID' version prefix)
KID.parseStringM
{-# INLINE parseStringM #-}
parseTextM :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m)
=> Text -> m (KindID prefix)
parseTextM :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
Text -> m (KindID prefix)
parseTextM = Text -> m (KindID' 'V7 prefix)
forall {k} (prefix :: k) (m :: * -> *) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
Text -> m (KindID' version prefix)
KID.parseTextM
{-# INLINE parseTextM #-}
parseByteStringM :: ( ToPrefix prefix
, ValidPrefix (PrefixSymbol prefix)
, MonadIO m )
=> ByteString -> m (KindID prefix)
parseByteStringM :: forall {k} (prefix :: k) (m :: * -> *).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
ByteString -> m (KindID prefix)
parseByteStringM = ByteString -> m (KindID' 'V7 prefix)
forall {k} (prefix :: k) (m :: * -> *) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix), MonadIO m) =>
ByteString -> m (KindID' version prefix)
KID.parseByteStringM
{-# INLINE parseByteStringM #-}
toTypeID :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> KindID prefix -> TypeID
toTypeID :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID prefix -> TypeID
toTypeID = KindID' 'V7 prefix -> TypeID
forall {k} (prefix :: k) (version :: UUIDVersion).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
KindID' version prefix -> TypeID' version
KID.toTypeID
{-# INLINE toTypeID #-}
fromTypeID :: (ToPrefix prefix, ValidPrefix (PrefixSymbol prefix))
=> TypeID -> Maybe (KindID prefix)
fromTypeID :: forall {k} (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
TypeID -> Maybe (KindID prefix)
fromTypeID = TypeID -> Maybe (KindID' 'V7 prefix)
forall {k} (version :: UUIDVersion) (prefix :: k).
(ToPrefix prefix, ValidPrefix (PrefixSymbol prefix)) =>
TypeID' version -> Maybe (KindID' version prefix)
KID.fromTypeID
{-# INLINE fromTypeID #-}