[Haskell-cafe] Re: Allowing hyphens in identifiers

Daniel Fischer daniel.is.fischer at web.de
Wed Dec 16 10:47:05 EST 2009

Am Mittwoch 16 Dezember 2009 16:08:43 schrieb Colin Paul Adams:
>     Daniel> Database.Haskell_DB.Sql.Postgre_SQL
> Actually, I would be semi-happy with Database.Haskell-DB.Sql.Postgre-SQL
> (obviously we need an option whether to use hypens or underscores. I
> prefer hyphens.)

That's no problem. Hyphens would also circumvent the Network.URL problem :)
Of course, you'd have to set up a not-too-complicated way to type \x2010 in your editor.

> I think I prefer shift-left :-)

Sure, mate, that's absolutely not going to be a bitch :-/
(.<<.) = shiftL
(.>>.) = shiftR

> I'd settle for the last.

Also map_m and fiter_m &c? And map_m_, for_m_ ?
Resp. shift-l, map-m, map-m_ ?

Would that be
4) flatten, when followed by lowercase letter, nothing or underscore?

>     Daniel> Generally, when shall we flatten the hump, 1) always --
>     Daniel> not 2) unless followed by an uppercase letter 3) when
>     Daniel> followed by a lowercase letter
> I'm nit sure. i think a more sophisticated rule might be needed.

Okay, let's start to find it. We won't find something which is perfect in all cases, but 
perhaps something that's good enough in almost all cases and never too ugly.

Should aBC... -> a_BC... / a-BC... in all cases? If not, in which cases what other 
Should aBc... -> a_bc... / a-bc... always? If not, what else?
aB -> a_b /a-b ?
aB' -> a_b' /a-b' ?
aB_ -> ?
aB'c... -> ?
aB'C... -> ?

>     Daniel> feedO'Houlihan?
>     Daniel> IMO, it should clearly go to feed_O'Houlihan
> Yes, I think so.

More information about the Haskell-Cafe mailing list