insertHsType :: FieldInfo -> Entity -> InteractionMode -> FieldInfo
insertHsType fi ent mode =
    let fiType = type_ fi
        err = error $ "Could not find Haskell type for " ++ unpack fiType
                      ++ " for field " ++ unpack (name fi) ++ " in " ++ show ent
                      ++ ", mode " ++ show mode
    in fi {type_ = Map.findWithDefault err fiType typesMap}
insertHsType :: FieldInfo -> Entity -> InteractionMode -> FieldInfo
insertHsType fi ent mode =
    let fiType = type_ fi
        err = error $ "Could not find Haskell type for " ++ unpack fiType
                      ++ " for field " ++ unpack (name fi) ++ " in " ++ show ent
                      ++ ", mode " ++ show mode
    in fi {type_ = Map.findWithDefault err fiType typesMap}
insertHsType fi ent mode =
    let fiType = type_ fi
        err = error $ "Could not find Haskell type for " ++ unpack fiType
                      ++ " for field " ++ unpack (name fi) ++ " in " ++ show ent
                      ++ ", mode " ++ show mode
    in fi {type_ = Map.findWithDefault err fiType typesMap}