module Reddit.Actions.Thing
( Reddit.Actions.Thing.reply
, Reddit.Actions.Thing.delete
, Reddit.Actions.Thing.report ) where
import Reddit.Types
import Reddit.Types.Empty
import Reddit.Types.Reddit
import qualified Reddit.Routes.Thing as Route
import Data.Text (Text)
reply :: (Monad m, Thing a)
=> a
-> Text
-> RedditT m CommentID
reply :: a -> Text -> RedditT m CommentID
reply a
t Text
b = do
POSTWrapped CommentID
res <- Route -> RedditT m (POSTWrapped CommentID)
forall a (m :: * -> *).
(FromJSON a, Monad m) =>
Route -> RedditT m a
runRoute (Route -> RedditT m (POSTWrapped CommentID))
-> Route -> RedditT m (POSTWrapped CommentID)
forall a b. (a -> b) -> a -> b
$ a -> Text -> Route
forall a. Thing a => a -> Text -> Route
Route.reply a
t Text
b
CommentID -> RedditT m CommentID
forall (m :: * -> *) a. Monad m => a -> m a
return CommentID
res
delete :: (Monad m, Thing a)
=> a
-> RedditT m ()
delete :: a -> RedditT m ()
delete = RedditT m Empty -> RedditT m ()
forall (m :: * -> *). Monad m => m Empty -> m ()
nothing (RedditT m Empty -> RedditT m ())
-> (a -> RedditT m Empty) -> a -> RedditT m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Route -> RedditT m Empty
forall a (m :: * -> *).
(FromJSON a, Monad m) =>
Route -> RedditT m a
runRoute (Route -> RedditT m Empty) -> (a -> Route) -> a -> RedditT m Empty
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Route
forall a. Thing a => a -> Route
Route.delete
report :: (Monad m, Thing a)
=> a
-> Text
-> RedditT m ()
report :: a -> Text -> RedditT m ()
report a
t Text
r = RedditT m Empty -> RedditT m ()
forall (m :: * -> *). Monad m => m Empty -> m ()
nothing (RedditT m Empty -> RedditT m ())
-> RedditT m Empty -> RedditT m ()
forall a b. (a -> b) -> a -> b
$ Route -> RedditT m Empty
forall a (m :: * -> *).
(FromJSON a, Monad m) =>
Route -> RedditT m a
runRoute (Route -> RedditT m Empty) -> Route -> RedditT m Empty
forall a b. (a -> b) -> a -> b
$ a -> Text -> Route
forall a. Thing a => a -> Text -> Route
Route.report a
t Text
r