|
I'm still having several problems with anamerge and mergehead. The only way I can make mergehead do anything even close to what its supposed to is by concatenating words with the same canonical form, and that includes changing the types from what was given, i.e.
mergehead (c1, w1) ((c2, l2)::rr) = mergehead (c1, (w1^l2)) rr If I leave the c2::l2 the way it is, then concatenation fails since l2 is the list word::nil instead of just a word. Anything other than concatenation or appending has left me with errors since mergehead only takes arguments (c1, w1) and w1 is not apparently allowed to be a list that you can keep adding to (for whatever reason unknown to me). My idea for mergehead was simply to take a list of pairs with the same c1, c2, etc (canonical forms) and append a list of words (w1, l2, etc.) to the canonical form. Then anamerge simply consists of applying this to the first pair p1 and using the rest of the pair list r as the (c2::l2)::rr in the mergehead. I've tried just about every variation in syntax, so I'm thinking I've made a more fundamental error, that I just don't see. Anyone see anything I've missed? Thanks. Mamun
|
wrong order by Jesse Dailey, 2001, Nov 28
Yes: list recursion is usually right-associative by Mike O'Donnell, 2001, Nov 28
the other place? by Mamun Tanveer, 2001, Nov 28
[] is the place in the base case by Mike O'Donnell, 2001, Nov 28
Do anamerge first: it's recursion is right-associative by Mike O'Donnell, 2001, Nov 28
How to get to the end of the list by Mamun Tanveer, 2001, Nov 28
Write the last line of the anamerge definition first by Mike O'Donnell, 2001, Nov 29
to: