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