ekmett / ersatz

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

Add Ops/Props for functional relations, group function ops #82

Open emeinhardt opened 9 months ago

emeinhardt commented 9 months ago

This PR adds properties and operations for modeling functional relations to Ersatz.Relation.

With respect to #78, where #78 uses error when two argument relations have mismatched bounds, the functions here use Maybe as an error strategy, because they have exactly one expected condition of failure. Per discussion in #81, there doesn't seem to be much in the way of a convention in ersatz yet for when to use what error strategy, but consistency seems preferable.

RyanGlScott commented 9 months ago

Sorry for taking so long to look at this.

@jwaldmann, do you have an opinion on the use of error vs. Maybe to represent partial functions?

emeinhardt commented 7 months ago

@jwaldmann any chance you've had a moment to consider error handling in the Relation modules?