Using 'def' in pandoc scripts

If you look at the pandoc documentation, you will see scripts written in Haskell. I just recently learned the basics of Haskell, so I'm not familiar with some of the idioms that seem to appear in these scenarios.

One of the things that I don't understand is use defin these scenarios. For example, at the top of Text.Pandoc is the following code:

 markdownToRST :: String -> String
 markdownToRST =
   (writeRST def {writerReferenceLinks = True}) . readMarkdown def

 main = getContents >>= putStrLn . markdownToRST

What does "def" do after readMarkdownand writeRST?

+4
source share
2 answers

Haskell def - , . def Data.Default.def data-default. . , . .

, hoogle API Haskell. + pandoc def def API pandoc. Text.Pandoc.Options.def. def, Default , data-default.

Default ReaderOptions, pandoc. Haskell , pandoc instance Default ReaderOptions. . ReaderOptions. instance Default ReaderOptions .

+7

Text.Pandoc.Options, Data.Default,

class Default a where
    def :: a

, , mempty from Monoid, , mappend.

+3

Source: https://habr.com/ru/post/1548685/


All Articles