[Haskell-cafe] A practical Haskell puzzle
gale at sefer.org
Thu Mar 3 20:20:25 CET 2011
Brandon Moore wrote:
> My solution does not serialize and deserialize between every
> pair of layers.
Ahhh, I see! Sorry I didn't look closely enough the first time.
Yes, this is a very nice Haskell 98 solution!
>>> This code produces and uses a table of all
>>> allowed combinations. I think this makes it easier
>>> to understand why the code works (and is H98).
I'm not sure I understand why that is so.
>>> It's just as easy to make a direct version that
>>> produces one requested composition in linear time,
>>> so I haven't worried whether lazy evaluation of this
>>> table works nicely.
Well, for the table solution to really qualify, that would
need to work out. Otherwise, I'm not sure it's much
better than just building that many boilerplate definitions
in some automated way and compiling them.
Could you please elaborate a bit more on what you mean
by the "direct version"?
More information about the Haskell-Cafe