@@ -15,7 +15,6 @@
1515module Data.Attoparsec.Internal.Types
1616 (
1717 Parser(..)
18− , Input(..)
1918 , Failure
2019 , Success
2120 , Pos(..)
@@ -96,21 +95,16 @@ instance Functor (IResult i) where
9695--
9796-- * 'Alternative', which follows 'MonadPlus'.
9897newtype Parser i a = Parser {
99− runParser :: forall r. Input i =>
98+ runParser :: forall r.
10099 State i -> Pos -> More
101100 -> Failure i (State i) r
102101 -> Success i (State i) a r
103102 -> IResult i r
104103 }
105104
106−class Input i where
107− type State i :: *
108−
109−instance Input ByteString where
110− type State ByteString = B.Buffer
111−
112−instance Input Text where
113− type State Text = T.Buffer
105+type family State i
106+type instance State ByteString = B.Buffer
107+type instance State Text = T.Buffer
114108
115109type Failure i t r = t -> Pos -> More -> [String] -> String
116110 -> IResult i r