Sorry for jumping in late.
The Haskell expression you showed here is called a list comprehansion
which can be easily formulated as
map f xs
and this is in J simply:
f xs
Jon Hough schreef op 26-12-14 om 17:04:
In Haskell (and other languages I'm sure) one can express the idea of "such
that" to denote one expression depending on another. In Haskell we can use the
syntax:
[ f x | x <- xs ]
which means
"the list of all f x
such that x is drawn from xs."
So | is syntactically similar to the English "such that". (and very much like |
in mathematical sets)
I would like to know if J has a construct to express the above Haskell code.
Thanks,
Jon.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
Met vriendelijke groet,
@@i = Arie Groeneveld
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm