Skip to content

Adds custom type error for non-derivable instances of HasElmSorter#15

Open
celsobonutti wants to merge 1 commit into
masterfrom
add-custom-type-error
Open

Adds custom type error for non-derivable instances of HasElmSorter#15
celsobonutti wants to merge 1 commit into
masterfrom
add-custom-type-error

Conversation

@celsobonutti
Copy link
Copy Markdown
Member

No description provided.

Comment thread src/Elm/Sorter.hs
Comment on lines +65 to +75
instance
{-# OVERLAPPABLE #-}
( TypeError
( Text "ElmSorter only has default instances for newtypes."
:$$: Text "Perhaps you should use `mkRecordSorter` or `mkCustom` instead?"
)
) =>
GenericElmSorter a
where
genericElmSorter = undefined

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems reasonable as long as this is the lowest-possible priority instance (which it should be, seeing as it's as general as possible)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants