-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name mangling: preserve leading and trailing underscores #312
Comments
IMHO, the default name mangling should do as little as necessary to make valid Haskell names. Doing underscores to camelCase like translations feels a bit tricky. Perfectly we will be able to describe the mangling rules in few sentences. Users should be able to predict what the Haskell names will be. IMHO it doesn't matter what are the "idiomatic" names in Haskell. In particular, recently I started to dislike the |
This is a question for @edsko, but I think it is just a matter of taste/preference. A few technical notes:
|
This is a change to `camelCaseCName`, used for type constructors by our default name manglers.
We shall assume that leading and trailing underscores have special meaning, while underscores in between letters/numbers are just used for separation. Multiple leading/trailing underscores should be preserved.
Haskell identifiers that start with a lowercase letter may start with an underscore.
Haskell identifiers that start with an uppercase letter may not start with an underscore. For example, translating C type
_foo
to a Haskell type constructor that preserves the leading underscore requires a prefix before the underscore.@phadej provided an example in #306:
Note that
joinWithCamelCase
is still used, so leading and trailing underscores should be handled separately.The text was updated successfully, but these errors were encountered: