Commit d269bf47 authored by locallycompact's avatar locallycompact
Browse files

Fix styling

parent 6a0c303b
Pipeline #518 passed with stages
in 16 minutes and 58 seconds
module Text.Pandoc.Dhall where
import Data.Either.Validation
import Data.Text as T
import qualified Dhall as D
import Text.Pandoc
import Data.Text as T
-- | Decode a Pandoc value.
pandocDecoder :: (ReaderOptions -> Text -> PandocPure Pandoc) -> ReaderOptions -> D.InputNormalizer -> D.Decoder Pandoc
pandocDecoder f ropts opts =
D.Decoder
{ D.extract = extractDoc
, D.expected = expectedDoc
}
where
docDecoder :: D.Decoder Text
docDecoder = D.autoWith opts
D.Decoder
{ D.extract = extractDoc,
D.expected = expectedDoc
}
where
docDecoder :: D.Decoder Text
docDecoder = D.autoWith opts
extractDoc expression =
case D.extract docDecoder expression of
Success x -> case runPure (f ropts x) of
Left exception -> D.extractError (T.pack $ show exception)
Right path -> Success path
Failure e -> Failure e
extractDoc expression =
case D.extract docDecoder expression of
Success x -> case runPure (f ropts x) of
Left exception -> D.extractError (T.pack $ show exception)
Right path -> Success path
Failure e -> Failure e
expectedDoc = D.expected docDecoder
expectedDoc = D.expected docDecoder
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment