[Haskell-cafe] data constructor names

Suzuki Tomohiro tomotomotomo888 at gmail.com
Sat Jun 22 12:25:25 CEST 2013


I found syntax reference here.

http://www.haskell.org/onlinereport/syntax-iso.html


consym->(: {symbol | :})<reservedop>

symbol->ascSymbol | uniSymbol<special | _ | : | " | '>
constrs->constr1 | ... | constrn(n>=1)



Regards,
Tomo

On Saturday, June 22, 2013, Brian Lewis wrote:

> 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.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org <javascript:;>
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130622/0c30eebd/attachment.htm>


More information about the Haskell-Cafe mailing list