1 {-# LANGUAGE TypeFamilies #-}
2 module Parsers.Utils.Handrolled where
4 import Control.Monad (Monad(..), fail)
5 import Data.Bool (Bool)
6 import Data.Char (Char)
7 import Data.Maybe (Maybe(..))
8 import Data.Word (Word8)
9 import qualified Data.ByteString as BS
10 import qualified Data.Text as T
12 -- * Class 'Inputable'
13 class Inputable inp where
17 uncons :: inp -> Maybe (Token inp, inp)
18 instance Inputable T.Text where
19 type Token T.Text = Char
23 instance Inputable BS.ByteString where
24 type Token BS.ByteString = Word8