Safe Haskell | None |
---|---|
Language | Haskell2010 |
- hackerNews :: (Show a, FromJSON a) => HackerNews a -> IO a
- getStory :: StoryId -> HackerNews (Maybe Story)
- getComment :: CommentId -> HackerNews (Maybe Comment)
- getPoll :: PollId -> HackerNews (Maybe Poll)
- getPollOpt :: PollOptId -> HackerNews (Maybe PollOpt)
- getUser :: UserId -> HackerNews (Maybe User)
- getJob :: JobId -> HackerNews (Maybe Job)
- getTopStories :: HackerNews (Maybe TopStories)
- getMaxItem :: HackerNews (Maybe MaxItem)
- getUpdates :: HackerNews (Maybe Update)
- type HackerNews a = ReaderT Connection IO a
- data Comment = Comment {
- commentBy :: Text
- commentId :: CommentId
- commentKids :: Maybe [Int]
- commentParent :: Int
- commentText :: Text
- commentTime :: UTCTime
- commentType :: Text
- commentDeleted :: Bool
- newtype CommentId = CommentId Int
- data Poll = Poll {}
- newtype PollId = PollId Int
- data PollOpt = PollOpt {
- pollOptBy :: Text
- pollOptId :: PollOptId
- pollOptParent :: Int
- pollOptScore :: Int
- pollOptText :: Text
- pollOptTime :: UTCTime
- pollOptType :: Text
- pollOptDeleted :: Bool
- newtype PollOptId = PollOptId Int
- data Story = Story {}
- newtype StoryId = StoryId Int
- data User = User {
- userAbout :: Maybe Text
- userCreated :: UTCTime
- userDelay :: Int
- userId :: UserId
- userKarma :: Int
- userSubmitted :: [Int]
- userDeleted :: Bool
- newtype UserId = UserId Text
- data Job = Job {}
- newtype JobId = JobId Int
- data Update = Update {
- updateItems :: [Int]
- updateProfiles :: [Text]
- updateDeleted :: Bool
- type MaxItem = Int
- type TopStories = [Int]
Hacker News Monad
hackerNews :: (Show a, FromJSON a) => HackerNews a -> IO a Source
HackerNews API request method
API Calls
getComment :: CommentId -> HackerNews (Maybe Comment) Source
getPollOpt :: PollOptId -> HackerNews (Maybe PollOpt) Source
getTopStories :: HackerNews (Maybe TopStories) Source
Retrieve the Top Stories on Hacker News
getMaxItem :: HackerNews (Maybe MaxItem) Source
Retrieve the largest ItemId
getUpdates :: HackerNews (Maybe Update) Source
Retrieve the latest updates
Types
type HackerNews a = ReaderT Connection IO a Source
Core Type
Types
Comment | |
|
Types
PollOpt | |
|
Types
Types
Types
Types
Update | |
|
type TopStories = [Int] Source