@@ -128,16 +128,16 @@ constrain env (L _ _ expr) tipe =
128128 recordType = record fieldTypes (TermN EmptyRecord1)
129129 return $ ex (map snd pairs) (CAnd (tipe === recordType : cs))
130130 where
131− field (name, args, body) = do
132− let value = List.foldl' (\e arg -> Loc.none (Lambda (PVar arg) e)) body args
131+ field (name, body) = do
133132 v <- flexibleVar -- needs an ex
134− c <- constrain env value (VarN v)
133+ c <- constrain env body (VarN v)
135134 return ((name, v), c)
136135
137136
138137 Markdown _ ->
139138 return $ tipe === Env.get env builtin "Element"
140139
140+{--
141141 Let defs body ->
142142 do c <- constrain env body tipe
143143 (schemes, rqs, fqs, header, c2, c1) <-
@@ -149,12 +149,12 @@ constrain env (L _ _ expr) tipe =
149149 (c1 /\ c))
150150
151151
152−constrainDef env info (name, args, expr, maybeTipe) =
152+constrainDef env info (name, qs, expr, maybeTipe) =
153153 let (schemes, rigidQuantifiers, flexibleQuantifiers, headers, c2, c1) = info in
154154 case maybeTipe of
155155 Just tipe ->
156− do flexiVars <- mapM (\_ -> flexibleVar) args
157− let inserts = zipWith (\arg typ -> Map.insert arg (VarN typ)) args flexiVars
156+ do flexiVars <- mapM (\_ -> flexibleVar) qs
157+ let inserts = zipWith (\arg typ -> Map.insert arg (VarN typ)) qs flexiVars
158158 env' = env { value = List.foldl' (\x f -> f x) (value env) inserts }
159159 typ = error "This should be the internal representation of the user defined type."
160160 scheme = Scheme { rigidQuantifiers = [],
@@ -171,9 +171,9 @@ constrainDef env info (name, args, expr, maybeTipe) =
171171
172172 Nothing ->
173173 do var <- flexibleVar
174− rigidVars <- mapM (\_ -> rigidVar) args
174+ rigidVars <- mapM (\_ -> rigidVar) qs
175175 let tipe = VarN var
176− inserts = zipWith (\arg typ -> Map.insert arg (VarN typ)) args rigidVars
176+ inserts = zipWith (\arg typ -> Map.insert arg (VarN typ)) qs rigidVars
177177 env' = env { value = List.foldl' (\x f -> f x) (value env) inserts }
178178 c <- constrain env' expr tipe
179179 return ( schemes
@@ -185,7 +185,7 @@ constrainDef env info (name, args, expr, maybeTipe) =
185185
186186--collapseDefs :: [Def t v] -> [(String, [String], LExpr t v, Maybe Type)]
187187collapseDefs definitions =
188− map (\(name, (args, expr, tipe)) -> (name, args, expr, tipe)) defPairs
188+ map (\(name, (expr, tipe)) -> (name, expr, tipe)) defPairs
189189 where
190190 defPairs = Map.toList (go Map.empty Map.empty definitions)
191191
@@ -193,7 +193,8 @@ collapseDefs definitions =
193193 (Map.map ($ Nothing) (Map.difference defs typs))
194194 go defs typs (d:ds) =
195195 case d of
196− Def name args body ->
197− go (Map.insert name ((,,) args body) defs) typs ds
196+ Def name body ->
197+ go (Map.insert name ((,) body) defs) typs ds
198198 TypeAnnotation name typ ->
199199 go defs (Map.insert name typ typs) ds
200+--}