( Scheme
)
where
-import Data.Ascii (CIAscii)
+import Data.Ascii (AsciiBuilder, CIAscii)
import qualified Data.Ascii as A
import Data.Attoparsec.Char8
import qualified Data.ByteString.Char8 as BS
instance ConvertSuccess Scheme CIAscii where
{-# INLINE convertSuccess #-}
- convertSuccess (Scheme s) = s
+ convertSuccess (Scheme s) = foldCase s
+
+instance ConvertSuccess Scheme AsciiBuilder where
+ {-# INLINE convertSuccess #-}
+ convertSuccess = A.toAsciiBuilder ∘ A.fromCIAscii ∘ cs
instance ConvertAttempt CIAscii Scheme where
{-# INLINE convertAttempt #-}
convertAttempt = parseAttempt' def ∘ A.fromCIAscii
-deriveAttempts [ ([t| Scheme |], [t| CIAscii |])
+deriveAttempts [ ([t| Scheme |], [t| AsciiBuilder |])
+ , ([t| Scheme |], [t| CIAscii |])
]