[Haskell-beginners] dealing with chained functions

Chaddaï Fouché chaddai.fouche at gmail.com
Sun Sep 5 03:41:21 EDT 2010


On Sat, Sep 4, 2010 at 10:06 AM, Alec Benzer <alecbenzer at gmail.com> wrote:
> No, ya, I get that differences between the two methods, I was asking
> if one of them was generally considered better practice than the
> other.

I think your question is mixing two different concern : A) how you
should write your Haskell functions so that you reap most benefit from
its functional nature, and B) what functions you should expose in the
interface of your libraries.

The answer to A) is that you should use the solution that is more
composable (the former), the answer to B) really depends on what your
library does and the philosophy of your interface... In other words,
it may be better in your specific case to expose the latter functions
(probably not often but it may happen) but the internals of your
library should most likely be written in the former style (it is easy
to form the latter functions from the former, while the opposite is
quite impossible).

-- 
Jedaï


More information about the Beginners mailing list