Fix issue #241
This commit is contained in:
parent
e9a626d110
commit
5f7fcaa92d
1 changed files with 10 additions and 1 deletions
|
@ -56,10 +56,19 @@ metadataModule ifaces modul =
|
||||||
program' <- rename initialEnv (program modul)
|
program' <- rename initialEnv (program modul)
|
||||||
aliases' <- mapM (third renameType') (aliases modul)
|
aliases' <- mapM (third renameType') (aliases modul)
|
||||||
datatypes' <- mapM (third (mapM (second (mapM renameType')))) (datatypes modul)
|
datatypes' <- mapM (third (mapM (second (mapM renameType')))) (datatypes modul)
|
||||||
return $ modul { program = program', aliases = aliases', datatypes = datatypes' }
|
exports' <- mapM (third renameType') (foreignExports modul)
|
||||||
|
imports' <- mapM (twoAndFour (rename initialEnv) renameType') (foreignImports modul)
|
||||||
|
return $ modul { program = program'
|
||||||
|
, aliases = aliases'
|
||||||
|
, datatypes = datatypes'
|
||||||
|
, foreignExports = exports'
|
||||||
|
, foreignImports = imports' }
|
||||||
where
|
where
|
||||||
second f (a,b) = (,) a `fmap` f b
|
second f (a,b) = (,) a `fmap` f b
|
||||||
third f (a,b,c) = (,,) a b `fmap` f c
|
third f (a,b,c) = (,,) a b `fmap` f c
|
||||||
|
twoAndFour f g (a,b,c,d) = do b' <- f b
|
||||||
|
d' <- g d
|
||||||
|
return (a,b',c,d')
|
||||||
renameType' =
|
renameType' =
|
||||||
Either.either (\err -> Left [P.text err]) return . renameType (replace "type" initialEnv)
|
Either.either (\err -> Left [P.text err]) return . renameType (replace "type" initialEnv)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue