Skip to content

Commit fa2ac47

Browse files
authored
Merge pull request #1 from kl0tl/roles-declarations
Add roles declarations to forbid unsafe coercions
2 parents baac4cf + 8fe825b commit fa2ac47

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Data/Enum.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ toEnumWithDefaults low high x = case toEnum x of
162162
-- | A type for the size of finite enumerations.
163163
newtype Cardinality a = Cardinality Int
164164

165+
type role Cardinality representational
166+
165167
derive instance newtypeCardinality :: Newtype (Cardinality a) _
166168
derive newtype instance eqCardinality :: Eq (Cardinality a)
167169
derive newtype instance ordCardinality :: Ord (Cardinality a)

0 commit comments

Comments
 (0)