Sunday, 15 June 2014

function - Haskell: Alternative to patterns of where f = foo e, e = bar d, d = baz c -



function - Haskell: Alternative to patterns of where f = foo e, e = bar d, d = baz c -

i have function growing , getting pattern shown bellow. proper alternative these f = fooed e equal bared e equal bazed d...?

myfunc:: string -> options -> string myfunc somestring opts = topstr ++ editedmidstr ++ botstr editedmidstr = foo f f = bar e e = baz d d = qux c ... = ...

use function composition!

myfunc mystring opts = topstr ++ editedmidstr ++ botstr editedmidstr = (foo . bar . baz . qux . makeacfrommystring) mystring

function haskell functional-programming where

No comments:

Post a Comment