[Haskell-beginners] Representing a Set using a boolean function

Brent Yorgey byorgey at seas.upenn.edu
Sat Dec 31 03:23:14 CET 2011


On Fri, Dec 30, 2011 at 05:53:26PM -0500, Robert Weisser wrote:
>  stumped. I don't see how any function can see inside the set. I don't know
>  enough Haskell to be certain, but it looks impossible to me. Is there
>  something I am missing?

Nope, you're absolutely right.  This is one of the big differences
between an "intensional" representation of a set (such as a list)
which lets you inspect the set's internal structure, and an
"extensional" representation (like a -> Bool) which only lets you
inspect the set's "behavior".  You may enjoy trying to think of other
differences (hint: think about efficiency).

-Brent



More information about the Beginners mailing list