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