[m-dev.] Existentially quantified data constructors

Ralph Becket rafe at csse.unimelb.edu.au
Tue Apr 15 15:20:30 AEST 2008


I've defined a type:

:- type lp_fd_pair(LPSolver, FDSolver)
    --->    ( some [LPVar, FDVar]
              lp_fd_pair(LPVar, FDVar)
              =>    (   flatzinc_solver(LPSolver, LPVar),
                        flatzinc_solver(FDSolver, FDVar)
                    )
            ).

and received a complaint:

flatzinc_fdlp_solver.m:093: Error: type variables in class constraints introduced with `=>' must be explicitly existentially quantified using `some': some [_3, _4] lp_fd_pair(_3, _4) => (flatzinc_solver(_1, _3), flatzinc_solver(_2, _4)).
flatzinc_fdlp_solver.m:321: Error: some but not all arguments have modes: lp_fd_propagator_impl_2(_1, _1, (list(lp_fd_pair) :: in), (is_solved :: out), (pqueue :: di), (pqueue :: uo)).

Why can't I refer to LPSolver and FDSolver in the type class constraints
on lp_fd_pair?

-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list