Skip to content

Commit

Permalink
Merge pull request #1 from kl0tl/roles-declarations
Browse files Browse the repository at this point in the history
Add roles declarations to forbid unsafe coercions
  • Loading branch information
paluh authored Oct 20, 2020
2 parents baac4cf + 8fe825b commit fa2ac47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Data/Enum.purs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ toEnumWithDefaults low high x = case toEnum x of
-- | A type for the size of finite enumerations.
newtype Cardinality a = Cardinality Int

type role Cardinality representational

derive instance newtypeCardinality :: Newtype (Cardinality a) _
derive newtype instance eqCardinality :: Eq (Cardinality a)
derive newtype instance ordCardinality :: Ord (Cardinality a)
Expand Down

0 comments on commit fa2ac47

Please sign in to comment.