List comprehensions: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: ( Adjusted the claim that comprehensions desugar to Do notation - the latter is in fact an alternative sugaring))
(→‎{{header|Haskell}}: Added a test to the desugared version)
Line 865: Line 865:
[y .. n])
[y .. n])
[x .. n])
[x .. n])
[1 .. n]</lang>
[1 .. n]

main :: IO ()
main = print $ pyth 25</lang>
{{Out}}
<pre>[(3,4,5),(5,12,13),(6,8,10),(7,24,25),(8,15,17),(9,12,15),(12,16,20),(15,20,25)]</pre>


=={{header|Hy}}==
=={{header|Hy}}==