packages feed

mmzk-typeid 0.3.0.0 → 0.3.0.1

raw patch · 8 files changed

+31/−20 lines, 8 filesdep ~uuid-typesPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: uuid-types

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,6 +1,13 @@ # Revision history for mmzk-typeid  +## 0.3.0.1 -- 2023-07-18++* Add a version upper-bound for 'uuid-types'.++* Fix documentation typos. ++ ## 0.3.0.0 -- 2023-07-17  * Use 'uuid-types' package's `UUID` instead of a custom type.@@ -31,6 +38,8 @@   * `checkIDWithEnv` also checks that the `UUID` is generated in the past.  * Deprecate `nilTypeID` and `nilKindID` since they are not useful.++* Remove dependency on 'transformers'.  * Fix typos in the documentation. 
mmzk-typeid.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               mmzk-typeid-version:            0.3.0.0+version:            0.3.0.1  synopsis:           A TypeID implementation for Haskell description:@@ -10,7 +10,7 @@   .   This library supports generating and parsing speç-conforming TypeIDs, with the following additional features:   .-    - Batch generating TypeIDs with the same 'UUID'v7 timestamp+    - Batch generating 'TypeID's with the same UUIDv7 timestamp   .     - Encode prefixes at type-level for better type-safety   .@@ -81,7 +81,7 @@         hashable ^>=1.4,         text ^>=2.0,         time >=1.11 && <1.13,-        uuid-types >=1.0,+        uuid-types ^>=1.0,     hs-source-dirs:   src     default-language: Haskell2010 
src/Data/KindID.hs view
@@ -31,7 +31,7 @@ -- These functions are usually used with a type application, e.g. -- -- > do--- >   tid <- genKindID @"user"+-- >   kindID <- genKindID @"user" -- >   ... -- module Data.KindID
src/Data/KindID/Class.hs view
@@ -8,7 +8,7 @@ -- Portability : GHC -- -- This module contains the type-level mechanisms that are used to define--- custom 'Data.KindID'-ish identifier types.+-- custom 'Data.KindID.KindID'-ish identifier types. -- module Data.KindID.Class   (@@ -56,8 +56,8 @@   ILSUH ('Just '(c, s)) = IsLowerChar c && IsLowerSymbol s  -- | A class that translates any kind to a 'Symbol'. It is used to translate--- custom data kinds to a 'Symbol' so that they can be used as 'Data.KindID'--- prefixes.+-- custom data kinds to a 'Symbol' so that they can be used as+-- 'Data.KindID.KindID' prefixes. -- -- For example, suppose we have the following data structure that represents the -- prefixes we are going to use:@@ -75,7 +75,7 @@ -- > instance ToPrefix 'Comment where -- >   type PrefixSymbol 'Comment = "comment" ----- Now we can use Prefix as a prefix for 'Data.KindID's, e.g.+-- Now we can use Prefix as a prefix for 'Data.KindID.KindID's, e.g. -- -- > do -- >   userID <- genKindID @'User -- Same as genKindID @"user"
src/Data/TypeID/Class.hs view
@@ -6,7 +6,7 @@ -- Maintainer  : mmzk1526@outlook.com -- Portability : GHC ----- A module with the APIs for any 'Data.TypeID'-ish identifier type.+-- A module with the APIs for any 'Data.TypeID.TypeID'-ish identifier type. -- -- These type classes are useful to define custom TypeID-ish identifier types. -- For example, if one wishes to remove the constraints on prefix, or use a
src/Data/TypeID/Error.hs view
@@ -16,11 +16,18 @@ import           Data.Text (Text)  -- | Errors from parsing TypeIDs.-data TypeIDError = TypeIDErrorPrefixTooLong Int-                 | TypeIDExtraSeparator-                 | TypeIDErrorPrefixInvalidChar Char-                 | TypeIDErrorPrefixMismatch Text Text-                 | TypeIDErrorUUIDError+data TypeIDError+  = -- | The prefix longer than 63 characters.+    TypeIDErrorPrefixTooLong Int+    -- | The ID contains an extra underscore separator.+  | TypeIDExtraSeparator+    -- | The prefix contains an invalid character, namely not lowercase Latin.+  | TypeIDErrorPrefixInvalidChar Char+    -- | From a `Data.KindID.KindID` conversion. The prefix doesn't match with+    -- the expected.+  | TypeIDErrorPrefixMismatch Text Text+    -- | The 'Data.UUID.V7.UUID' suffix has errors.+  | TypeIDErrorUUIDError   deriving (Eq, Ord)  instance Show TypeIDError where
src/Data/TypeID/Internal.hs view
@@ -36,11 +36,6 @@  -- | The constructor is not exposed to the public API to prevent generating -- invalid @TypeID@s.------ Note that the 'Show' instance is for debugging purposes only. To pretty-print--- a 'TypeID', use 'toString', 'toText' or 'toByteString'. However, this--- behaviour will be changed in the next major version as it is not useful. By--- then, the 'Show' instance will be the same as 'toString'. data TypeID = TypeID { _getPrefix :: Text                      , _getUUID   :: UUID }   deriving (Eq, Ord)
src/Data/UUID/V7.hs view
@@ -24,7 +24,7 @@   , genUUID   , genUUID'   , genUUIDs-  -- Validation+  -- * Validation   , validate   , validateWithTime   -- * Miscellaneous helpers