jaspervdj/digestive-functors — Issue #20: Input list using provided defaults
Author: chrisdone
Created: 2011-11-16 10:30:59+00:00
State: open

[Here is a use case](http://hpaste.org/54062), taken from the example linked from the Cabal file.

[Here is the output](http://hpaste.org/54063), I would expect the values in the inputs to be filled in with `"foo" "bar" 0`.

Am I doing something wrong? I looked at this all evening and the implementation of `inputList` and I came up with a fix, but I can't tell if it's the correct fix, or whether it breaks some assumptions:

forms = zipWith ($) fs $ maybe (maybe [Nothing] (map Just) defaults)
(\i -> take i (maybe [] (map Just) defaults ++ repeat Nothing))
countFromForm

From my understanding, this will enable the defaults to be included in all cases, and the `repeat Nothing` is for non-default inputs added dynamically by the client.

If you can find what I'm doing wrong, or grok this change I propose, I'd appreciate it. I had a hard time grokking this library and this function.