module Compile where

import qualified Data.Text as T
import JS.Pretty
import Translate
import qualified Wave.Ast as Wave
import Wave.Builtins

compile :: Wave.File () -> T.Text
compile :: File () -> Text
compile = Doc Any -> Text
forall a. Doc a -> Text
render (Doc Any -> Text) -> (File () -> Doc Any) -> File () -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. File -> Doc Any
forall a. File -> Doc a
ppFile (File -> Doc Any) -> (File () -> File) -> File () -> Doc Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (File () -> StateT TransState (Reader Builtins) File)
-> Builtins -> File () -> File
forall a b.
(a -> StateT TransState (Reader Builtins) b) -> Builtins -> a -> b
translate File () -> StateT TransState (Reader Builtins) File
forall (m :: * -> *). Translate m => File () -> m File
translateFile Builtins
builtins