我想做什么?
在 ghci 下打印格式和作者的关联列表。
见文档:
writers :: [(String, Writer)]
Association list of formats and writers.
什么已经尝试过
zurgl>>>import Text.Pandoc as P
zurgl>>>P.writers
<interactive>:20:1:
No instance for (Show (WriterOptions -> Pandoc -> [Char]))
arising from a use of `print'
Possible fix:
add an instance declaration for
(Show (WriterOptions -> Pandoc -> [Char]))
In a stmt of an interactive GHCi command: print it
我希望自动导入相应的节目实例,但似乎并非如此。而且我必须承认我不知道如何为 (Show (WriterOptions -> Pandoc -> [Char]) 定义实例声明。作为一种解决方法,我尝试导入 Pandoc 库的附加模块,但是仍然没有可用的 Show 实例。
那我应该自己定义这个实例吗?
如果是,您有什么提示可以与我分享以完成此任务。
如果我不应该有什么问题?
在此先感谢您的帮助。
编辑
好的,我想我看到了我的误解:
正在做 :
zurgl>>>map (\x-> fst x) P.writers
["native","json","html","html5","html+lhs","html5+lhs","s5","slidy","slideous","dzslides","docbook","opendocument","latex","latex+lhs","beamer","beamer+lhs","context","texinfo","man","markdown","markdown+lhs","plain","rst","rst+lhs","mediawiki","textile","rtf","org","asciidoc"]
我认为尝试在我的元组中显示第二个东西是没有意义的。它应该是一个函数,然后我们无法显示它。
我想这应该是问题所在。