Skip to content
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

Fsharp apostrophes in names #1480

Closed
NobbZ opened this issue Jul 14, 2018 · 3 comments · Fixed by #1570
Closed

Fsharp apostrophes in names #1480

NobbZ opened this issue Jul 14, 2018 · 3 comments · Fixed by #1570

Comments

@NobbZ
Copy link

NobbZ commented Jul 14, 2018

The following code example:

let foo' = failWith "foo"

let bar' = failWith "bar"

The ' are treated as string delimeters instead of as part of the name.

@NobbZ
Copy link
Author

NobbZ commented Jul 14, 2018

On exercism/exercism#3831 there is a screenshot of a bigger chunk of code which suffers from the same problem.

@mAAdhaTTah
Copy link
Member

F# allows apostrophes in the variable name?! Weird...

@NobbZ
Copy link
Author

NobbZ commented Jul 20, 2018

Thats pretty common in functional languages.

Also I haven't even checked so far, what would happen when one uses typevariables in a function.

They are preceeded with an apostrophe, and highlighted as a string as well, check this example which could be a stub for a function that maps a function over a list:

let map (f: 'a -> 'b) (xs: 'a list): 'b list = failWith "not implemented"

In this example we get 2 strings highlichted: 'a -> ' and 'a list): '.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants