Safe Haskell | None |
---|
A library for interfacing with the refheap (https:www.refheap.com) API.
- data Success
- data Error = Error String
- getPaste :: PasteID -> IO (Either Error Success)
- createPaste :: Contents -> Bool -> Language -> Maybe Auth -> IO (Either Error Success)
- deletePaste :: PasteID -> Auth -> IO (Either Error Success)
- forkPaste :: PasteID -> Auth -> IO (Either Error Success)
- editPaste :: PasteID -> Contents -> Bool -> Language -> Auth -> IO (Either Error Success)
- getHighlightedPaste :: PasteID -> IO (Either Error Success)
Documentation
Result of as successful request (either empty or a paste).
Paste | |
| |
Line String | A string was returned by the API that can't be represented as a paste. |
Empty | Operation was successful, but response is empty. |
A simple error box so I can parse refheap error messages into something useful.
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.