spago
spago copied to clipboard
Fix byPrefix examples in the README
Description of the change
Running spago 0.93.44 and purs 0.15.15, when trying out the byPrefix censor example in the configuration section of the README, it doesn't actually work.
import Data.Array as Array
import Data.Map (Map)
--warning still happens at this declaration
fn :: Array (Map String String) -> Map String String
fn = Array.fold
Turns out, to properly silence this, we'd need to include the "A custom warning occurred" blurb, as well as fixing some of the quotation marks.
Checklist:
- [ ] Added the change to the "Unreleased" section of the changelog
- [ ] Added some example of the new feature to the
README - [ ] Added a test for the contribution (if applicable)
I think that was supposed to work and broke at some point? It looks like we don't have tests for this (or well, I couldn't find them), and I'd rather add tests and fix the implementation than change the README.
Based on the git blame for the UserMessage in question, I don't think the quotations in the text would have allowed the old version to ever work.
Sounds good - but to be clear I consider this a bug, in the sense that the README is correct and the implementation is wrong. So I am not going to merge a documentation change to document the bug, and the only change that I'm willing to merge is fix+tests so that spago behaves like documented.
If you'd like to have a go at fixing it then we can keep this PR open, otherwise we should close it and open a bug report instead
What exactly is wrong with the implementation? The message in question starts with A custom warning occurred while solving type class constraints: