elm-community / typed-svg

Typed SVG library written for Elm
BSD 3-Clause "New" or "Revised" License
59 stars 16 forks source link

Use 'Maybe a' instead of custom types where appropriate. #15

Closed rupertlssmith closed 6 years ago

rupertlssmith commented 7 years ago

There are some custom types in TypedSvg.Types which have the same form as 'Maybe a', for example:

type Align
    = Align Scale Scale
    | AlignNone

It would be better to use Maybe for optional values like this.

rupertlssmith commented 6 years ago

The Align type is perhaps not so suitable for using a Maybe as it would be of type 'Maybe (Scale, Scale)'.

Other types that could be represented by Maybe do not have their empty case described so well by the word 'Nothing'. For example: DurationIndefinite, OpacityInherit and so on.