3 ms·
An example would be probably make your case stronger.
by tome 7y ago
An example would be probably make your case stronger.
- jhomedall 7y agoThis: do x <- ["a","b","c"] y <- ["d","e","f"] return (x ++ y) evaluates to: ["ad","ae","af","bd","be","bf","cd","ce","cf"] Note that this is _not_ equivalent to: ["a", "b", "c"] ++ ["d", "e", "f"] which would instead evaluate to ["a","b","c","d","e","f"] The Python equivalent would be: [(a + b) for a in ["a", "b", "c"] for b in ["d", "e", "f"]] Which evaluates to: ['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf']
- Raidion 7y agoAs someone who does not program in functional languages, this really really helps clear up the article and surrounding discussion. Good stuff!
- dllthomas 7y agoOn the other hand, as someone with a bit of Haskell background, this doesn't even seem weird (except the use of String over Text).