
24 Aug
2011
24 Aug
'11
8:57 a.m.
On Wed, Aug 24, 2011 at 4:44 PM, Iustin Pop
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