1
1
mirror of https://github.com/srid/rib.git synced 2024-11-30 13:52:53 +03:00

Remove named arguments from type class

Not useful anymore
This commit is contained in:
Sridhar Ratnakumar 2019-12-29 17:47:34 -05:00
parent 521a396531
commit d71d7f83f3
4 changed files with 7 additions and 10 deletions

View File

@ -82,7 +82,7 @@ mkDocumentFrom ::
-- | Actual file path, for access and reading -- | Actual file path, for access and reading
"path" :! Path b File -> "path" :! Path b File ->
m (Document repr) m (Document repr)
mkDocumentFrom sm (arg #relpath -> k') f = do mkDocumentFrom sm (arg #relpath -> k') (Arg f) = do
v <- v <-
liftEither . first DocumentError_MarkupError liftEither . first DocumentError_MarkupError
=<< readDoc sm f =<< readDoc sm f

View File

@ -14,7 +14,6 @@ module Rib.Markup
) )
where where
import Named
import Path import Path
-- | Class for denoting Markup representations. -- | Class for denoting Markup representations.
@ -40,5 +39,5 @@ class IsMarkup repr where
MonadIO m => MonadIO m =>
SubMarkup repr -> SubMarkup repr ->
-- | Actual path to the file to parse. -- | Actual path to the file to parse.
"path" :! Path b File -> Path b File ->
m (Either Text repr) m (Either Text repr)

View File

@ -25,7 +25,6 @@ where
import Control.Foldl (Fold (..)) import Control.Foldl (Fold (..))
import Lucid (Html) import Lucid (Html)
import Named
import Path import Path
import Rib.Markup import Rib.Markup
import Text.MMark (MMark, projectYaml) import Text.MMark (MMark, projectYaml)
@ -43,7 +42,7 @@ instance IsMarkup MMark where
parseDoc () = parse "<memory>" parseDoc () = parse "<memory>"
readDoc () (Arg f) = readDoc () f =
parse (toFilePath f) <$> readFileText (toFilePath f) parse (toFilePath f) <$> readFileText (toFilePath f)
-- | Render a MMark document as HTML -- | Render a MMark document as HTML

View File

@ -30,7 +30,6 @@ where
import Control.Monad.Except import Control.Monad.Except
import Data.Aeson import Data.Aeson
import Lucid (Html, toHtmlRaw) import Lucid (Html, toHtmlRaw)
import Named
import Path import Path
import Rib.Markup import Rib.Markup
import Text.Pandoc import Text.Pandoc
@ -55,14 +54,14 @@ instance IsMarkup Pandoc where
defaultSubMarkup = PandocFormat_Markdown defaultSubMarkup = PandocFormat_Markdown
parseDoc k s = parseDoc fmt s =
first show $ runExcept $ do first show $ runExcept $ do
runPure' runPure'
$ readPandocFormat k readerSettings s $ readPandocFormat fmt readerSettings s
readDoc k (Arg f) = fmap (first show) $ runExceptT $ do readDoc fmt f = fmap (first show) $ runExceptT $ do
content <- readFileText (toFilePath f) content <- readFileText (toFilePath f)
v' <- runIO' $ readPandocFormat k readerSettings content v' <- runIO' $ readPandocFormat fmt readerSettings content
liftIO $ walkM includeSources v' liftIO $ walkM includeSources v'
where where
includeSources = includeCode $ Just $ Format "html5" includeSources = includeCode $ Just $ Format "html5"