[Haskell-beginners] Looking for alternative practices suggestions
Mike Meyer
mwm at mired.org
Fri Aug 5 00:47:23 CEST 2011
On Thu, Aug 4, 2011 at 2:53 PM, Michael Litchard <michael at schmong.org>wrote:
> I'm finding that in more than one instance I pass a data structure to
> a function, simply so that I can pass it to it's helper function. It
> bugs me that I'm passing a value that isn't being used directly. This
> seems wrong. Example: I have a "data URLSequence" that contains a way
> to calculate the ip address of a URL. This gets passed to a helper
> function that generates a particular URL, which then populates the
> URLSequence. Is there a standard practice to avoid what I am talking
> about? Or is this normal and I should accept it?
>
I think this is normal, and you should accept it. At least, assuming you're
using the result of the helper function somewhere. You could "solve" this by
hoisting the body of the helper function into the main function, but that
sort of defeats the point of having the helper function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110804/c1dadc24/attachment.htm>
More information about the Beginners
mailing list