yesodweb / yesodweb/persistent
New parser has differing behavior on quoted attributes
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Surfaced in https://github.com/commercialhaskell/curator/issues/52#issuecomment-3002214345
This is a weird one - the stack repository has a definition that looks like this:
share [ mkPersist sqlSettings
, mkMigrate "migrateAll"
]
[persistLowerCase|
PrecompiledCacheParent sql="precompiled_cache"
platformGhcDir FilePath "default=(hex(randomblob(16)))"
compiler Text
cabalVersion Text
packageKey Text
optionsHash ByteString
haddock Bool default=0
library FilePath Maybe
UniquePrecompiledCacheParent platformGhcDir compiler cabalVersion packageKey optionsHash haddock sql="unique_precompiled_cache"
deriving Show
The platformGhcDir FilePath "default=(hex(randomblob(16)))" line is strange. I'm not sure how this would have parsed in the old parser or been used, but the new one properly parses but fails to generate the right code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the example definition in Stack/Storage/User.hs around line 100 and trace how the persistent parser handles the quoted attribute. Compare the generated code for this declaration with the expected behavior; the issue does not name a parser source file or test, so those entry points must be located first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100