Skip to content

Instantly share code, notes, and snippets.

@jtojnar
Created August 17, 2015 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtojnar/4b1d3194614c644ec453 to your computer and use it in GitHub Desktop.
Save jtojnar/4b1d3194614c644ec453 to your computer and use it in GitHub Desktop.
menuField :: Context String
menuField = field "menu" $ \_ -> do
path <- toFilePath <$> getUnderlying
let menuPath = takeDirectory path </> "@menu.md"
unsafeCompiler (readFile menuPath) >>= renderPandoc
Couldn't match type ‘Item String’ with ‘[Char]’
Expected type: String -> Compiler String
Actual type: Item String -> Compiler (Item String)
In the second argument of ‘(>>=)’, namely ‘renderPandoc’
In a stmt of a 'do' block:
unsafeCompiler (readFile menuPath) >>= renderPandoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment