mrkkrp / megaparsec

Industrial-strength monadic parser combinator library
Other
920 stars 87 forks source link

Expand elem/notElem to allow fusion #559

Closed 1Jajen1 closed 6 months ago

1Jajen1 commented 6 months ago

GHC doesn't seem to inline or fuse the infix version of elem/notElem. Fully expanding their uses does allow it.

csv benchmarks get faster and satisfy (\x -> x == '\'' || x == '\"') = oneOf ['\'', '\"'] now holds with regards to performance. Note that oneOf "'\"" will still be slower, which is why I left the note unchanged.

mrkkrp commented 6 months ago

Thanks! Strangely, I see this

This branch cannot be rebased due to too many changes

and the merge button is grey. As far as I can see this is based directly on current master, so it is not clear how there could be "too many changes".