aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Class.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-01-25Add input and output filepaths to PandocMonad.Jesse Rosenthal1-12/+48
We'll want these in a number of places, but right now it will be necessary for the macros in T2T.
2017-01-25Add Zoned time to class.Jesse Rosenthal1-1/+15
2017-01-25Class: Add getModificationTimeJesse Rosenthal1-9/+37
This is to enable macros in T2T, but can be used for other stuff in the future, I imagine. This requires building up the info in our fake file trees. Note the version in IO is safe.
2017-01-25Working on readers.Jesse Rosenthal1-0/+10
2017-01-25Class: add setMediaBag function.Jesse Rosenthal1-0/+6
2017-01-25Add ParseError to PandocExecutionError.Jesse Rosenthal1-1/+3
This will be unified with Text.Pandoc.Error eventually. But I'm building it out here so as not to interfere with other modules that might be using the error module currently.
2017-01-25List derived instances vertically one-per-line for readability.Jesse Rosenthal1-2/+14
2017-01-25Change Test{State,Env} to Pure{State,Env}Jesse Rosenthal1-10/+10
This was left over from when the pure function was called runTest.
2017-01-25Class: Add MediaBag to MonadState.Jesse Rosenthal1-6/+18
2017-01-25Class: Add stateful IO warnings, and function to get warndings.Jesse Rosenthal1-3/+9
Right now, the io warnings both print to stderr and write to the state. That can be easily modified. We also add a getWarnings function which pulls warnings out of the state for instances of PandocMonad.
2017-01-25Deleted whitespace at end of source lines.John MacFarlane1-1/+1
2017-01-25Implement Errors in PandocMonadJesse Rosenthal1-7/+11
Errors can be thrown purely with `throwError`. At the moment there are only three kinds of errors: 1. PandocFileReadError FilePath (for problems reading a file from the filesystem) 2. PandocShouldNeverHappenError String (for stuff that should never happen but we need to pattern-match anyway) 3. PandocSomeError String (a grab bag of everything else) Of course, we need to subdivide the third item in this list.
2017-01-25Add runPure function.Jesse Rosenthal1-3/+29
This requires a default environment. The state variables are pretty straightforward. The env variables are a little trickier. I'm just making most of them empty for now. Note that some of them (like defaultReferenceDocx/ODT) will be coming out soon anyway.
2017-01-25Make PandocExecutionError an exceptionJesse Rosenthal1-6/+3
Until we fix fetchItem and fetchItem' to make use of MonadError, we have to thow an exception. We'll throw PandocFileReadError. Note that this is temporary.
2017-01-25Make opaque typeclasses PandocPure and PandocIOJesse Rosenthal1-33/+75
2017-01-25Class: Specify Functor and ApplicativeJesse Rosenthal1-1/+1
We're still compiling for 7.8 which is pre-AMP, so let's just be explicit about it so we can use applicative notation.
2017-01-25Introduce PandocMonad typeclass.Jesse Rosenthal1-0/+202
This can be instantiated by both an IO monad or a pure State monad.