3 ms·
That made me think of Haskell, so to compare here is the equivalent(and of course totally inefficient) Haskell version: [p| p <- [2..n], all (\i -> p `mod` i
by gmartres 16y ago
That made me think of Haskell, so to compare here is the equivalent(and of course totally inefficient) Haskell version:
[p| p <- [2..n], all (\i -> p `mod` i /= 0) [2..p-1]]
So, has this language more to offer than list comprehensions?
- stralep 16y agoI believe, what Haskell is generating is list. What SETL is making, is set. Could this syntax be used over any monad? [edit] Of course, there are things like */[1..n] for finding factorial, but that is fold in Haskell. It's neat for scripting, and for me, for circuit complexity explorations.
- kapuzineralex 16y agoSo all the fuzz is about the fact that SETL has builtin support for sets? Really, I don't mean to be a troll, but is that it?