compilation of pattern-matching?
claus.reinke at talk21.com
Fri Mar 27 06:46:46 EDT 2009
Ticket is http://hackage.haskell.org/trac/ghc/ticket/3126 .
>Sorting by constructor tag is perfectly safe when done right.
>You can read about how to do it in my 1985 FPCA paper or in Simon's book.
I did, long ago. I learned functional programming by implementing a
small functional language, using the Kiel Reduction Language (remember
that one? It not only took programming with functions to a level not yet
available with modern implementations, it also had a pattern-match
sublanguage and engine that was as complex as the rest of it taken
together, so we were encouraged to read up on pattern matching in
general), C, and your papers. Which made this discussion interesting,
as I'm easily intimidated by strongly expressed opinions from people
who wrote about this stuff when I was still learning about it;-)
>When pattern matching against against things that that are not
>constructors (like literals etc) it's much trickier to reorder them
>since you have to prove harder pattern commutation properties.
Good that we now seem to agree on things.
Simon: there aren't really any patterns to combine in the test case,
so I assume the reordering happens when "combining" a single
pattern? Fill the fix you envisioned also cover the IsString variant?
More information about the Glasgow-haskell-users