purescript-contrib / purescript-css

A clean, type-safe library for describing, manipulating and rendering CSS
Apache License 2.0
106 stars 40 forks source link

Add roles declarations to forbid unsafe coercions #120

Closed kl0tl closed 3 years ago

kl0tl commented 4 years ago

This allows terms of type Key a to be coerced to type Key b when Coercible a b holds but prevents terms of type Size a and Angle a to be coerced to type Size b and Angle b. The reasoning being that keys of some type can be associated to to terms of types with the same representation but not arbitrary types and values with absolute or relative sizes and angles in degrees or radians don’t describe the same runtime values.