@@ -211,7 +211,7 @@ parseJSON_generic j = generic
211211 | n > 1 = construct c (V.toList js) -- no field names
212212 -- FIXME? We could allow reading an array into a constructor
213213 -- with field names.
214− go _ c fs@(_:_) (Object o) = selectFields (fromJSObject o) fs >>=
214+ go _ c fs@(_:_) (Object o) = selectFields o fs >>=
215215 construct c -- field names
216216 go _ c _ jd = modFail "parseJSON" $
217217 "bad decodeArgs data " ++ show (c, jd)
@@ -226,11 +226,10 @@ parseJSON_generic j = generic
226226 [] -> lift $ modFail "construct" "empty list"
227227 (j':js') -> do put js'; lift $ parseJSON j'
228228
229− -- Select the named fields from a JSON object. FIXME? Should
230− -- this use a map?
229+ -- Select the named fields from a JSON object.
231230 selectFields fjs = mapM sel
232231 where sel f = maybe (modFail "parseJSON" $ "field does not exist " ++
233− f) return $ lookup f fjs
232+ f) return $ Map.lookup (pack f) fjs
234233
235234 -- Count how many arguments a constructor has. The value x is
236235 -- used to determine what type the constructor returns.