module Top.Solver.Greedy where
import Top.Implementation.General
import Top.Implementation.Basic
import Top.Implementation.TypeInference
import Top.Implementation.FastSubstitution
import Top.Implementation.SimpleSubstitution
import Top.Implementation.Overloading
import Top.Solver
import Top.Constraint
import Top.Constraint.Information
type Greedy info = BasicMonad (GreedyS info)
type GreedyS info = And ( Fix (BasicState info) )
( And ( Simple (TIState info) )
( And ( Simple (GreedyState info) )
( Simple (OverloadingState info) )
)
)
solveGreedy :: (Solvable constraint (Greedy info), TypeConstraintInfo info) =>
SolveOptions -> [constraint] -> Greedy info (SolveResult info)
solveGreedy = solveConstraints
greedyConstraintSolver :: (TypeConstraintInfo info, Solvable constraint (Greedy info)) => ConstraintSolver constraint info
greedyConstraintSolver = makeConstraintSolver solveGreedy
type GreedySimple info = BasicMonad (GreedySimpleS info)
type GreedySimpleS info = And ( Fix (BasicState info) )
( And ( Simple (TIState info) )
( And ( Simple (SimpleState info) )
( Simple (OverloadingState info) )
)
)
solveSimple :: (Solvable constraint (GreedySimple info), TypeConstraintInfo info) =>
SolveOptions -> [constraint] -> GreedySimple info (SolveResult info)
solveSimple = solveConstraints
greedySimpleConstraintSolver :: (TypeConstraintInfo info, Solvable constraint (GreedySimple info)) => ConstraintSolver constraint info
greedySimpleConstraintSolver = makeConstraintSolver solveSimple