Re:C++ Pattern Matching Proposal [pdf]
by a1369209993 on Friday January 03, 2020 @10:12PM
(#21952597)
Translating that into Haskell, I get:
which is ugly, certainly, but compiles fine (ghc). The uglyness mainly comes from the data structures, and I don't know enough about the domain to suggest better ones (there might not be better ones).
[ Parent
| on HN ]
Re:C++ Pattern Matching Proposal [pdf]
by macintux on Saturday January 04, 2020 @02:04PM
(#21956674)
Well, it was code I threw together quickly for Advent of Code, so try not to be too hard on it.
Re:C++ Pattern Matching Proposal [pdf]
by a1369209993 on Sunday January 05, 2020 @12:59AM
(#21959939)
Eh, like I said, that might be the best you can do for a messy problem domain. I'm still not sure what you meant by multiple function heads though.