module Codec.Phaser.Text (
unpackText,
unpackLazyText
) where
import qualified Data.Text as TS
import qualified Data.Text.Lazy as TL
import Control.Applicative
import Codec.Phaser.Core
unpackText :: (Monoid p) => Phase p TS.Text Char ()
unpackText = (go >> unpackText) <|> return () where
go = get >>= TS.foldr (\w r -> yield w >> r) (return ())
unpackLazyText :: (Monoid p) => Phase p TL.Text Char ()
unpackLazyText = (go >> unpackLazyText) <|> return () where
go = get >>= TL.foldr (\w r -> yield w >> r) (return ())