by capisce · 14y ago · 0 comments
map (head &&& length) . sort . group
filterM (const [True, False])
Can you show how you implement these in D?If you want, I can explain these or give other examples of expressiveness I don't think you'll find in D.
http://stackoverflow.com/a/10410997/578288 – the `map` snippet converts a flat list into a multiset represented as a list of `(count, element)` tuples
http://stackoverflow.com/a/5378799/578288 – the `filterM` snippet returns the powerset of its list argument (http://en.wikipedia.org/wiki/Power_set)
Has there been significant improvements in the past couple of years?
The thing I like about D is that there's no surprises, everything works the way you'd expect it to. You can guess at what code should look like, and chances are it'll work.
http://channel9.msdn.com/Blogs/Charles/Alexandrescu-Bright-M...
Here's a scala to haskell
http://www.cs.ox.ac.uk/jeremy.gibbons/publications/scalagp.p...