@@ -426,7 +426,7 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
426426
427427 valueToCpp (ObjectUpdate _ _ _) = error $ "Bad Type in object update!"
428428
429− valueToCpp (Abs _ arg body) = do
429+ valueToCpp (Abs (_, _, ty, _) arg body) = do
430430 cpp <- valueToCpp body
431431 let cpp' = convertNestedLambdas cpp
432432 return $
@@ -434,7 +434,14 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
434434 []
435435 [(identToCpp arg, Just $ CppAny [CppConst, CppRef])]
436436 (Just $ CppAny [])
437− (asReturnBlock cpp')
437+ (asReturnBlock $ convertDictIndexers cpp')
438+ where
439+ arg' = identToCpp arg
440+ args' = identToCpp <$> (fst $ unAbs body [])
441+ classes = qualifiedToCpp (Ident . runProperName) . fst <$>
442+ maybe [] extractConstraints ty
443+ dictClasses = zip (CppVar <$> arg' : args') classes
444+ convertDictIndexers = everywhereOnCpp (dictIndexerToEnum dictClasses)
438445 valueToCpp e@App{} = do
439446 let (f, args) = unApp e []
440447 args' <- mapM valueToCpp args