ekmett / ersatz

A monad for interfacing with external SAT solvers
Other
63 stars 15 forks source link

instance (Bounded i, Ix i, Variable e) => Variable (A.Array i e) ? #47

Closed jwaldmann closed 2 years ago

jwaldmann commented 4 years ago

See #45 . Same thing applies for Ersatz.Relation.

possible counter-argument: since instance Bounded Int, this would allow to use exists with result type Array Int e, allocating 2^64 elements.

But we shouldn't be using Int-indexed arrays anyways, instead dimension/bounds should be in the type.

glguy commented 4 years ago

I think this would be an error prone instance to use, and I don't think it's very common to want an array from minBound to maxBound. I think it would be much better to define a function that takes the bounds and returns a new array.