@@ -151,9 +151,11 @@ constrainDef env info (pattern, expr, maybeTipe) =
151151 let qs = [] -- should come from the def, but I'm not sure what would live there...
152152 (schemes, rigidQuantifiers, flexibleQuantifiers, headers, c2, c1) = info
153153 in
154− case (pattern, maybeTipe) of
155− (PVar name, Just tipe) ->
156− do flexiVars <- mapM (\_ -> var Flexible) qs
154+ do rigidVars <- mapM (\_ -> var Rigid) qs -- Some mistake may be happening here.
155+ -- Currently, qs is always the empty list.
156+ case (pattern, maybeTipe) of
157+ (PVar name, Just tipe) -> do
158+ flexiVars <- mapM (\_ -> var Flexible) qs
157159 let inserts = zipWith (\arg typ -> Map.insert arg (VarN typ)) qs flexiVars
158160 env' = env { Env.value = List.foldl' (\x f -> f x) (Env.value env) inserts }
159161 (vars, typ) <- Env.instantiateType env tipe Map.empty
@@ -167,12 +169,10 @@ constrainDef env info (pattern, expr, maybeTipe) =
167169 , flexibleQuantifiers
168170 , headers
169171 , c2
170− , fl rigidQuantifiers c /\ c1 )
172+ , fl rigidVars c /\ c1 )
171173
172− (PVar name, Nothing) ->
173− do v <- var Flexible
174− rigidVars <- mapM (\_ -> var Rigid) qs -- Some mistake may be happening here.
175− -- Currently, qs is always the empty list.
174+ (PVar name, Nothing) -> do
175+ v <- var Flexible
176176 let tipe = VarN v
177177 inserts = zipWith (\arg typ -> Map.insert arg (VarN typ)) qs rigidVars
178178 env' = env { Env.value = List.foldl' (\x f -> f x) (Env.value env) inserts }