Skip to content

Fix byPrefix examples in the README #1342

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

cwstra
Copy link

@cwstra cwstra commented Jun 1, 2025

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)

@f-f
Copy link
Member

f-f commented Jun 8, 2025

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.

@cwstra
Copy link
Author

cwstra commented Jun 9, 2025

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.

@f-f
Copy link
Member

f-f commented Jun 11, 2025

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

@cwstra
Copy link
Author

cwstra commented Jun 12, 2025

What exactly is wrong with the implementation? The message in question starts with A custom warning occurred while solving type class constraints:

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

Successfully merging this pull request may close these issues.

2 participants