License | MIT |
---|---|
Maintainer | mmzk1526@outlook.com |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
UUIDv7 implementation.
UUIDv7 is not currently present in the uuid package, therefore I have to make a quick patch of my own.
Data type
Type representing Universally Unique Identifiers (UUID) as specified in RFC 4122.
Instances
Data UUID | |
Defined in Data.UUID.Types.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UUID -> c UUID # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UUID # dataTypeOf :: UUID -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UUID) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UUID) # gmapT :: (forall b. Data b => b -> b) -> UUID -> UUID # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UUID -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UUID -> r # gmapQ :: (forall d. Data d => d -> u) -> UUID -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UUID -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UUID -> m UUID # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UUID -> m UUID # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UUID -> m UUID # | |
Storable UUID | This |
Defined in Data.UUID.Types.Internal | |
Read UUID | |
Show UUID | Pretty prints a
|
Binary UUID | This |
NFData UUID | |
Defined in Data.UUID.Types.Internal | |
Eq UUID | |
Ord UUID | |
Hashable UUID | |
Defined in Data.UUID.Types.Internal | |
Random UUID | This |
Uniform UUID | |
Defined in Data.UUID.Types.Internal uniformM :: StatefulGen g m => g -> m UUID # | |
FromJSON UUID | |
Defined in Data.Aeson.Types.FromJSON | |
FromJSONKey UUID | |
Defined in Data.Aeson.Types.FromJSON | |
ToJSON UUID | |
ToJSONKey UUID | |
Defined in Data.Aeson.Types.ToJSON | |
Lift UUID | |
UUID
v7 generation
Validation
validateWithTime :: MonadIO m => UUID -> m Bool Source #
Validate the version and variant of the UUID
v7 as well as its timestamp
is no greater than the current time.
Miscellaneous helpers
getEpochMilli :: MonadIO m => m Word64 Source #
Get the current time in milliseconds since the Unix epoch.