-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Example project for rest -- @package rest-example @version 0.1.2 module Type.UserSignupError data UserSignupError InvalidPassword :: UserSignupError InvalidUserName :: UserSignupError data UserSignupError_InvalidPassword_ data UserSignupError_InvalidUserName_ type PFUserSignupError = (:+:) (C UserSignupError_InvalidPassword_ U) (C UserSignupError_InvalidUserName_ U) instance ToResponseCode UserSignupError instance ToJSON UserSignupError instance FromJSON UserSignupError instance JSONSchema UserSignupError instance XmlPickler UserSignupError instance Regular UserSignupError instance Constructor UserSignupError_InvalidUserName_ instance Constructor UserSignupError_InvalidPassword_ 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 module Api.Test.Err2 data Err Err :: Err data Err_Err_ type PFErr = C Err_Err_ U instance ToResponseCode Err instance XmlPickler Err instance JSONSchema Err instance FromJSON Err instance ToJSON Err instance Regular Err instance Constructor Err_Err_ instance Typeable Err instance Generic Err instance Show Err instance Datatype D1Err instance Constructor C1_0Err module Type.User type Name = Text type Password = Text data User User :: Name -> Password -> User name :: User -> Name password :: User -> Password data User_User_ data User_User_name_ data User_User_password_ type PFUser = C User_User_ ((:*:) (S User_User_name_ (K Name)) (S User_User_password_ (K Password))) instance ToJSON User instance FromJSON User instance JSONSchema User instance XmlPickler User instance Regular User instance Selector User_User_password_ instance Selector User_User_name_ instance Constructor User_User_ 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 module Type.UserComment data UserComment UserComment :: User -> Text -> UserComment user :: UserComment -> User comment :: UserComment -> Text data UserComment_UserComment_ data UserComment_UserComment_user_ data UserComment_UserComment_comment_ type PFUserComment = C UserComment_UserComment_ ((:*:) (S UserComment_UserComment_user_ (K User)) (S UserComment_UserComment_comment_ (K Text))) instance ToJSON UserComment instance FromJSON UserComment instance JSONSchema UserComment instance XmlPickler UserComment instance Regular UserComment instance Selector UserComment_UserComment_comment_ instance Selector UserComment_UserComment_user_ instance Constructor UserComment_UserComment_ 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 module Type.UserInfo data UserInfo UserInfo :: Name -> UserInfo name :: UserInfo -> Name data UserInfo_UserInfo_ data UserInfo_UserInfo_name_ type PFUserInfo = C UserInfo_UserInfo_ (S UserInfo_UserInfo_name_ (K Name)) instance FromJSON UserInfo instance ToJSON UserInfo instance JSONSchema UserInfo instance XmlPickler UserInfo instance Regular UserInfo instance Selector UserInfo_UserInfo_name_ instance Constructor UserInfo_UserInfo_ instance Typeable UserInfo instance Generic UserInfo instance Show UserInfo instance Datatype D1UserInfo instance Constructor C1_0UserInfo instance Selector S1_0_0UserInfo module Type.PostError data PostError InvalidTitle :: PostError InvalidContent :: PostError data PostError_InvalidTitle_ data PostError_InvalidContent_ type PFPostError = (:+:) (C PostError_InvalidTitle_ U) (C PostError_InvalidContent_ U) instance ToResponseCode PostError instance ToJSON PostError instance FromJSON PostError instance JSONSchema PostError instance XmlPickler PostError instance Regular PostError instance Constructor PostError_InvalidContent_ instance Constructor PostError_InvalidTitle_ 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 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 data Post_Post_ data Post_Post_id_ data Post_Post_author_ data Post_Post_createdTime_ data Post_Post_title_ data Post_Post_content_ type PFPost = C Post_Post_ ((:*:) (S Post_Post_id_ (K Id)) ((:*:) (S Post_Post_author_ (K Name)) ((:*:) (S Post_Post_createdTime_ (K UTCTime)) ((:*:) (S Post_Post_title_ (K Title)) (S Post_Post_content_ (K Text)))))) instance XmlPickler UTCTime instance FromJSON Post instance ToJSON Post instance JSONSchema Post instance XmlPickler Post instance Regular Post instance Selector Post_Post_content_ instance Selector Post_Post_title_ instance Selector Post_Post_createdTime_ instance Selector Post_Post_author_ instance Selector Post_Post_id_ instance Constructor Post_Post_ 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 module Type.Comment data Comment Comment :: Name -> UTCTime -> Text -> Comment author :: Comment -> Name createdTime :: Comment -> UTCTime content :: Comment -> Text instance ToJSON Comment instance FromJSON Comment instance JSONSchema Comment instance XmlPickler Comment instance Regular Comment instance Selector Comment_Comment_content_ instance Selector Comment_Comment_createdTime_ instance Selector Comment_Comment_author_ instance Constructor Comment_Comment_ 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 module Type.CreatePost type Title = Text data CreatePost CreatePost :: Title -> Text -> CreatePost title :: CreatePost -> Title content :: CreatePost -> Text data CreatePost_CreatePost_ data CreatePost_CreatePost_title_ data CreatePost_CreatePost_content_ type PFCreatePost = C CreatePost_CreatePost_ ((:*:) (S CreatePost_CreatePost_title_ (K Title)) (S CreatePost_CreatePost_content_ (K Text))) instance ToJSON CreatePost instance FromJSON CreatePost instance JSONSchema CreatePost instance XmlPickler CreatePost instance Regular CreatePost instance Selector CreatePost_CreatePost_content_ instance Selector CreatePost_CreatePost_title_ instance Constructor CreatePost_CreatePost_ 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 module Type.UserPost data UserPost UserPost :: User -> CreatePost -> UserPost user :: UserPost -> User post :: UserPost -> CreatePost data UserPost_UserPost_ data UserPost_UserPost_user_ data UserPost_UserPost_post_ type PFUserPost = C UserPost_UserPost_ ((:*:) (S UserPost_UserPost_user_ (K User)) (S UserPost_UserPost_post_ (K CreatePost))) instance ToJSON UserPost instance FromJSON UserPost instance JSONSchema UserPost instance XmlPickler UserPost instance Regular UserPost instance Selector UserPost_UserPost_post_ instance Selector UserPost_UserPost_user_ instance Constructor UserPost_UserPost_ 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 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.User -- | Defines the /user api end-point. resource :: Resource BlogApi WithUser Name () Void 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 Err_Err_ type PFErr = C Err_Err_ U data Ok Ok :: Ok data Ok_Ok_ type PFOk = C Ok_Ok_ U 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 instance JSONSchema Ok instance FromJSON Ok instance ToJSON Ok instance XmlPickler Ok instance Regular Ok instance Constructor Ok_Ok_ instance Typeable Ok instance Generic Ok instance Show Ok instance Datatype D1Ok instance Constructor C1_0Ok instance ToResponseCode Err instance XmlPickler Err instance JSONSchema Err instance FromJSON Err instance ToJSON Err instance Regular Err instance Constructor Err_Err_ instance Typeable Err instance Generic Err instance Show Err instance Datatype D1Err instance Constructor C1_0Err module Api.Test.ReservedName type WithText = ReaderT Text BlogApi resource :: Resource WithText WithText Text Void Void get :: Handler WithText action :: Handler WithText module Example exampleBlog :: IO ServerData -- | The API path hierarchy module Api -- | Defines a versioned api api :: Api BlogApi blog :: Router BlogApi BlogApi