[Haskell-cafe] Stack Overflow, tail recursion and CPS

Jonathan Cast jonathanccast at fastmail.fm
Wed Jan 14 13:37:06 EST 2009


On Wed, 2009-01-14 at 19:19 +0100, Günther Schmidt wrote:
> Hello Neil,
> 
> thanks, that did indeed work.
> 
> I guess I shot myself in the foot a bit here ...
> 
> Cause my real problem isn't actually with Map but with IxSet (from HAppS)  
> which to my knowledge does not have some sort of strict insert function.

Does it by any chance have a Control.Parallel.Strategies.NFData
instance?  If it should happen to, then replacing (I didn't look up the
type of insert!)

    foldl insert empty xn

with

    foldl' ((result.result) (`using` rnf) insert) empty xn

(where result is the Semantic Editor Combinator[1]

    result e f = e . f)

would give you as much strictness as possible.

Which might not be an improvement.

jcc

[1] This term was invented by Conal Elliot at
<http://conal.net/blog/posts/semantic-editor-combinators/>.  Semantic
Editor Combinators are a clever technique for making point-less code
readable.[2]

[2] Does making point-free code readable miss the point of point-free
style?




More information about the Haskell-Cafe mailing list