-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Library for interfacing with Reddit's API -- -- A library for interfacing with Reddit's API in Haskell. Handles -- logins, rate-limiting and converting to and from JSON responses. -- Supports most user-facing Reddit API functions, as well as some -- moderator endpoints. Check out the readme at -- https://github.com/intolerable/reddit. Contributions are -- welcome. @package reddit @version 0.2.2.2 module Reddit.Types.Error data RedditError RedditError :: Object -> RedditError FailError :: Text -> RedditError InvalidResponseError :: RedditError CaptchaError :: Text -> RedditError CredentialsError :: RedditError RateLimitError :: Integer -> Text -> RedditError NoSubredditSpecified :: RedditError NoURLSpecified :: RedditError NoName :: RedditError NoText :: Text -> RedditError AlreadySubmitted :: RedditError CommentDeleted :: RedditError LinkDeleted :: RedditError BadSubredditName :: RedditError TooManyRequests :: RedditError instance GHC.Classes.Eq Reddit.Types.Error.RedditError instance GHC.Show.Show Reddit.Types.Error.RedditError instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Error.RedditError instance Network.API.Builder.Receive.ErrorReceivable Reddit.Types.Error.RedditError module Reddit.Types.Listing data ListingType Hot :: ListingType New :: ListingType Rising :: ListingType Controversial :: ListingType Top :: ListingType data Listing t a Listing :: Maybe t -> Maybe t -> [a] -> Listing t a [before] :: Listing t a -> Maybe t [after] :: Listing t a -> Maybe t [contents] :: Listing t a -> [a] instance (GHC.Classes.Eq a, GHC.Classes.Eq t) => GHC.Classes.Eq (Reddit.Types.Listing.Listing t a) instance (GHC.Read.Read a, GHC.Read.Read t) => GHC.Read.Read (Reddit.Types.Listing.Listing t a) instance (GHC.Show.Show a, GHC.Show.Show t) => GHC.Show.Show (Reddit.Types.Listing.Listing t a) instance GHC.Classes.Eq Reddit.Types.Listing.ListingType instance GHC.Read.Read Reddit.Types.Listing.ListingType instance GHC.Show.Show Reddit.Types.Listing.ListingType instance GHC.Base.Functor (Reddit.Types.Listing.Listing t) instance GHC.Classes.Ord t => GHC.Base.Monoid (Reddit.Types.Listing.Listing t a) instance (Data.Aeson.Types.FromJSON.FromJSON t, Data.Aeson.Types.FromJSON.FromJSON a) => Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Listing.Listing t a) instance Network.API.Builder.Query.ToQuery Reddit.Types.Listing.ListingType module Reddit.Types.Options data PaginationOption a Before :: a -> PaginationOption a After :: a -> PaginationOption a data Options a Options :: Maybe (PaginationOption a) -> Maybe Int -> Options a [pagination] :: Options a -> Maybe (PaginationOption a) [limit] :: Options a -> Maybe Int before :: Options a -> Maybe a after :: Options a -> Maybe a instance GHC.Classes.Eq a => GHC.Classes.Eq (Reddit.Types.Options.Options a) instance GHC.Read.Read a => GHC.Read.Read (Reddit.Types.Options.Options a) instance GHC.Show.Show a => GHC.Show.Show (Reddit.Types.Options.Options a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Reddit.Types.Options.PaginationOption a) instance GHC.Read.Read a => GHC.Read.Read (Reddit.Types.Options.PaginationOption a) instance GHC.Show.Show a => GHC.Show.Show (Reddit.Types.Options.PaginationOption a) instance Data.Default.Class.Default (Reddit.Types.Options.Options a) module Reddit.Types.Reddit type Reddit a = RedditT IO a newtype RedditT m a RedditT :: (FreeT (RedditF m) m a) -> RedditT m a data RedditF m a [FailWith] :: APIError RedditError -> RedditF m a [Nest] :: RedditT m b -> (Either (APIError RedditError) b -> a) -> RedditF m a [NestResuming] :: RedditT m b -> (Either (APIError RedditError, Maybe (RedditT m b)) b -> a) -> RedditF m a [ReceiveRoute] :: Receivable b => Route -> (b -> a) -> RedditF m a [RunRoute] :: FromJSON b => Route -> (b -> a) -> RedditF m a [WithBaseURL] :: Text -> RedditT m b -> (b -> a) -> RedditF m a runRoute :: (FromJSON a, Monad m) => Route -> RedditT m a receiveRoute :: (Receivable a, Monad m) => Route -> RedditT m a nest :: Monad m => RedditT m a -> RedditT m (Either (APIError RedditError) a) failWith :: Monad m => APIError RedditError -> RedditT m a withBaseURL :: Monad m => Text -> RedditT m a -> RedditT m a newtype Modhash Modhash :: Text -> Modhash data LoginDetails LoginDetails :: Modhash -> CookieJar -> LoginDetails newtype POSTWrapped a POSTWrapped :: a -> POSTWrapped a type ShouldRateLimit = Bool data RateLimits RateLimits :: ShouldRateLimit -> Maybe RateLimitInfo -> RateLimits [should] :: RateLimits -> ShouldRateLimit [info] :: RateLimits -> Maybe RateLimitInfo data RateLimitInfo RateLimitInfo :: Integer -> Integer -> UTCTime -> RateLimitInfo [used] :: RateLimitInfo -> Integer [remaining] :: RateLimitInfo -> Integer [resetTime] :: RateLimitInfo -> UTCTime headersToRateLimitInfo :: ResponseHeaders -> UTCTime -> Maybe RateLimitInfo mainBaseURL :: Text loginBaseURL :: Text addAPIType :: Route -> Route instance GHC.Classes.Eq Reddit.Types.Reddit.RateLimits instance GHC.Read.Read Reddit.Types.Reddit.RateLimits instance GHC.Show.Show Reddit.Types.Reddit.RateLimits instance GHC.Classes.Eq Reddit.Types.Reddit.RateLimitInfo instance GHC.Read.Read Reddit.Types.Reddit.RateLimitInfo instance GHC.Show.Show Reddit.Types.Reddit.RateLimitInfo instance GHC.Classes.Eq a => GHC.Classes.Eq (Reddit.Types.Reddit.POSTWrapped a) instance GHC.Read.Read a => GHC.Read.Read (Reddit.Types.Reddit.POSTWrapped a) instance GHC.Show.Show a => GHC.Show.Show (Reddit.Types.Reddit.POSTWrapped a) instance GHC.Classes.Eq Reddit.Types.Reddit.LoginDetails instance GHC.Show.Show Reddit.Types.Reddit.LoginDetails instance GHC.Classes.Eq Reddit.Types.Reddit.Modhash instance GHC.Read.Read Reddit.Types.Reddit.Modhash instance GHC.Show.Show Reddit.Types.Reddit.Modhash instance GHC.Base.Monad m => GHC.Base.Monad (Reddit.Types.Reddit.RedditT m) instance GHC.Base.Monad m => GHC.Base.Applicative (Reddit.Types.Reddit.RedditT m) instance GHC.Base.Monad m => GHC.Base.Functor (Reddit.Types.Reddit.RedditT m) instance GHC.Base.Functor Reddit.Types.Reddit.POSTWrapped instance Network.API.Builder.Receive.Receivable Reddit.Types.Reddit.LoginDetails instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Reddit.Modhash instance GHC.Base.Functor (Reddit.Types.Reddit.RedditF m) instance Control.Monad.Trans.Class.MonadTrans Reddit.Types.Reddit.RedditT instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Reddit.Types.Reddit.RedditT m) module Reddit.Types.Captcha newtype CaptchaID CaptchaID :: Text -> CaptchaID withCaptcha :: Route -> (CaptchaID, Text) -> Route instance GHC.Classes.Ord Reddit.Types.Captcha.CaptchaID instance GHC.Classes.Eq Reddit.Types.Captcha.CaptchaID instance GHC.Show.Show Reddit.Types.Captcha.CaptchaID instance GHC.Read.Read Reddit.Types.Captcha.CaptchaID instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Captcha.CaptchaID instance Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Reddit.POSTWrapped Reddit.Types.Captcha.CaptchaID) module Reddit.Login -- | Make a login request with the given username and password. login :: Monad m => Text -> Text -> RedditT m LoginDetails -- | Contains Captcha-related actions. Reddit sometimes requests Captchas -- in order to prevent spambots, and you can use this module to get more -- info on them. Unfortunately the library doesn't yet support answering -- Captchas on a widespread scale, and you have to use slightly modified -- variants of other functions to convince Reddit that you aren't a -- robot. module Reddit.Actions.Captcha -- | Find out if the account currently logged in requires a captcha to be -- submitted for certain requests (like sending a private message or -- submitting a post). needsCaptcha :: Monad m => RedditT m Bool -- | Returns the ID of a captcha to be completed (the image for which can -- be found at http://reddit.com/captcha/$CAPTCHA_ID) newCaptcha :: Monad m => RedditT m CaptchaID module Reddit.Types.SearchOptions data Order Relevance :: Order New :: Order Hot :: Order Top :: Order MostComments :: Order instance GHC.Classes.Eq Reddit.Types.SearchOptions.Order instance GHC.Read.Read Reddit.Types.SearchOptions.Order instance GHC.Show.Show Reddit.Types.SearchOptions.Order instance Network.API.Builder.Query.ToQuery Reddit.Types.SearchOptions.Order module Reddit.Types.Thing class Thing a fullName :: Thing a => a -> Text module Reddit.Types.Subreddit newtype SubredditName R :: Text -> SubredditName newtype SubredditID SubredditID :: Text -> SubredditID data Subreddit Subreddit :: SubredditID -> SubredditName -> Text -> Integer -> Maybe Bool -> Subreddit [subredditID] :: Subreddit -> SubredditID [name] :: Subreddit -> SubredditName [title] :: Subreddit -> Text [subscribers] :: Subreddit -> Integer [userIsBanned] :: Subreddit -> Maybe Bool subredditPrefix :: Text instance GHC.Classes.Eq Reddit.Types.Subreddit.Subreddit instance GHC.Show.Show Reddit.Types.Subreddit.Subreddit instance GHC.Classes.Ord Reddit.Types.Subreddit.SubredditID instance GHC.Classes.Eq Reddit.Types.Subreddit.SubredditID instance GHC.Read.Read Reddit.Types.Subreddit.SubredditID instance GHC.Show.Show Reddit.Types.Subreddit.SubredditID instance GHC.Read.Read Reddit.Types.Subreddit.SubredditName instance GHC.Show.Show Reddit.Types.Subreddit.SubredditName instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Subreddit.Subreddit instance Reddit.Types.Thing.Thing Reddit.Types.Subreddit.Subreddit instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Subreddit.SubredditID instance Reddit.Types.Thing.Thing Reddit.Types.Subreddit.SubredditID instance Network.API.Builder.Query.ToQuery Reddit.Types.Subreddit.SubredditID instance GHC.Classes.Eq Reddit.Types.Subreddit.SubredditName instance GHC.Classes.Ord Reddit.Types.Subreddit.SubredditName instance Network.API.Builder.Query.ToQuery Reddit.Types.Subreddit.SubredditName instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Subreddit.SubredditName module Reddit.Types.User newtype Username Username :: Text -> Username newtype UserID UserID :: Text -> UserID data User User :: Text -> Username -> UTCTime -> Integer -> Integer -> Maybe Bool -> Maybe Bool -> Bool -> Maybe Bool -> Bool -> Bool -> Maybe Bool -> User [userID] :: User -> Text [userName] :: User -> Username [userCreated] :: User -> UTCTime [linkKarma] :: User -> Integer [commentKarma] :: User -> Integer [hasMail] :: User -> Maybe Bool [hasModMail] :: User -> Maybe Bool [isFriend] :: User -> Bool [userIsOver18] :: User -> Maybe Bool [isMod] :: User -> Bool [hasGold] :: User -> Bool [hasVerifiedEmail] :: User -> Maybe Bool newtype UserList UserList :: [Relationship] -> UserList data Relationship Relationship :: Username -> UserID -> UTCTime -> Maybe Text -> Relationship [relationUsername] :: Relationship -> Username [relationUserID] :: Relationship -> UserID [relationSince] :: Relationship -> UTCTime [relationNote] :: Relationship -> Maybe Text userPrefix :: Text instance GHC.Classes.Eq Reddit.Types.User.UserList instance GHC.Read.Read Reddit.Types.User.UserList instance GHC.Show.Show Reddit.Types.User.UserList instance GHC.Classes.Eq Reddit.Types.User.Relationship instance GHC.Read.Read Reddit.Types.User.Relationship instance GHC.Show.Show Reddit.Types.User.Relationship instance GHC.Classes.Eq Reddit.Types.User.User instance GHC.Show.Show Reddit.Types.User.User instance GHC.Classes.Ord Reddit.Types.User.UserID instance GHC.Classes.Eq Reddit.Types.User.UserID instance GHC.Read.Read Reddit.Types.User.UserID instance GHC.Show.Show Reddit.Types.User.UserID instance GHC.Classes.Ord Reddit.Types.User.Username instance GHC.Read.Read Reddit.Types.User.Username instance GHC.Show.Show Reddit.Types.User.Username instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.User.UserList instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.User.Relationship instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.User.User instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.User.UserID instance Reddit.Types.Thing.Thing Reddit.Types.User.UserID instance Network.API.Builder.Query.ToQuery Reddit.Types.User.UserID instance GHC.Classes.Eq Reddit.Types.User.Username instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.User.Username instance Network.API.Builder.Query.ToQuery Reddit.Types.User.Username module Reddit.Types.Moderation newtype BanID BanID :: Text -> BanID data Ban Ban :: Username -> UserID -> Text -> UTCTime -> Ban [username] :: Ban -> Username [userID] :: Ban -> UserID [note] :: Ban -> Text [since] :: Ban -> UTCTime banPrefix :: Text instance GHC.Classes.Eq Reddit.Types.Moderation.Ban instance GHC.Read.Read Reddit.Types.Moderation.Ban instance GHC.Show.Show Reddit.Types.Moderation.Ban instance GHC.Classes.Ord Reddit.Types.Moderation.BanID instance GHC.Classes.Eq Reddit.Types.Moderation.BanID instance GHC.Read.Read Reddit.Types.Moderation.BanID instance GHC.Show.Show Reddit.Types.Moderation.BanID instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Moderation.Ban instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Moderation.BanID instance Network.API.Builder.Query.ToQuery Reddit.Types.Moderation.BanID instance Reddit.Types.Thing.Thing Reddit.Types.Moderation.BanID module Reddit.Types.Flair data Flair Flair :: Username -> Maybe Text -> Maybe Text -> Flair [user] :: Flair -> Username [text] :: Flair -> Maybe Text [cssClass] :: Flair -> Maybe Text data FList FList :: [Flair] -> (Maybe UserID) -> (Maybe UserID) -> FList type FlairListing = Listing UserID Flair flistToListing :: FList -> FlairListing instance GHC.Classes.Eq Reddit.Types.Flair.FList instance GHC.Read.Read Reddit.Types.Flair.FList instance GHC.Show.Show Reddit.Types.Flair.FList instance GHC.Classes.Eq Reddit.Types.Flair.Flair instance GHC.Read.Read Reddit.Types.Flair.Flair instance GHC.Show.Show Reddit.Types.Flair.Flair instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Flair.FList instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Flair.Flair -- | Contains actions for handling flair on a subreddit-wise basis. module Reddit.Actions.Flair -- | Get the flair list for a subreddit. Requires moderator privileges on -- the subreddit. getFlairList :: Monad m => SubredditName -> RedditT m FlairListing -- | Get the flair list for a subreddit (with Options). Requires -- moderator privileges on the subreddit. getFlairList' :: Monad m => Options UserID -> SubredditName -> RedditT m FlairListing -- | Add link flair to the subreddit-wide template for a subreddit that you -- moderate. Requires moderator privileges on the subreddit. addLinkFlair :: Monad m => SubredditName -> Text -> Text -> Bool -> RedditT m () flairCSV :: Monad m => SubredditName -> [(Username, Text, Text)] -> RedditT m Value module Reddit.Types.Wiki newtype RevisionID RevisionID :: Text -> RevisionID data WikiPage WikiPage :: Maybe Text -> Text -> UTCTime -> Username -> Bool -> WikiPage [contentHTML] :: WikiPage -> Maybe Text [contentMarkdown] :: WikiPage -> Text [revisionDate] :: WikiPage -> UTCTime [revisedBy] :: WikiPage -> Username [canRevise] :: WikiPage -> Bool instance GHC.Classes.Eq Reddit.Types.Wiki.WikiPage instance GHC.Read.Read Reddit.Types.Wiki.WikiPage instance GHC.Show.Show Reddit.Types.Wiki.WikiPage instance GHC.Classes.Eq Reddit.Types.Wiki.RevisionID instance GHC.Read.Read Reddit.Types.Wiki.RevisionID instance GHC.Show.Show Reddit.Types.Wiki.RevisionID instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Wiki.WikiPage module Reddit.Types.SubredditSettings data SubredditSettings SubredditSettings :: Text -> Text -> Text -> ContentOptions -> Integer -> Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Bool -> Bool -> Bool -> Text -> Integer -> Integer -> WikiEditMode -> SpamFilterStrength -> SpamFilterStrength -> SpamFilterStrength -> Bool -> SubredditType -> SubredditSettings [sidebarText] :: SubredditSettings -> Text [descriptionText] :: SubredditSettings -> Text [title] :: SubredditSettings -> Text [linkType] :: SubredditSettings -> ContentOptions [hideScoreMins] :: SubredditSettings -> Integer [submitLinkLabel] :: SubredditSettings -> Maybe Text [submitTextLabel] :: SubredditSettings -> Maybe Text [domainCSS] :: SubredditSettings -> Maybe Bool [domainSidebar] :: SubredditSettings -> Maybe Bool [showMedia] :: SubredditSettings -> Bool [over18] :: SubredditSettings -> Bool [language] :: SubredditSettings -> Text [wikiEditKarma] :: SubredditSettings -> Integer [wikiEditAge] :: SubredditSettings -> Integer [wikiEditMode] :: SubredditSettings -> WikiEditMode [spamComments] :: SubredditSettings -> SpamFilterStrength [spamSelfposts] :: SubredditSettings -> SpamFilterStrength [spamLinks] :: SubredditSettings -> SpamFilterStrength [publicTrafficStats] :: SubredditSettings -> Bool [subredditType] :: SubredditSettings -> SubredditType data ContentOptions Any :: ContentOptions Link :: ContentOptions Self :: ContentOptions data SpamFilterStrength FilterLow :: SpamFilterStrength FilterHigh :: SpamFilterStrength FilterAll :: SpamFilterStrength data SubredditType Public :: SubredditType Private :: SubredditType Restricted :: SubredditType GoldRestricted :: SubredditType Archived :: SubredditType data WikiEditMode Anyone :: WikiEditMode ApprovedOnly :: WikiEditMode ModOnly :: WikiEditMode instance GHC.Classes.Eq Reddit.Types.SubredditSettings.SubredditSettings instance GHC.Read.Read Reddit.Types.SubredditSettings.SubredditSettings instance GHC.Show.Show Reddit.Types.SubredditSettings.SubredditSettings instance GHC.Classes.Eq Reddit.Types.SubredditSettings.WikiEditMode instance GHC.Read.Read Reddit.Types.SubredditSettings.WikiEditMode instance GHC.Show.Show Reddit.Types.SubredditSettings.WikiEditMode instance GHC.Classes.Eq Reddit.Types.SubredditSettings.SpamFilterStrength instance GHC.Read.Read Reddit.Types.SubredditSettings.SpamFilterStrength instance GHC.Show.Show Reddit.Types.SubredditSettings.SpamFilterStrength instance GHC.Classes.Eq Reddit.Types.SubredditSettings.ContentOptions instance GHC.Read.Read Reddit.Types.SubredditSettings.ContentOptions instance GHC.Show.Show Reddit.Types.SubredditSettings.ContentOptions instance GHC.Classes.Eq Reddit.Types.SubredditSettings.SubredditType instance GHC.Read.Read Reddit.Types.SubredditSettings.SubredditType instance GHC.Show.Show Reddit.Types.SubredditSettings.SubredditType instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.SubredditSettings.SubredditSettings instance Data.Aeson.Types.ToJSON.ToJSON Reddit.Types.SubredditSettings.SubredditSettings instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.SubredditSettings.WikiEditMode instance Data.Aeson.Types.ToJSON.ToJSON Reddit.Types.SubredditSettings.WikiEditMode instance Network.API.Builder.Query.ToQuery Reddit.Types.SubredditSettings.WikiEditMode instance Data.Default.Class.Default Reddit.Types.SubredditSettings.WikiEditMode instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.SubredditSettings.SpamFilterStrength instance Data.Aeson.Types.ToJSON.ToJSON Reddit.Types.SubredditSettings.SpamFilterStrength instance Network.API.Builder.Query.ToQuery Reddit.Types.SubredditSettings.SpamFilterStrength instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.SubredditSettings.ContentOptions instance Data.Aeson.Types.ToJSON.ToJSON Reddit.Types.SubredditSettings.ContentOptions instance Network.API.Builder.Query.ToQuery Reddit.Types.SubredditSettings.ContentOptions instance Data.Default.Class.Default Reddit.Types.SubredditSettings.ContentOptions instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.SubredditSettings.SubredditType instance Data.Aeson.Types.ToJSON.ToJSON Reddit.Types.SubredditSettings.SubredditType instance Data.Default.Class.Default Reddit.Types.SubredditSettings.SubredditType instance Network.API.Builder.Query.ToQuery Reddit.Types.SubredditSettings.SubredditType module Reddit.Types.Post newtype PostID PostID :: Text -> PostID data Post Post :: PostID -> Text -> Text -> Username -> Integer -> UTCTime -> PostContent -> Integer -> Maybe Bool -> Maybe Text -> Maybe Text -> Text -> Integer -> Bool -> SubredditName -> SubredditID -> Post [postID] :: Post -> PostID [title] :: Post -> Text [permalink] :: Post -> Text [author] :: Post -> Username [score] :: Post -> Integer [created] :: Post -> UTCTime [content] :: Post -> PostContent [commentCount] :: Post -> Integer [liked] :: Post -> Maybe Bool [flairText] :: Post -> Maybe Text [flairClass] :: Post -> Maybe Text [domain] :: Post -> Text [gilded] :: Post -> Integer [nsfw] :: Post -> Bool [subreddit] :: Post -> SubredditName [subredditID] :: Post -> SubredditID data PostContent SelfPost :: Text -> Text -> PostContent Link :: Text -> PostContent TitleOnly :: PostContent buildContent :: Bool -> Maybe Text -> Maybe Text -> Maybe Text -> PostContent type PostListing = Listing PostID Post postPrefix :: Text instance GHC.Classes.Eq Reddit.Types.Post.Post instance GHC.Read.Read Reddit.Types.Post.Post instance GHC.Show.Show Reddit.Types.Post.Post instance GHC.Classes.Eq Reddit.Types.Post.PostContent instance GHC.Read.Read Reddit.Types.Post.PostContent instance GHC.Show.Show Reddit.Types.Post.PostContent instance GHC.Classes.Ord Reddit.Types.Post.PostID instance GHC.Classes.Eq Reddit.Types.Post.PostID instance GHC.Read.Read Reddit.Types.Post.PostID instance GHC.Show.Show Reddit.Types.Post.PostID instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Post.Post instance Reddit.Types.Thing.Thing Reddit.Types.Post.Post instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Post.PostID instance Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Reddit.POSTWrapped Reddit.Types.Post.PostID) instance Reddit.Types.Thing.Thing Reddit.Types.Post.PostID instance Network.API.Builder.Query.ToQuery Reddit.Types.Post.PostID module Reddit.Actions.Search search :: Monad m => Maybe SubredditName -> Options PostID -> Order -> Text -> RedditT m PostListing luceneSearch :: Monad m => Maybe SubredditName -> Options PostID -> Order -> Text -> RedditT m PostListing cloudSearch :: Monad m => Maybe SubredditName -> Options PostID -> Order -> Text -> RedditT m PostListing module Reddit.Types.Comment newtype CommentID CommentID :: Text -> CommentID data CommentReference Reference :: Integer -> [CommentID] -> CommentReference Actual :: Comment -> CommentReference -- | isReference c returns is true if c is an actual -- comment, false otherwise isActual :: CommentReference -> Bool -- | isReference c returns is true if c is a reference, -- false otherwise isReference :: CommentReference -> Bool data Comment Comment :: CommentID -> Maybe Integer -> SubredditID -> SubredditName -> Integer -> Bool -> Username -> Maybe Text -> Maybe Text -> Text -> Text -> Listing CommentID CommentReference -> UTCTime -> Maybe UTCTime -> PostID -> Maybe CommentID -> Comment [commentID] :: Comment -> CommentID [score] :: Comment -> Maybe Integer [subredditID] :: Comment -> SubredditID [subreddit] :: Comment -> SubredditName [gilded] :: Comment -> Integer [saved] :: Comment -> Bool [author] :: Comment -> Username [authorFlairCSSClass] :: Comment -> Maybe Text [authorFlairText] :: Comment -> Maybe Text [body] :: Comment -> Text [bodyHTML] :: Comment -> Text [replies] :: Comment -> Listing CommentID CommentReference [created] :: Comment -> UTCTime [edited] :: Comment -> Maybe UTCTime [parentLink] :: Comment -> PostID [inReplyTo] :: Comment -> Maybe CommentID treeSubComments :: CommentReference -> [CommentReference] isDeleted :: Comment -> Bool data PostComments PostComments :: Post -> [CommentReference] -> PostComments type CommentListing = Listing CommentID Comment commentPrefix :: Text instance GHC.Classes.Eq Reddit.Types.Comment.PostComments instance GHC.Read.Read Reddit.Types.Comment.PostComments instance GHC.Show.Show Reddit.Types.Comment.PostComments instance GHC.Classes.Eq Reddit.Types.Comment.CommentReference instance GHC.Read.Read Reddit.Types.Comment.CommentReference instance GHC.Show.Show Reddit.Types.Comment.CommentReference instance GHC.Classes.Eq Reddit.Types.Comment.Comment instance GHC.Read.Read Reddit.Types.Comment.Comment instance GHC.Show.Show Reddit.Types.Comment.Comment instance GHC.Classes.Ord Reddit.Types.Comment.CommentID instance GHC.Classes.Eq Reddit.Types.Comment.CommentID instance GHC.Read.Read Reddit.Types.Comment.CommentID instance GHC.Show.Show Reddit.Types.Comment.CommentID instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Comment.PostComments instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Comment.CommentReference instance Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Reddit.POSTWrapped [Reddit.Types.Comment.CommentReference]) instance Reddit.Types.Thing.Thing Reddit.Types.Comment.Comment instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Comment.Comment instance Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Reddit.POSTWrapped Reddit.Types.Comment.Comment) instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Comment.CommentID instance Reddit.Types.Thing.Thing Reddit.Types.Comment.CommentID instance Network.API.Builder.Query.ToQuery Reddit.Types.Comment.CommentID instance Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Reddit.POSTWrapped Reddit.Types.Comment.CommentID) module Reddit.Types.Message data Message Message :: MessageKind -> Bool -> Username -> Maybe Username -> Text -> Text -> Text -> Listing MessageKind Message -> Message [messageID] :: Message -> MessageKind [new] :: Message -> Bool [to] :: Message -> Username [from] :: Message -> Maybe Username [subject] :: Message -> Text [body] :: Message -> Text [bodyHTML] :: Message -> Text [replies] :: Message -> Listing MessageKind Message isPrivateMessage :: Message -> Bool isCommentReply :: Message -> Bool data MessageID MessageID :: Text -> MessageID messagePrefix :: Text data MessageKind CommentMessage :: CommentID -> MessageKind PrivateMessage :: MessageID -> MessageKind instance GHC.Classes.Eq Reddit.Types.Message.Message instance GHC.Read.Read Reddit.Types.Message.Message instance GHC.Show.Show Reddit.Types.Message.Message instance GHC.Classes.Ord Reddit.Types.Message.MessageKind instance GHC.Classes.Eq Reddit.Types.Message.MessageKind instance GHC.Read.Read Reddit.Types.Message.MessageKind instance GHC.Show.Show Reddit.Types.Message.MessageKind instance GHC.Classes.Ord Reddit.Types.Message.MessageID instance GHC.Classes.Eq Reddit.Types.Message.MessageID instance GHC.Read.Read Reddit.Types.Message.MessageID instance GHC.Show.Show Reddit.Types.Message.MessageID instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Message.Message instance Reddit.Types.Thing.Thing Reddit.Types.Message.Message instance Network.API.Builder.Query.ToQuery Reddit.Types.Message.Message instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Message.MessageKind instance Reddit.Types.Thing.Thing Reddit.Types.Message.MessageKind instance Network.API.Builder.Query.ToQuery Reddit.Types.Message.MessageKind instance Data.Aeson.Types.FromJSON.FromJSON Reddit.Types.Message.MessageID instance Reddit.Types.Thing.Thing Reddit.Types.Message.MessageID instance Network.API.Builder.Query.ToQuery Reddit.Types.Message.MessageID instance Data.Aeson.Types.FromJSON.FromJSON (Reddit.Types.Reddit.POSTWrapped Reddit.Types.Message.MessageID) module Reddit.Actions.Moderation -- | Get a list of existing bans on a subreddit. User must be a moderator -- of the subreddit. bans :: Monad m => Options BanID -> SubredditName -> RedditT m (Listing BanID Ban) -- | Check to see if a user is banned from a subreddit. Logged-in user must -- be a moderator of the subreddit lookupBan :: Monad m => Username -> SubredditName -> RedditT m (Maybe Ban) getModmail :: Monad m => RedditT m (Listing MessageID Message) getModmail' :: Monad m => Options MessageID -> RedditT m (Listing MessageID Message) -- | Contains message-related actions, like retrieving your own inbox and -- sending other users private messages. module Reddit.Actions.Message -- | Get the message inbox for the current user. getInbox :: Monad m => RedditT m (Listing MessageKind Message) -- | Don't use this for watching for new messages, Reddit's ordering on | -- inbox messages is odd and not likely to work how you expect. getInbox' :: Monad m => Bool -> Options MessageKind -> RedditT m (Listing MessageKind Message) -- | Get any unread messages for the current user. getUnread :: Monad m => RedditT m (Listing MessageKind Message) -- | Get unread messages for the current user, with options. getUnread' :: Monad m => Bool -> Options MessageKind -> RedditT m (Listing MessageKind Message) -- | Mark a message as read. markRead :: (ToQuery a, Thing a, Monad m) => a -> RedditT m () -- | Send a private message to another user. sendMessage :: Monad m => Username -> Text -> Text -> RedditT m () -- | Send a private message (with a captcha). sendMessageWithCaptcha :: Monad m => Username -> Text -> Text -> CaptchaID -> Text -> RedditT m () -- | Reply to a message replyMessage :: (Monad m, Thing a) => a -> Text -> RedditT m MessageID module Reddit.Types newtype CaptchaID CaptchaID :: Text -> CaptchaID data Comment newtype CommentID CommentID :: Text -> CommentID type CommentListing = Listing CommentID Comment data Listing t a Listing :: Maybe t -> Maybe t -> [a] -> Listing t a [before] :: Listing t a -> Maybe t [after] :: Listing t a -> Maybe t [contents] :: Listing t a -> [a] data LoginDetails data Message data MessageID MessageID :: Text -> MessageID data MessageKind CommentMessage :: CommentID -> MessageKind PrivateMessage :: MessageID -> MessageKind data Modhash data Options a Options :: Maybe (PaginationOption a) -> Maybe Int -> Options a [pagination] :: Options a -> Maybe (PaginationOption a) [limit] :: Options a -> Maybe Int data PaginationOption a Before :: a -> PaginationOption a After :: a -> PaginationOption a data Post data PostContent SelfPost :: Text -> Text -> PostContent Link :: Text -> PostContent TitleOnly :: PostContent newtype PostID PostID :: Text -> PostID type PostListing = Listing PostID Post type Reddit a = RedditT IO a data RedditError RedditError :: Object -> RedditError FailError :: Text -> RedditError InvalidResponseError :: RedditError CaptchaError :: Text -> RedditError CredentialsError :: RedditError RateLimitError :: Integer -> Text -> RedditError NoSubredditSpecified :: RedditError NoURLSpecified :: RedditError NoName :: RedditError NoText :: Text -> RedditError AlreadySubmitted :: RedditError CommentDeleted :: RedditError LinkDeleted :: RedditError BadSubredditName :: RedditError TooManyRequests :: RedditError data RedditT m a data Subreddit newtype SubredditName R :: Text -> SubredditName class Thing a data User newtype Username Username :: Text -> Username -- | Contains actions which are applicable to both Posts and Comments, like -- replying, deleting and reporting. module Reddit.Actions.Thing -- | Reply to a something (a post / comment / message) reply :: (Monad m, Thing a) => a -> Text -> RedditT m CommentID -- | Delete something you created. Note that this is different to removing -- a post / comment as a moderator action. Deleting something you don't -- own won't error (but naturally won't delete anything either). delete :: (Monad m, Thing a) => a -> RedditT m () -- | Report something. report :: (Monad m, Thing a) => a -> Text -> RedditT m () -- | Contains subreddit wiki-related actions. module Reddit.Actions.Wiki -- | Get the specified wiki page on a particular subreddit. Requires -- permission to view the specified wiki page. getWikiPage :: Monad m => SubredditName -> Text -> RedditT m WikiPage -- | Edit the specified wiki page on a particular subreddit. Requires -- permission to edit the specified wiki page. editWikiPage :: Monad m => SubredditName -> Text -> Text -> Text -> RedditT m () -- | Contains actions for voting on posts and comments. There are functions -- for upvoting (upvotePost, upvoteComment), downvoting -- (downvotePost, downVoteComment) as well as removing -- votes that have already been cast (unvotePost, -- unvoteComment). -- -- Please note that automated voting (i.e. by a bot, as opposed to being -- specifically ordered to by a person) is strictly against the Reddit -- rules, and is a very effective way of getting your bot shadowbanned. module Reddit.Actions.Voting -- | Upvote a post. upvotePost :: Monad m => PostID -> RedditT m () -- | Downvote a post. downvotePost :: Monad m => PostID -> RedditT m () -- | Remove a vote from a post. unvotePost :: Monad m => PostID -> RedditT m () -- | Upvote a comment. upvoteComment :: Monad m => CommentID -> RedditT m () -- | Downvote a comment. downvoteComment :: Monad m => CommentID -> RedditT m () -- | Remove a previously-cast vote from a comment. unvoteComment :: Monad m => CommentID -> RedditT m () -- | Contains actions for interacting with a Subreddit as a whole. module Reddit.Actions.Subreddit -- | Get the info for a specific subreddit. This info includes things like -- sidebar contents, description and ID. getSubredditInfo :: Monad m => SubredditName -> RedditT m Subreddit -- | Get the settings for a subreddit that you moderate. getSubredditSettings :: Monad m => SubredditName -> RedditT m SubredditSettings -- | Modify the settings for a subreddit that you moderate. setSubredditSettings :: Monad m => SubredditID -> SubredditSettings -> RedditT m () -- | Contains user-related actions, like finding friends or retrieving a -- user's comments or information. module Reddit.Actions.User -- | Get the information Reddit exposes on user behind the specified -- username getUserInfo :: Monad m => Username -> RedditT m User -- | Get information of the currently-logged-in user. aboutMe :: Monad m => RedditT m User -- | Get the listing of comments authored by the specified user. getUserComments :: Monad m => Username -> RedditT m CommentListing -- | Get the listing of comments authored by the specified user, with -- Options. getUserComments' :: Monad m => Options CommentID -> Username -> RedditT m CommentListing -- | Get the listing of posts authored by the specified user. getUserPosts :: Monad m => Username -> RedditT m PostListing -- | Get the listing of posts authored by the specified user, with Options. getUserPosts' :: Monad m => Options PostID -> Username -> RedditT m PostListing -- | Check whether the specified username is still available or has been -- taken. isUsernameAvailable :: Monad m => Username -> RedditT m Bool -- | Get users blocked by the currently-logged-in user. getBlockedUsers :: Monad m => RedditT m [Relationship] -- | Get friends of the currently-logged-in user. getFriends :: Monad m => RedditT m [Relationship] -- | Check if a user has chosen (or been assign) user flair on a particular -- subreddit. Requires moderator privileges on the specified subreddit. lookupUserFlair :: Monad m => SubredditName -> Username -> RedditT m Flair -- | Set a user's flair on the specified subreddit. Requires moderator -- privileges on the specified subreddit. setUserFlair :: Monad m => SubredditName -> Username -> Text -> Text -> RedditT m () -- | Contains post-related actions, like submitting a post, getting -- information for an existing post, and performing moderator actions on -- posts. module Reddit.Actions.Post -- | Get a PostListing for the Hot posts on the site overall. -- This maps to http://reddit.com. getPosts :: Monad m => RedditT m PostListing -- | Get a PostListing for a specified listing. getPosts' :: Monad m => Options PostID -> ListingType -> Maybe SubredditName -> RedditT m PostListing -- | Get a post and all its comments. getPostComments :: Monad m => PostID -> RedditT m PostComments -- | Get a post and a specific sub-tree of comments. getPostSubComments :: Monad m => PostID -> CommentID -> RedditT m PostComments -- | Get the comments for a post. Ignore the actual post itself. getComments :: Monad m => PostID -> RedditT m [CommentReference] -- | Given a PostID, getPostInfo will return the full details -- for that post. getPostInfo :: Monad m => PostID -> RedditT m Post -- | Given a list of PostIDs, getPostsInfo will return -- another list containing the full details for all the posts. Note that -- Reddit's API imposes a limitation of 100 posts per request, so this -- function will fail immediately if given a list of more than 100 IDs. getPostsInfo :: Monad m => [PostID] -> RedditT m PostListing -- | Submit a new link to Reddit. submitLink :: Monad m => SubredditName -> Text -> Text -> RedditT m PostID -- | Submit a new link to Reddit (answering a Captcha to prove we aren't a -- robot). submitLinkWithCaptcha :: Monad m => SubredditName -> Text -> Text -> CaptchaID -> Text -> RedditT m PostID -- | Submit a new selfpost to Reddit. submitSelfPost :: Monad m => SubredditName -> Text -> Text -> RedditT m PostID -- | Submit a new selfpost to Reddit (answering a Captcha to prove we -- aren't a robot). submitSelfPostWithCaptcha :: Monad m => SubredditName -> Text -> Text -> CaptchaID -> Text -> RedditT m PostID -- | Set the state of inbox replies for the specified thread. setInboxReplies :: Monad m => Bool -> PostID -> RedditT m () -- | Save a post. savePost :: Monad m => PostID -> RedditT m () -- | Remove a saved post from your "saved posts" list. unsavePost :: Monad m => PostID -> RedditT m () -- | Edit the text of a self-post. editPost :: Monad m => PostID -> Text -> RedditT m () -- | Deletes one of your own posts. Note that this is different from -- removing a post as a moderator action. deletePost :: Monad m => PostID -> RedditT m () -- | Set the link flair for a post you've submitted (or any post on a -- subreddit that you moderate). setPostFlair :: Monad m => SubredditName -> PostID -> Text -> Text -> RedditT m () -- | Removes a post (as a moderator action). Note that this is different -- from deleting a post. removePost :: Monad m => PostID -> RedditT m () -- | Mark a post as spam as a moderator action. markPostSpam :: Monad m => PostID -> RedditT m () -- | Sticky a post on the subreddit on which it's posted. stickyPost :: Monad m => PostID -> Maybe Integer -> RedditT m () -- | Unsticky a post from the subreddit on which it's posted. unstickyPost :: Monad m => PostID -> Maybe Integer -> RedditT m () -- | Set the state of contest for the specified thread as a moderator -- action. setContestMode :: Monad m => Bool -> PostID -> RedditT m () -- | Contains comment-related actions, like editing comments and performing -- moderator actions on posts. module Reddit.Actions.Comment -- | Get a CommentListing for the most recent comments on the site -- overall. This maps to http://reddit.com/r/$SUBREDDIT/comments, -- or http://reddit.com/comments if the subreddit is not -- specified. Note that none of the comments returned will have any child -- comments. getNewComments :: Monad m => Maybe SubredditName -> RedditT m CommentListing -- | Get a CommentListing for the most recent comments with the -- specified Options and SubredditName. Note that none of -- the comments returned will have any child comments. If the -- Options is def, then this function is identical to -- getNewComments. getNewComments' :: Monad m => Options CommentID -> Maybe SubredditName -> RedditT m CommentListing -- | Expand children comments that weren't fetched on initial load. -- Equivalent to the web UI's "load more comments" button. getMoreChildren :: Monad m => PostID -> [CommentID] -> RedditT m [CommentReference] -- | Given a CommentID, getCommentInfo will return the full -- details for that comment. getCommentInfo :: Monad m => CommentID -> RedditT m Comment -- | Given a list of CommentIDs, getCommentsInfo will return -- another list containing the full details for all the comments. Note -- that Reddit's API imposes a limitation of 100 comments per request, so -- this function will fail immediately if given a list of more than 100 -- IDs. getCommentsInfo :: Monad m => [CommentID] -> RedditT m CommentListing -- | Edit a comment. editComment :: Monad m => CommentID -> Text -> RedditT m Comment -- | Deletes one of your own comments. Note that this is different from -- removing a comment as a moderator action. deleteComment :: Monad m => CommentID -> RedditT m () -- | Removes a comment (as a moderator action). Note that this is different -- from deleting a comment. removeComment :: Monad m => CommentID -> RedditT m () -- | All the actions that the library can perform. module Reddit.Actions -- | This module should be most of what you need to operate the library. It -- exports functionality for running built RedditT actions, as -- well as re-exporting a few helpful types from around the library. Not -- every type is exported, however, due to clashing record fields. It's -- recommended to import modules from Reddit.Types.* qualified -- so that you can use all the record fields without having to deal with -- ambiguous functions. module Reddit -- | Run a Reddit action (or a RedditT transformer action). -- This uses the default logged-in settings for RedditOptions: -- rate limiting enabled, default manager, login via username and -- password, and the default user-agent. You should change the user agent -- if you're making anything more complex than a basic script, since -- Reddit's API policy says that you should have a uniquely identifiable -- user agent. runReddit :: MonadIO m => Text -> Text -> RedditT m a -> m (Either (APIError RedditError) a) -- | Run a Reddit action (or a RedditT transformer action). -- This uses the default logged-out settings, so you won't be able to do -- anything that requires authentication (like checking messages or -- making a post). At the moment, authentication isn't statically -- checked, so it'll return a runtime error if you try to do anything you -- don't have permissions for. runRedditAnon :: MonadIO m => RedditT m a -> m (Either (APIError RedditError) a) -- | Run a Reddit or RedditT action with custom settings. You -- probably won't need this function for most things, but it's handy if -- you want to persist a connection over multiple Reddit sessions -- or use a custom user agent string. runRedditWith :: MonadIO m => RedditOptions -> RedditT m a -> m (Either (APIError RedditError) a) -- | Run a Reddit or RedditT action with custom settings. You -- probably won't need this function for most things, but it's handy if -- you want to persist a connection over multiple Reddit sessions -- or use a custom user agent string. runResumeRedditWith :: MonadIO m => RedditOptions -> RedditT m a -> m (Either (APIError RedditError, Maybe (RedditT m a)) a) interpretIO :: MonadIO m => RedditState -> RedditT m a -> m (Either (APIError RedditError, Maybe (RedditT m a)) a) -- | Options for how we should run the Reddit action. -- --