Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ New features:
Bugfixes:

Other improvements:
- Derive `newtype` instances where possible (#166 by @mhmdanas)

## [v6.0.1](https://github.com/purescript/purescript-strings/releases/tag/v6.0.1) - 2022-08-16

Expand Down
4 changes: 2 additions & 2 deletions src/Data/String/CodePoints.purs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ import Data.Unfoldable (unfoldr)
-- | Unicode code points.
newtype CodePoint = CodePoint Int

derive instance eqCodePoint :: Eq CodePoint
derive instance ordCodePoint :: Ord CodePoint
derive newtype instance eqCodePoint :: Eq CodePoint
derive newtype instance ordCodePoint :: Ord CodePoint

instance showCodePoint :: Show CodePoint where
show (CodePoint i) = "(CodePoint 0x" <> toUpper (toStringAs hexadecimal i) <> ")"
Expand Down
8 changes: 4 additions & 4 deletions src/Data/String/Pattern.purs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import Data.Newtype (class Newtype)
-- |
newtype Pattern = Pattern String

derive instance eqPattern :: Eq Pattern
derive instance ordPattern :: Ord Pattern
derive newtype instance eqPattern :: Eq Pattern
derive newtype instance ordPattern :: Ord Pattern
derive instance newtypePattern :: Newtype Pattern _

instance showPattern :: Show Pattern where
Expand All @@ -25,8 +25,8 @@ instance showPattern :: Show Pattern where
-- | A newtype used in cases to specify a replacement for a pattern.
newtype Replacement = Replacement String

derive instance eqReplacement :: Eq Replacement
derive instance ordReplacement :: Ord Replacement
derive newtype instance eqReplacement :: Eq Replacement
derive newtype instance ordReplacement :: Ord Replacement
derive instance newtypeReplacement :: Newtype Replacement _

instance showReplacement :: Show Replacement where
Expand Down