Closed aisamanra closed 7 years ago
I have no problem with the addition of these instances, but I'd rather just give up support for GHC < 7.2 and dispense with the CPP complications. (For one thing I don't like the API to differ depending on the compiler version.)
By the way, cheapskate's Markdown parser has some issues. Did you consider using cmark-hs? Perhaps you want to avoid C code, which is understandable.
Thanks, I merged this manually.
This is a small PR that adds a few more typeclass instances to the Cheapskate types. Unfortunately, those instances only make sense in GHC version 7.2 or later, so all these instances are guarded by CPP, and the extra dependency needed for
deepseq
is put behind a conditional in the Cabal file as well. This is some extra complexity, but still probably the simplest way of implementing these features while keeping backwards compatibility.I'd be happy to expand on the motivation for this PR, but the short high-level description is that we're using
cheapskate
in another project—in particular, in the matterhorn chat client, where we need a Markdown parser that's reasonably fast and produces compact runtime structures—and it turns out that it'd help us to be able to force evaluation of the parsed structure immediately, and this would let us usedeepseq
on that parsed structure.