[Haskell-cafe] data constructor names

Brian Lewis brian at lorf.org
Sat Jun 22 11:26:14 CEST 2013


Say you write
data Callback = Error ... | ...
because one of the kinds of callbacks you need to model is an error
callback.

Then, later, you write
data Error = ...
to model some error that can happen.

They're both good names, but there's a conflict. So I started thinking I
should prefix my constructor names like
data Callback = CallbackError ... | ...
It will work, but it's not the nicest looking.

I discovered I can write
data Callback = Callback'Error ... | ...
Where can I find the syntax reference to see what's allowed? Will people
kill me if I start doing this?

I could import qualified, but in my case, there would be too many
modules.

Thanks for any advice.



More information about the Haskell-Cafe mailing list