3 , GeneralizedNewtypeDeriving
7 module Data.URI.Internal.Scheme
12 import Data.Ascii (CIAscii)
13 import Data.CaseInsensitive
18 -- |'Scheme' names consist of a non-empty sequence of characters
19 -- beginning with a letter and followed by any combination of letters,
20 -- digits, plus (\'+\'), period (\'.\'), or hyphen (\'-\'):
21 -- <http://tools.ietf.org/html/rfc3986#section-3.1>
22 newtype Scheme = Scheme CIAscii
30 -- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
32 -- |'isString' is a fast but unsafe way to create 'Scheme' such that
33 -- no validation on the string is performed.
34 deriving instance IsString Scheme
36 -- |Converts a 'CIAscii' to 'Scheme' without any validation on the
38 unsafeCreateScheme ∷ CIAscii → Scheme
39 {-# INLINE CONLIKE unsafeCreateScheme #-}
40 unsafeCreateScheme = Scheme