diff options
Diffstat (limited to 'protocols/codegen/Main.hs')
| -rw-r--r-- | protocols/codegen/Main.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/codegen/Main.hs b/protocols/codegen/Main.hs index dbe1577..ec12592 100644 --- a/protocols/codegen/Main.hs +++ b/protocols/codegen/Main.hs @@ -45,8 +45,13 @@ writeInterface :: FlatModules -> FilePath -> TypedProtocol -> TypedInterfaceDesc writeInterface flat dir p i = do let path = dir </> (interfaceModule (fst i) ++ ".hs") let bootPath = dir </> (interfaceModule (fst i) ++ ".hs-boot") - writeFile path (generateInterface flat p i) - writeFile bootPath (generateInterfaceBoot flat p i) + let cfg = GeneratorConfig { genModules = flat + , genProtocol = p + , genInterface = fst i + , genTypes = snd i + } + writeFile path (generateInterface cfg) + writeFile bootPath (generateInterfaceBoot cfg) writeBuild :: FilePath -> [Protocol] -> IO () writeBuild path ps = writeFile path $ generateBuild ps |
