Good afternoon Café,
I've written a little bit of code to calculate minimal complete
definitions for a class given which of its functions use which other
functions.
As an example:
doDependencies ord =
([],[[=],[compare]])
doDependencies num =
Code might help :P
import qualified Data.Set as Set
import Data.Set (Set)
import Data.List (partition,delete)
import Data.Maybe (isJust,fromJust)
-- A snippet for working out minimal complete definitions.
num =
[
(plus,Nothing),
(times,Nothing),
(abs,Nothing),
(minus,Just [negate]),
Sorry about the triple-post, but I forgot to note it only goes to one
'depth' of OR; in reality the MCD for wrongOrd should be ( OR ((=) AND
(compare OR )) OR compare). This requires a slightly more complicated
type than [[a]] :)
signature.asc
Description: This is a digitally signed message part