[Haskell-cafe] Function composition in run-time?

dokondr dokondr at gmail.com
Wed Aug 24 14:57:19 CEST 2011


On Wed, Aug 24, 2011 at 4:44 PM, Iustin Pop <iustin at google.com> wrote:

> On Wed, Aug 24, 2011 at 04:35:42PM +0400, dokondr wrote:
> > Hi,
> > What is the Haskell way to compose functions in run-time?
> > Depending on configuration parameters I need to be able to compose
> function
> > in several ways without recompilation.
>
>
A simple alternative to if would be:
>
>  options = [ ("foo", f1 . f2 . f3)
>            , ("bar", f1 . f3 )]
>
> and then "lookup param options". I don't know if this is what you're
> looking for, though.
>
>
Thanks!
Yes, this is what I need - simple and easy. Yet, how function application
will work in this case ?
I mean after lookup returns me a composition ... need to check what type
will it be.

-- 
All the best,
dokondr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110824/ff6420fd/attachment.htm>


More information about the Haskell-Cafe mailing list