List comprehensions: Difference between revisions

→‎{{header|Haskell}}: variation of first desugaring
(→‎{{header|Haskell}}: Added a test to the desugared version)
(→‎{{header|Haskell}}: variation of first desugaring)
Line 846:
[y .. n] >>=
(\z ->
ifcase x ^ 2 + y ^ 2 == z ^ 2 of
thenTrue -> return [(x, y, z)]
elseFalse -> [])))</lang>
 
which can be further specialised (given the particular context of the list monad, in which >>= is concatMap) to:
9,659

edits