codegen :: Target -> [SDecl] -> Module
codegen tgt defs = Module "idris" (Just . dataLayout $ tgt) (Just . triple $ tgt) (initDefs tgt ++ globals ++ gendefs)
    where
      (gendefs, _, globals) = runRWS (mapM cgDef defs) tgt initialMGS
codegen :: Target -> [SDecl] -> Module
codegen tgt defs = Module "idris" (Just . dataLayout $ tgt) (Just . triple $ tgt) (initDefs tgt ++ globals ++ gendefs)
    where
      (gendefs, _, globals) = runRWS (mapM cgDef defs) tgt initialMGS
codegen tgt defs = Module "idris" (Just . dataLayout $ tgt) (Just . triple $ tgt) (initDefs tgt ++ globals ++ gendefs)
    where
      (gendefs, _, globals) = runRWS (mapM cgDef defs) tgt initialMGS