conal / total-map

Finitely represented /total/ maps
Other
15 stars 6 forks source link

add a new query that takes advantage of the finite input space #6

Closed dmwit closed 8 years ago

dmwit commented 8 years ago

I want to do some TotalMap manipulations, then check whether all values meet some criteria. So ultimately I wish for a function with a type like this:

all :: (v -> Bool) -> TMap k v -> Bool

However, compared to the other functions in the package, this one is hopelessly specific. I've done my best to work out what the "general" form of this operation is; after some thought, I concluded that one might want something like this as the more general form:

codomain :: Ord v => TMap k v -> Set v

This has an extra Ord constraint compared to all. For my needs this is fine; though I would be curious whether there was another operation that doesn't require it.

conal commented 8 years ago

Seems a tasteful choice to me and one compatible with the denotation, which I appreciate. Released as total-map-0.0.6. Thanks for the contribution!