Skip to content
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

Use a fake GADT for sequence folds and traversals #1078

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

Conversation

treeowl
Copy link
Contributor

@treeowl treeowl commented Dec 15, 2024

No description provided.

@treeowl
Copy link
Contributor Author

treeowl commented Dec 15, 2024

As promised, here's the working draft. It's incomplete and completely unbenchmarked.

@@ -1078,7 +1135,33 @@ instance Sized a => Sized (FingerTree a) where
size (Single x) = size x
size (Deep v _ _ _) = v

-- We don't fold FingerTrees directly, but instead coerce them to
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lie at the moment. It might or might not be true later. WIP....

@treeowl
Copy link
Contributor Author

treeowl commented Dec 15, 2024

@augustss I'm sure this code is nonsense under MicroHs, but the error message it gives me looks equally nonsensical.

@augustss
Copy link
Contributor

augustss commented Dec 15, 2024 via email

@meooow25
Copy link
Contributor

It's not just MicroHs, I've never seen GHC react in this many ways to the same piece of code 😀

  • 8.2, 8.8 - panic! (the 'impossible' happened)
  • 9.0 - Error: [Cabal-7125]
  • 8.4, 8.6, 8.10 - Test failure
  • >= 9.2 - OK

Use in more functions, etc.
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.

3 participants