3 ms·
I've spent the last two months wishing I'd written the project I'm working on now in Haskell instead of C++ - the main reason? Lazy evaluation. I'm working on
by BruceIV 13y ago
I've spent the last two months wishing I'd written the project I'm working on now in Haskell instead of C++ - the main reason? Lazy evaluation.
I'm working on developing a new algorithm, which is most easily defined as a set of constant functions over my data structure (a DAG with about a dozen node types). There's a fair number of places where I want shortcuts to not calculate things if they're not needed, and with Haskell's lazy evaluation I'd be able to just let the compiler handle most of those (the pattern matching constructs would make my functions-by-cases cleaner to define too).
I'm doing some funny stuff with memo tables indexed by object pointers that would be trickier to do in Haskell, but I think there's likely a library I could leverage.