Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

Commit

Permalink
Derive ‘Ord’ and ‘Data’ instances for ‘Slug’
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkkrp committed Jun 25, 2016
1 parent c3f0634 commit a586242
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
3 changes: 2 additions & 1 deletion Web/Slug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (..))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a586242

Please sign in to comment.