Skip to content

Instantly share code, notes, and snippets.

@parsonsmatt parsonsmatt/ugh.hs
Created Apr 13, 2018

Embed
What would you like to do?
maybe your thinking, "wow, i really want a type class with only two instances" well here you go!! don't export the class and you're *golden*. i mean, write a better error message, but come on
-- gross hack so i can lighten the syntax load
class NameOrEntityRef x where
disambiguate :: x -> Either Name EntityRef
instance NameOrEntityRef Name where
disambiguate = Left
instance NameOrEntityRef EntityRef where
disambiguate = Right
instance {-# OVERLAPPABLE #-} (TypeError (Text "No.")) => NameOrEntityRef a where
disambiguate = undefined
@taktoa

This comment has been minimized.

Copy link

taktoa commented Apr 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.