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