pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

export more Html functions and use StateT monad transformer instead of S...

Open freiric opened this issue 11 years ago • 3 comments

...tate in order to implement Toc extending to subpage in gitit2: jgm/gitit2/issues/11 Additional exported functions: defaultWriterState, WriterState, inlineListToHtml, unordList

freiric avatar Nov 20 '14 19:11 freiric

I need this too (because I'm using @freiric 's code where he needed this.)

hazelybell avatar Apr 29 '15 20:04 hazelybell

I don't have an opinion on whether this makes sense in general, so I'll just add some technical comments:

  • Every function that's exported from a module should have a doc string.
  • Monad m implies Functor m, it is sufficient to just specify the former in type definitions.
  • Commits should be atomic and have a descriptive and short (≤ 50 chars) commit message. A good split could be to have a commit for the StateT type change and one for the additional module exports.

I'm also wondering if this generalization would have a performance impact, although I guess that it doesn't (since type State s = StateT s Identity).

tarleb avatar Oct 02 '16 21:10 tarleb

Thanks for your comments, they are very welcome. I added the doc string, and splitted the commit as you advised. I did not remove the Functor from the type definition, because I was not sure whether it is safe with GHC prior to 7.10.

freiric avatar Oct 03 '16 10:10 freiric