-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Example project for rest -- @package rest-example @version 0.2.0.2 module Type.UserSignupError data UserSignupError InvalidPassword :: UserSignupError InvalidUserName :: UserSignupError instance Typeable UserSignupError instance Eq UserSignupError instance Generic UserSignupError instance Ord UserSignupError instance Show UserSignupError instance Datatype D1UserSignupError instance Constructor C1_0UserSignupError instance Constructor C1_1UserSignupError instance ToResponseCode UserSignupError instance ToJSON UserSignupError instance FromJSON UserSignupError instance JSONSchema UserSignupError instance XmlPickler UserSignupError module Api.Test.Err2 data Err Err :: Err instance Typeable Err instance Generic Err instance Show Err instance Datatype D1Err instance Constructor C1_0Err instance ToResponseCode Err instance XmlPickler Err instance JSONSchema Err instance FromJSON Err instance ToJSON Err module Type.User type Name = Text type Password = Text data User User :: Name -> Password -> User name :: User -> Name password :: User -> Password instance Typeable User instance Eq User instance Generic User instance Ord User instance Show User instance Datatype D1User instance Constructor C1_0User instance Selector S1_0_0User instance Selector S1_0_1User instance ToJSON User instance FromJSON User instance JSONSchema User instance XmlPickler User module Type.UserComment data UserComment UserComment :: User -> Text -> UserComment user :: UserComment -> User comment :: UserComment -> Text instance Typeable UserComment instance Eq UserComment instance Generic UserComment instance Ord UserComment instance Show UserComment instance Datatype D1UserComment instance Constructor C1_0UserComment instance Selector S1_0_0UserComment instance Selector S1_0_1UserComment instance ToJSON UserComment instance FromJSON UserComment instance JSONSchema UserComment instance XmlPickler UserComment module Type.UserInfo data UserInfo UserInfo :: Name -> UserInfo name :: UserInfo -> Name instance Typeable UserInfo instance Generic UserInfo instance Show UserInfo instance Datatype D1UserInfo instance Constructor C1_0UserInfo instance Selector S1_0_0UserInfo instance FromJSON UserInfo instance ToJSON UserInfo instance JSONSchema UserInfo instance XmlPickler UserInfo module Type.PostError data PostError InvalidTitle :: PostError InvalidContent :: PostError instance Typeable PostError instance Eq PostError instance Generic PostError instance Ord PostError instance Show PostError instance Datatype D1PostError instance Constructor C1_0PostError instance Constructor C1_1PostError instance ToResponseCode PostError instance ToJSON PostError instance FromJSON PostError instance JSONSchema PostError instance XmlPickler PostError module Type.Post type Id = Int type Title = Text data Post Post :: Id -> Name -> UTCTime -> Title -> Text -> Post id :: Post -> Id author :: Post -> Name createdTime :: Post -> UTCTime title :: Post -> Title content :: Post -> Text instance Typeable Post instance Eq Post instance Generic Post instance Ord Post instance Show Post instance Datatype D1Post instance Constructor C1_0Post instance Selector S1_0_0Post instance Selector S1_0_1Post instance Selector S1_0_2Post instance Selector S1_0_3Post instance Selector S1_0_4Post instance XmlPickler UTCTime instance FromJSON Post instance ToJSON Post instance JSONSchema Post instance XmlPickler Post module Type.Comment data Comment Comment :: Name -> UTCTime -> Text -> Comment author :: Comment -> Name createdTime :: Comment -> UTCTime content :: Comment -> Text instance Typeable Comment instance Eq Comment instance Generic Comment instance Ord Comment instance Show Comment instance Datatype D1Comment instance Constructor C1_0Comment instance Selector S1_0_0Comment instance Selector S1_0_1Comment instance Selector S1_0_2Comment instance ToJSON Comment instance FromJSON Comment instance JSONSchema Comment instance XmlPickler Comment module Type.CreatePost type Title = Text data CreatePost CreatePost :: Title -> Text -> CreatePost title :: CreatePost -> Title content :: CreatePost -> Text instance Typeable CreatePost instance Eq CreatePost instance Generic CreatePost instance Ord CreatePost instance Show CreatePost instance Datatype D1CreatePost instance Constructor C1_0CreatePost instance Selector S1_0_0CreatePost instance Selector S1_0_1CreatePost instance ToJSON CreatePost instance FromJSON CreatePost instance JSONSchema CreatePost instance XmlPickler CreatePost module Type.UserPost data UserPost UserPost :: User -> CreatePost -> UserPost user :: UserPost -> User post :: UserPost -> CreatePost instance Typeable UserPost instance Eq UserPost instance Generic UserPost instance Ord UserPost instance Show UserPost instance Datatype D1UserPost instance Constructor C1_0UserPost instance Selector S1_0_0UserPost instance Selector S1_0_1UserPost instance ToJSON UserPost instance FromJSON UserPost instance JSONSchema UserPost instance XmlPickler UserPost module ApiTypes data ServerData ServerData :: TVar (Set User) -> TVar (Set Post) -> TVar (HashMap Id (Set Comment)) -> ServerData users :: ServerData -> TVar (Set User) posts :: ServerData -> TVar (Set Post) comments :: ServerData -> TVar (HashMap Id (Set Comment)) newtype BlogApi a BlogApi :: ReaderT ServerData IO a -> BlogApi a unBlogApi :: BlogApi a -> ReaderT ServerData IO a runBlogApi :: ServerData -> BlogApi a -> IO a instance Applicative BlogApi instance Functor BlogApi instance Monad BlogApi instance MonadIO BlogApi instance MonadReader ServerData BlogApi module Api.Post data Identifier Latest :: Identifier ById :: Int -> Identifier -- | Post extends the root of the API with a reader containing the ways to -- identify a Post in our URLs. Currently only by the title of the post. type WithPost = ReaderT Identifier BlogApi -- | Defines the /post api end-point. resource :: Resource BlogApi WithPost Identifier () Void postFromIdentifier :: Identifier -> TVar (Set Post) -> STM (Maybe Post) instance Typeable Identifier instance Eq Identifier instance Show Identifier instance Read Identifier instance ShowUrl Identifier instance Info Identifier module Api.Post.Comment resource :: Resource WithPost WithComment Identifier () Void module Api.Test -- | User extends the root of the API with a reader containing the ways to -- identify a user in our URLs. Currently only by the user name. type WithText = ReaderT Text BlogApi data Err Err :: Err data Ok Ok :: Ok resource :: Resource BlogApi WithText Text Void Void noResponse :: Handler WithText onlyError :: Handler WithText differentFormats :: Handler WithText intersectedFormats :: Handler WithText intersectedFormats2 :: Handler WithText errorImport :: Handler WithText noError :: Handler WithText justStringO :: Handler WithText preferJson :: Handler WithText octetStreamOut :: Handler WithText onlyInput :: Handler WithText instance Typeable Err instance Typeable Ok instance Generic Err instance Show Err instance Generic Ok instance Show Ok instance Datatype D1Err instance Constructor C1_0Err instance Datatype D1Ok instance Constructor C1_0Ok instance JSONSchema Ok instance FromJSON Ok instance ToJSON Ok instance XmlPickler Ok instance ToResponseCode Err instance XmlPickler Err instance JSONSchema Err instance FromJSON Err instance ToJSON Err module Api.Test.DashedName resource :: Resource WithText WithSiteSubscription SiteId Void Void module Api.Test.ReservedName type WithText = ReaderT Text BlogApi resource :: Resource WithText WithText Text Void Void get :: Handler WithText action :: Handler WithText module Api.User -- | Defines the /user api end-point. resource :: Resource BlogApi WithUser Name () Void module Example exampleBlog :: IO ServerData -- | The API path hierarchy module Api -- | Defines a versioned api api :: Api BlogApi -- | The entire routing table for v1.0.0 of the blog blog :: Router BlogApi BlogApi