On Tue, Feb 10, 2015 at 12:51 PM, Jonathan S. Shapiro <[email protected]> wrote:
> What I intended was:
>
> [ c | c <- (s : String) ]
>
>
> That is: we are forming a list of characters obtained by exploding a string.
> Naively, I would have expected that since the thing being comprehended (so
> to speak) is a string, this would be considered a string comprehension.

I figured the term "comprehension" in programming came from "set
comprehension" in logic, where you describe a set which has exactly
those elements satisfying a predicate. Monadic comprehensions are a
generalization of set comprehension to also work with other monads
(besides "set of _"). For programming, the predicates to filter with
have to be decidable.

Anyway, the point is: I think an X comprehension should denote an X.
It doesn't matter what types data is drawn from to define the
elements. So if Shap's example above explodes a string to a list, then
it's a list comprehension.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to