    -- | https://wiki.debian.org/DebianRepository/Format#Codename

    {-# LANGUAGE DeriveDataTypeable, TemplateHaskell #-}

    module Debian.Codename
        ( Codename(..)
        , codename
        , parseCodename
        ) where

    import Data.Data (Data, Typeable)
    import Debian.TH ({-instance Pretty Loc-})
    import Network.URI (unEscapeString, escapeURIString, isAllowedInURI)
    --import Text.PrettyPrint.HughesPJClass as PP (Pretty(pPrint), text)
    import Text.PrettyPrint (text)
    import Distribution.Pretty

    data Codename = Codename String deriving (Codename -> Codename -> Bool
    (Codename -> Codename -> Bool)
    -> (Codename -> Codename -> Bool) -> Eq Codename
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Codename -> Codename -> Bool
    == :: Codename -> Codename -> Bool
    $c/= :: Codename -> Codename -> Bool
    /= :: Codename -> Codename -> Bool
    Eq, Eq Codename
    Eq Codename =>
    (Codename -> Codename -> Ordering)
    -> (Codename -> Codename -> Bool)
    -> (Codename -> Codename -> Bool)
    -> (Codename -> Codename -> Bool)
    -> (Codename -> Codename -> Bool)
    -> (Codename -> Codename -> Codename)
    -> (Codename -> Codename -> Codename)
    -> Ord Codename
    Codename -> Codename -> Bool
    Codename -> Codename -> Ordering
    Codename -> Codename -> Codename
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: Codename -> Codename -> Ordering
    compare :: Codename -> Codename -> Ordering
    $c< :: Codename -> Codename -> Bool
    < :: Codename -> Codename -> Bool
    $c<= :: Codename -> Codename -> Bool
    <= :: Codename -> Codename -> Bool
    $c> :: Codename -> Codename -> Bool
    > :: Codename -> Codename -> Bool
    $c>= :: Codename -> Codename -> Bool
    >= :: Codename -> Codename -> Bool
    $cmax :: Codename -> Codename -> Codename
    max :: Codename -> Codename -> Codename
    $cmin :: Codename -> Codename -> Codename
    min :: Codename -> Codename -> Codename
    Ord, ReadPrec [Codename]
    ReadPrec Codename
    Int -> ReadS Codename
    ReadS [Codename]
    (Int -> ReadS Codename)
    -> ReadS [Codename]
    -> ReadPrec Codename
    -> ReadPrec [Codename]
    -> Read Codename
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS Codename
    readsPrec :: Int -> ReadS Codename
    $creadList :: ReadS [Codename]
    readList :: ReadS [Codename]
    $creadPrec :: ReadPrec Codename
    readPrec :: ReadPrec Codename
    $creadListPrec :: ReadPrec [Codename]
    readListPrec :: ReadPrec [Codename]
    Read, Int -> Codename -> ShowS
    [Codename] -> ShowS
    Codename -> String
    (Int -> Codename -> ShowS)
    -> (Codename -> String) -> ([Codename] -> ShowS) -> Show Codename
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Codename -> ShowS
    showsPrec :: Int -> Codename -> ShowS
    $cshow :: Codename -> String
    show :: Codename -> String
    $cshowList :: [Codename] -> ShowS
    showList :: [Codename] -> ShowS
    Show, Typeable Codename
    Typeable Codename =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> Codename -> c Codename)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c Codename)
    -> (Codename -> Constr)
    -> (Codename -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c Codename))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Codename))
    -> ((forall b. Data b => b -> b) -> Codename -> Codename)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> Codename -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> Codename -> r)
    -> (forall u. (forall d. Data d => d -> u) -> Codename -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> Codename -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> Codename -> m Codename)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Codename -> m Codename)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> Codename -> m Codename)
    -> Data Codename
    Codename -> Constr
    Codename -> DataType
    (forall b. Data b => b -> b) -> Codename -> Codename
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> Codename -> u
    forall u. (forall d. Data d => d -> u) -> Codename -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Codename -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Codename -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Codename
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Codename -> c Codename
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Codename)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Codename)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Codename -> c Codename
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Codename -> c Codename
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Codename
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Codename
    $ctoConstr :: Codename -> Constr
    toConstr :: Codename -> Constr
    $cdataTypeOf :: Codename -> DataType
    dataTypeOf :: Codename -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Codename)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Codename)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Codename)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Codename)
    $cgmapT :: (forall b. Data b => b -> b) -> Codename -> Codename
    gmapT :: (forall b. Data b => b -> b) -> Codename -> Codename
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Codename -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Codename -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Codename -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Codename -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> Codename -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> Codename -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Codename -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Codename -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Codename -> m Codename
    Data, Typeable)

    parseCodename :: String -> Codename
    parseCodename :: String -> Codename
    parseCodename = String -> Codename
    Codename (String -> Codename) -> ShowS -> String -> Codename
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ShowS
    unEscapeString

    codename :: Codename -> String
    codename :: Codename -> String
    codename (Codename String
    s) = (Char -> Bool) -> ShowS
    escapeURIString Char -> Bool
    isAllowedInURI String
    s

    instance Pretty Codename where
        pretty :: Codename -> Doc
    pretty (Codename String
    s) = String -> Doc
    text String
    s