{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
module JsonToType.CodeGen(
Lang(..)
, writeModule
, runModule
, defaultOutputFilename
) where
import Data.Text(Text)
import qualified Data.HashMap.Strict as Map
import JsonToType.Type
import System.Exit
import JsonToType.CodeGen.Haskell
import JsonToType.CodeGen.Elm
data Lang = Haskell
| HaskellStrict
| Elm
defaultOutputFilename :: Lang -> FilePath
defaultOutputFilename :: Lang -> FilePath
defaultOutputFilename Lang
Haskell = FilePath
defaultHaskellFilename
defaultOutputFilename Lang
HaskellStrict = FilePath
defaultHaskellFilename
defaultOutputFilename Lang
Elm = FilePath
defaultElmFilename
writeModule :: Lang -> FilePath -> Text -> Map.HashMap Text Type -> IO ()
writeModule :: Lang -> FilePath -> Text -> HashMap Text Type -> IO ()
writeModule Lang
Haskell = FilePath -> Text -> HashMap Text Type -> IO ()
writeHaskellModule
writeModule Lang
HaskellStrict = FilePath -> Text -> HashMap Text Type -> IO ()
writeHaskellModule
writeModule Lang
Elm = FilePath -> Text -> HashMap Text Type -> IO ()
writeElmModule
runModule :: Lang -> FilePath -> [String] -> IO ExitCode
runModule :: Lang -> FilePath -> [FilePath] -> IO ExitCode
runModule Lang
Haskell = FilePath -> [FilePath] -> IO ExitCode
runHaskellModule
runModule Lang
HaskellStrict = FilePath -> [FilePath] -> IO ExitCode
runHaskellModuleStrict
runModule Lang
Elm = FilePath -> [FilePath] -> IO ExitCode
runElmModule