module Codec.Candid.EncodeTextual where
import qualified Data.ByteString.Lazy as BS
import qualified Data.ByteString.Builder as B
import Control.Monad
import Codec.Candid.Parse
import Codec.Candid.Encode
encodeTextual :: String -> Either String BS.ByteString
encodeTextual :: String -> Either String ByteString
encodeTextual = String -> Either String [Value]
parseValues forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> [Value] -> Either String Builder
encodeDynValues forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. Builder -> ByteString
B.toLazyByteString