Commit d039b7eb authored by Simon Peyton Jones's avatar Simon Peyton Jones
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 ...@@ -324,25 +324,27 @@ depthOfConstr p (t::TypeVal a) c
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
shallowTerm :: (forall a. Data a => Maybe a) -> (forall b. Data b => b) shallowTerm :: (forall a. Data a => Maybe a) -> (forall b. Data b => b)
shallowTerm cust :: b shallowTerm cust
= = result
maybe gdefault id cust where
result :: forall b. Data b => b
where -- Need a type signature here to bring 'b' into scope
result = maybe gdefault id cust
-- The worker, also used for type disambiguation where
gdefault :: b
gdefault = case con of -- The worker, also used for type disambiguation
Just (con, Just _) -> fromConstrB (shallowTerm cust) con gdefault :: b
_ -> error "no shallow term!" gdefault = case con of
Just (con, Just _) -> fromConstrB (shallowTerm cust) con
-- The type to be constructed _ -> error "no shallow term!"
typeVal :: TypeVal b
typeVal = val2type gdefault -- The type to be constructed
typeVal :: TypeVal b
-- The most shallow constructor if any typeVal = val2type gdefault
con :: Maybe (Constr, Maybe Int)
con = depthOfType (const True) typeVal -- The most shallow constructor if any
con :: Maybe (Constr, Maybe Int)
con = depthOfType (const True) typeVal
......
Markdown is supported
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