Commit d039b7eb authored by simonpj's avatar simonpj
Browse files

Alter source code of test, now that result type signatures do not bind type variables

parent 9b7a5c9c
......@@ -324,25 +324,27 @@ depthOfConstr p (t::TypeVal a) c
------------------------------------------------------------------------------
shallowTerm :: (forall a. Data a => Maybe a) -> (forall b. Data b => b)
shallowTerm cust :: b
=
maybe gdefault id cust
where
-- The worker, also used for type disambiguation
gdefault :: b
gdefault = case con of
Just (con, Just _) -> fromConstrB (shallowTerm cust) con
_ -> error "no shallow term!"
-- The type to be constructed
typeVal :: TypeVal b
typeVal = val2type gdefault
-- The most shallow constructor if any
con :: Maybe (Constr, Maybe Int)
con = depthOfType (const True) typeVal
shallowTerm cust
= result
where
result :: forall b. Data b => b
-- Need a type signature here to bring 'b' into scope
result = maybe gdefault id cust
where
-- The worker, also used for type disambiguation
gdefault :: b
gdefault = case con of
Just (con, Just _) -> fromConstrB (shallowTerm cust) con
_ -> error "no shallow term!"
-- The type to be constructed
typeVal :: TypeVal b
typeVal = val2type gdefault
-- The most shallow constructor if any
con :: Maybe (Constr, Maybe Int)
con = depthOfType (const True) typeVal
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment