On Tue, Feb 10, 2015 at 9:54 AM, Keean Schupke <[email protected]> wrote:
> It seems square brackets are closely associated with lists, so would:
>
> f s = ({ c | c <- (s :: String) } :: String)
>
> Be better?
>
I don't think so. the intent of my original example was to explode a string
and produce a list of its elements.
But I see after a little poking around on the web that "list comprehension"
is indeed generally understood as a construct mapping a list to a list.
Perhaps more strangely (at least to me), OCaml Batteries Included has other
comprehensions, but in their version *all* inputs are lists (rather than
iterables) and it's called a Foo comprehension if it produces a Foo. Their
syntax is uniform, independent of the output type.
shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev