module Language.Wasm (
Module,
ValidModule,
ValidationError(..),
parse,
validate,
Language.Wasm.parseScript,
encode,
encodeLazy,
decode,
decodeLazy,
Script,
Command(..),
ModuleDef(..),
Action(..),
Assertion(..),
Ident(..),
Meta(..),
runScript,
Valid.getModule
) where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import Language.Wasm.Structure as Struct
import Language.Wasm.Script as Script
import Language.Wasm.Lexer as Lexer
import Language.Wasm.Parser as Parser
import Language.Wasm.Validate as Valid
import Language.Wasm.Binary as Binary
parse :: LBS.ByteString -> Either String Module
parse :: ByteString -> Either String Module
parse ByteString
content = ByteString -> Either String [Lexeme]
Lexer.scanner ByteString
content Either String [Lexeme]
-> ([Lexeme] -> Either String Module) -> Either String Module
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= [Lexeme] -> Either String Module
Parser.parseModule
parseScript :: LBS.ByteString -> Either String Script
parseScript :: ByteString -> Either String Script
parseScript ByteString
content = ByteString -> Either String [Lexeme]
Lexer.scanner ByteString
content Either String [Lexeme]
-> ([Lexeme] -> Either String Script) -> Either String Script
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= [Lexeme] -> Either String Script
Parser.parseScript
encode :: Module -> BS.ByteString
encode :: Module -> ByteString
encode = Module -> ByteString
dumpModule
encodeLazy :: Module -> LBS.ByteString
encodeLazy :: Module -> ByteString
encodeLazy = Module -> ByteString
dumpModuleLazy
decode :: BS.ByteString -> Either String Module
decode :: ByteString -> Either String Module
decode = ByteString -> Either String Module
decodeModule
decodeLazy :: LBS.ByteString -> Either String Module
decodeLazy :: ByteString -> Either String Module
decodeLazy = ByteString -> Either String Module
decodeModuleLazy