[Haskell-cafe] Design Patterns by Gamma or equivalent
dons at galois.com
Sun Mar 15 01:43:21 EDT 2009
> There also a number of "idioms" which are similar in scope to the idioms
> that arise in other languages: using tail recursion, accumulators,
> continuation-passing transformations, closures over recursion,
> Schwartzian transforms, etc.
>  For lack of a better name. I mean doing this:
> > -- Here the a,b,c,d variables are captured in the closure for go
> > recursive a b c d = go
> > where
> > go 0 = ...a...b...
> > go n = ...c...d...go (n-1)
> instead of this:
> > -- ...instead of needing to be passed through the recursion each time
> > recursive a b c d 0 = ...a...b...
> > recursive a b c d n = ...c...d...recursive a b c d (n-1)
Static argument transformation:
Or more generally worker/wrapper
Take your pick :)
More information about the Haskell-Cafe