{-# LANGUAGE DeriveDataTypeable, DeriveGeneric, TemplateHaskell, TypeOperators, OverloadedStrings #-}
module Happstack.Authenticate.Password.PartialsURL where

import Data.Data                            (Data, Typeable)
import Control.Category                     ((.), id)
import GHC.Generics                         (Generic)
import Prelude                              hiding ((.), id)
import Text.Boomerang.TH                    (makeBoomerangs)
import Web.Routes                           (PathInfo(..))
import Web.Routes.Boomerang                 (Router, (:-), (<>), boomerangFromPathSegments, boomerangToPathSegments)


data PartialURL
  = LoginInline
  | Login
  | Logout
  | SignupPassword
  | ChangePassword
  | RequestResetPasswordForm
  | ResetPasswordForm
  deriving (PartialURL -> PartialURL -> Bool
(PartialURL -> PartialURL -> Bool)
-> (PartialURL -> PartialURL -> Bool) -> Eq PartialURL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartialURL -> PartialURL -> Bool
$c/= :: PartialURL -> PartialURL -> Bool
== :: PartialURL -> PartialURL -> Bool
$c== :: PartialURL -> PartialURL -> Bool
Eq, Eq PartialURL
Eq PartialURL
-> (PartialURL -> PartialURL -> Ordering)
-> (PartialURL -> PartialURL -> Bool)
-> (PartialURL -> PartialURL -> Bool)
-> (PartialURL -> PartialURL -> Bool)
-> (PartialURL -> PartialURL -> Bool)
-> (PartialURL -> PartialURL -> PartialURL)
-> (PartialURL -> PartialURL -> PartialURL)
-> Ord PartialURL
PartialURL -> PartialURL -> Bool
PartialURL -> PartialURL -> Ordering
PartialURL -> PartialURL -> PartialURL
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
min :: PartialURL -> PartialURL -> PartialURL
$cmin :: PartialURL -> PartialURL -> PartialURL
max :: PartialURL -> PartialURL -> PartialURL
$cmax :: PartialURL -> PartialURL -> PartialURL
>= :: PartialURL -> PartialURL -> Bool
$c>= :: PartialURL -> PartialURL -> Bool
> :: PartialURL -> PartialURL -> Bool
$c> :: PartialURL -> PartialURL -> Bool
<= :: PartialURL -> PartialURL -> Bool
$c<= :: PartialURL -> PartialURL -> Bool
< :: PartialURL -> PartialURL -> Bool
$c< :: PartialURL -> PartialURL -> Bool
compare :: PartialURL -> PartialURL -> Ordering
$ccompare :: PartialURL -> PartialURL -> Ordering
$cp1Ord :: Eq PartialURL
Ord, Typeable PartialURL
DataType
Constr
Typeable PartialURL
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> PartialURL -> c PartialURL)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PartialURL)
-> (PartialURL -> Constr)
-> (PartialURL -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PartialURL))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PartialURL))
-> ((forall b. Data b => b -> b) -> PartialURL -> PartialURL)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PartialURL -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PartialURL -> r)
-> (forall u. (forall d. Data d => d -> u) -> PartialURL -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> PartialURL -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> PartialURL -> m PartialURL)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PartialURL -> m PartialURL)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> PartialURL -> m PartialURL)
-> Data PartialURL
PartialURL -> DataType
PartialURL -> Constr
(forall b. Data b => b -> b) -> PartialURL -> PartialURL
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PartialURL -> c PartialURL
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PartialURL
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) -> PartialURL -> u
forall u. (forall d. Data d => d -> u) -> PartialURL -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PartialURL -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PartialURL -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PartialURL
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PartialURL -> c PartialURL
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PartialURL)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PartialURL)
$cResetPasswordForm :: Constr
$cRequestResetPasswordForm :: Constr
$cChangePassword :: Constr
$cSignupPassword :: Constr
$cLogout :: Constr
$cLogin :: Constr
$cLoginInline :: Constr
$tPartialURL :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
gmapMp :: (forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
gmapM :: (forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PartialURL -> m PartialURL
gmapQi :: Int -> (forall d. Data d => d -> u) -> PartialURL -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PartialURL -> u
gmapQ :: (forall d. Data d => d -> u) -> PartialURL -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PartialURL -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PartialURL -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PartialURL -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PartialURL -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PartialURL -> r
gmapT :: (forall b. Data b => b -> b) -> PartialURL -> PartialURL
$cgmapT :: (forall b. Data b => b -> b) -> PartialURL -> PartialURL
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PartialURL)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PartialURL)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c PartialURL)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PartialURL)
dataTypeOf :: PartialURL -> DataType
$cdataTypeOf :: PartialURL -> DataType
toConstr :: PartialURL -> Constr
$ctoConstr :: PartialURL -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PartialURL
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PartialURL
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PartialURL -> c PartialURL
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PartialURL -> c PartialURL
$cp1Data :: Typeable PartialURL
Data, Typeable, (forall x. PartialURL -> Rep PartialURL x)
-> (forall x. Rep PartialURL x -> PartialURL) -> Generic PartialURL
forall x. Rep PartialURL x -> PartialURL
forall x. PartialURL -> Rep PartialURL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PartialURL x -> PartialURL
$cfrom :: forall x. PartialURL -> Rep PartialURL x
Generic)

makeBoomerangs ''PartialURL

partialURL :: Router () (PartialURL :- ())
partialURL :: Router () (PartialURL :- ())
partialURL =
  (  Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"login-inline"         Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rLoginInline
  Router () (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall a. Semigroup a => a -> a -> a
<> Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"login"                Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rLogin
  Router () (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall a. Semigroup a => a -> a -> a
<> Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"logout"               Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rLogout
  Router () (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall a. Semigroup a => a -> a -> a
<> Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"signup-password"      Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rSignupPassword
  Router () (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall a. Semigroup a => a -> a -> a
<> Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"change-password"      Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rChangePassword
  Router () (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall a. Semigroup a => a -> a -> a
<> Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"reset-password-form"  Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rResetPasswordForm
  Router () (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall a. Semigroup a => a -> a -> a
<> Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
"request-reset-password-form"  Boomerang TextsError [Text] (PartialURL :- ()) (PartialURL :- ())
-> Router () (PartialURL :- ()) -> Router () (PartialURL :- ())
forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Router () (PartialURL :- ())
forall tok e r. Boomerang e tok r (PartialURL :- r)
rRequestResetPasswordForm
  )

instance PathInfo PartialURL where
  fromPathSegments :: URLParser PartialURL
fromPathSegments = Router () (PartialURL :- ()) -> URLParser PartialURL
forall url.
Boomerang TextsError [Text] () (url :- ()) -> URLParser url
boomerangFromPathSegments Router () (PartialURL :- ())
partialURL
  toPathSegments :: PartialURL -> [Text]
toPathSegments   = Router () (PartialURL :- ()) -> PartialURL -> [Text]
forall url.
Boomerang TextsError [Text] () (url :- ()) -> url -> [Text]
boomerangToPathSegments   Router () (PartialURL :- ())
partialURL