I recommend you keep the types as they are
-
Forum:
Com Sci 221, U Chicago, Autumn 2001, Discuss Classwork
Re:
Assignment #8 due Monday, 26 November (Mike O'Donnell)
Re:
YA question (Ben Wolfson)
Date: 2001, Nov 21
From: Mike O'Donnell <odonnell@cs.uchicago.edu>
|
mergehead is intended to take a list of lists of anagram-equivalent words (with the canonical form at the head of each list). Assuming that the list of lists is already sorted by the lexicographical ordering of the canonical forms, mergehead merges adjacent lists of words that start with the same canonical form. As the recursion goes on, each sublist will contain 2 or more words, including the canonical form. So I don't even see how to do it with (string*string) list as the type of the second argument. Perhaps you meant (string*(string list)) list. That will work, but I don't see how it will simplify anything. The whole definition of anamerge takes only 9 lines in one naturally formatted version. That includes the material that I already provided, so it just means that a couple of the ellipses can naturally expand to a couple of lines each, with the rest remaining at one line each.
I'm willing to look at any interesting variation. But there will usually be some global changes to accommodate any individual change of this sort, and I think that the chance for confusion will outweigh any benefit. I know that there is a small simple way to fill in my schema, so I strongly recommend that you stick to it.
Mike O'D.
|
Messages
- 1.
Changing mergehead by Jake Lilly, 2001, Nov 28
- (_
it's also possible the current way by Ben Wolfson, 2001, Nov 28
- (_
Untitled by M.J., 2001, Nov 28
- (_
(x,y) is a pair, not a list by Mike O'Donnell, 2001, Nov 28
- (_
Thanks by msjohnso@uchicago.edu, 2001, Nov 28
- (_
Still confused by msjohsno@cs.uchicago.edu, 2001, Nov 28
-
- 1.
pairs go in, lists come out by Mike O'Donnell, 2001, Nov 28
-
- 1.
Okay then... by msjohnso@uchicago.edu, 2001, Nov 28
- ...
1 Message(s)
- 2.
Wait a minute..., 2001, Nov 28
- ...
1 Message(s)
- 2.
remeber that it's merge*head* by Ben Wolfson, 2001, Nov 28
-
- 1.
Thanks by M.J., 2001, Nov 28
to: "I recommend you keep the types as they are"