This repository was archived by the owner on Jan 3, 2024. It is now read-only.
Open
Conversation
This allows the splices provided by `gitrev` to be included in typed TH quotes. Moreover, they greatly clarify the interfaces. This change should of course be accompanied by a major version bump.
Owner
|
Sorry for the delay on this; a mail filter gone awry hid messages about this repo from me for months. Are the typed TH splices documented anywhere? This is the first I've seen them, and only the syntax appears to be described in the user's guide. Will this break compatibility with older GHCs? |
Author
|
Sadly the documentation for typed quotes is a bit lacking. Typed quotes were introduced around 2013. I believe the first GHC release which it appeared in was 7.8.1. So I suppose the answer is yes, this will have implications on older GHCs. |
Author
|
"Adam C. Foltzer" <notifications@github.com> writes:
Sorry for the delay on this; a mail filter gone awry hid messages about this repo from me for months.
Are the typed TH splices documented anywhere?
Sadly there is relatively little discussion in the users guide.
Moreover, it all seems to be hidden away in
https://downloads.haskell.org/~ghc/master/users-guide//glasgow_exts.html#th-syntax
This is the first I've seen them, and only the syntax appears to be
described in the user's guide. Will this break compatibility with
older GHCs?
Typed splices were introduced in GHC 7.8. In general I quite like typed
splices as they eliminate much of the fragility associated with TH, but
I can understand if this is too much breakage to endure for a relatively
modest improvement in safety.
|
Closed
| case output of | ||
| "" -> conE falseName | ||
| _ -> conE trueName | ||
| "" -> boolT False |
| -- if not in a git repository. For detached heads, this will just be | ||
| -- "HEAD" | ||
| gitBranch :: ExpQ | ||
| gitBranch :: Q (TExp String) |
There was a problem hiding this comment.
TExpQ String is another alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows the splices provided by
gitrevto be included in typedTH quotes. Moreover, they greatly clarify the interfaces.
This change should of course be accompanied by a major version bump.