diff --git a/CHANGELOG.md b/CHANGELOG.md index 534b3f2..ae0f8f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## Slug 0.1.4 + +* Derive `Ord` and `Data` instances for `Slug`. + ## Slug 0.1.3 * Export plain function `unSlug` instead of record selector `unSlug`. diff --git a/Web/Slug.hs b/Web/Slug.hs index 8ae8318..938fa0d 100644 --- a/Web/Slug.hs +++ b/Web/Slug.hs @@ -26,6 +26,7 @@ import Control.Monad ((>=>), liftM) import Control.Monad.Catch (MonadThrow (..)) import Data.Aeson.Types (ToJSON (..), FromJSON (..)) import Data.Char (isAlphaNum) +import Data.Data (Data) import Data.Text (Text) import Data.Typeable (Typeable) import Database.Persist.Class (PersistField (..)) @@ -63,7 +64,7 @@ instance Exception SlugException -- Slugs are good for semantic URLs and also can be used as identifier of a -- sort in some cases. -newtype Slug = Slug Text deriving (Eq, Typeable) +newtype Slug = Slug Text deriving (Eq, Ord, Data, Typeable) -- | Create 'Slug' from 'Text', all necessary transformations are -- applied. Argument of this function can be title of an article or