module Graphics.Web.Processing.Core.Types (
ProcScript (..)
, emptyScript
, renderScript
, renderFile
, ProcCode
, Preamble (..)
, Setup (..)
, Draw (..)
, MouseClicked (..)
, MouseReleased (..)
, KeyPressed (..)
, ProcType
, Proc_Bool, true, false
, fromBool
, pnot, (#||), (#&&)
, Proc_Int
, fromInt
, intToFloat
, Proc_Float
, fromFloat
, pfloor
, pround
, Proc_Char
, fromChar
, Proc_Text
, fromStText
, Proc_Image
, Proc_Eq (..)
, Proc_Ord (..)
, if_
) where
import Graphics.Web.Processing.Core.Primal
import Text.PrettyPrint.Mainland
import Data.Text.Lazy (Text)
import qualified Data.Text.Lazy.IO as T
charsPerLine :: Int
charsPerLine = 80
renderScript :: ProcScript -> Text
renderScript = prettyLazyText charsPerLine . ppr
renderFile :: FilePath -> ProcScript -> IO ()
renderFile fp = T.writeFile fp . renderScript
if_ :: ProcType a => Proc_Bool -> a -> a -> a
if_ = proc_cond