Skip to content

Marking code with backticks in error messages - #2060

Closed
soupi wants to merge 2 commits into
purescript:masterfrom
soupi:master
Closed

Marking code with backticks in error messages#2060
soupi wants to merge 2 commits into
purescript:masterfrom
soupi:master

Conversation

@soupi

@soupi soupi commented Apr 28, 2016

Copy link
Copy Markdown
Contributor

Implementing the request at #2056, is this what we might want?

@soupi soupi changed the title Marking code with backticks #2056 Marking code with backticks in error messages Apr 28, 2016
@paf31

paf31 commented Apr 28, 2016

Copy link
Copy Markdown
Contributor

👍

@hdgarrood

Copy link
Copy Markdown
Contributor

👍 from me too.

@hdgarrood

Copy link
Copy Markdown
Contributor

Actually I wonder if we could make it a little more type-safe by having markIdent :: Ident -> String and markProperName :: ProperName a -> String, so that you can't accidentally apply either of the mark functions to something that isn't code?

@hdgarrood

Copy link
Copy Markdown
Contributor

That way, you only need to call one function, too; markIdent ident as opposed to markCode (runIdent ident).

@hdgarrood

Copy link
Copy Markdown
Contributor

Sort of related, should the following two constructors have Ident arguments instead of String?

| ShadowedTypeVar String
| UnusedTypeVar String

@texastoland

Copy link
Copy Markdown

What @hdgarrood said (I just didn't have as clear an idea how to fix it) 👍

@hdgarrood

Copy link
Copy Markdown
Contributor

Also, I don't know what the right answer is here, but it might be worth considering putting the backticks directly into typeAsBox instead of applying this new withBoxBackTicks function everywhere, so that we don't have to worry about accidentally forgetting them whenever we modify functions in this module.

@garyb

garyb commented Apr 29, 2016

Copy link
Copy Markdown
Member

Re: the above suggestion - I'm not sure every name shown in errors comes through with an Ident or ProperName type. I think Sugar.Names does some stuff with strings to avoid having to specify many different error messages that differ by one word.

@hdgarrood

Copy link
Copy Markdown
Contributor

Ok, then this LGTM.

@paf31

paf31 commented May 1, 2016

Copy link
Copy Markdown
Contributor

Could you please reopen this as a PR on the 0.9 branch?

@paf31

paf31 commented May 1, 2016

Copy link
Copy Markdown
Contributor

Thanks!

@paf31 paf31 closed this May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants