From: PHO Date: Thu, 12 Jan 2012 22:52:47 +0000 (+0900) Subject: Data.URI.Scheme X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=f97a92f;p=Lucu.git Data.URI.Scheme Ditz-issue: c80e79a2585ac20cc5ed677d70b6983a2842a81d --- diff --git a/Data/URI/Internal/Scheme.hs b/Data/URI/Internal/Scheme.hs index 2e3ba24..da8294e 100644 --- a/Data/URI/Internal/Scheme.hs +++ b/Data/URI/Internal/Scheme.hs @@ -12,7 +12,7 @@ module Data.URI.Internal.Scheme ( 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 @@ -64,11 +64,16 @@ instance Default (Parser Scheme) where 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 |]) ]