Changeset [86b9163741d52e3212bc93f57b7660a06e6deacf] by Douglas Creager
Revision 86b9163741d52e3212bc93f57b7660a06e6deacf,
committed by Douglas Creager
· September 9th, 2008 @ 03:27 PM
Infinite sets
This patch introduces another new implementation for sets, which supports any infinite set. (The previous implementation only supported open ranges.) A set is now defined by a “loader list”. The loader list can be infinite, and can contain duplicates. Sets can be accessed in one of two ways. The toSet function turns the set into an instance of the standard Data.Se t type. As such, it only works on finite sets. The toList function, on the other hand, returns the elements as a lazy list. It therefore supports infinite sets. As elements are extracted from the loader list, they are added to a “storage set”; the result is that the toList function returns the original loader list, with duplicates removed.
Lighthouse: [#12 state:resolved] http://github.com/dcreager/hst/c...
5 changed files
-
M
cspm/src/HST/CSPM.hs -
M
cspm/src/HST/CSPM/Evaluate.hs -
M
cspm/src/HST/CSPM/Sets.lhs -
M
cspm/src/HST/CSPM/Types.hs -
M
cspm/tests/HST/CSPM/Tests/Sets.hs