haskheap-0.1.0: Haskell bindings to refheap.

Safe HaskellNone

Network.Haskheap

Description

A library for interfacing with the refheap (https:www.refheap.com) API.

Synopsis

Documentation

data Success Source

Result of as successful request (either empty or a paste).

Constructors

Paste 

Fields

getLines :: Integer

Lines in the paste.

getDate :: Maybe UTCTime

Time the paste was created.

getID :: PasteID

ID of the paste (may be numeric or hash or sorts).

getLanguage :: Language

The language of the paste.

getPrivate :: Bool

Whether or not the paste is Private. True is yes.

getURL :: Maybe URI

URL of the paste.

getUser :: Maybe String

User who created the paste. Nothing indicates anonymous.

getBody :: Contents

Body of the paste.

Empty

Operation was successful, but response is empty.

getPaste :: PasteID -> IO (Either Error Success)Source

Get a paste from refheap. Will return IO Nothing if the paste doesn't exist.

createPaste :: Contents -> Bool -> Language -> Maybe Auth -> IO (Either Error Success)Source

Create a new paste.

deletePaste :: PasteID -> Auth -> IO (Either Error Success)Source

Delete a paste. If it fails for some reason, will return the error message from refheap's API wrapped in Maybe, otherwise Nothing.

forkPaste :: PasteID -> Auth -> IO (Either Error Success)Source

Fork a paste.