From: Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: C bindings
Date: Tue, 24 Feb 2015 06:39:07 -0800 (PST) [thread overview]
Message-ID: <01aacd0c-291e-455d-9fc0-0673a904671c@googlegroups.com> (raw)
In-Reply-To: <20130630183036.GA17415-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3200 bytes --]
Hi,
I'm updating libpandoc to align with pandoc 1.13, but I'm currently having
a compilation issue that is beyond my understanding.
In
[LibPandoc/Instances.hs](https://github.com/ShabbyX/libpandoc/blob/master/src/LibPandoc/Instances.hs),
there is the following code, that had been working with pandoc 1.11:
{-# LANGUAGE TemplateHaskell #-}
module LibPandoc.Instances where
import Data.Data
import Data.DeriveTH
import Text.Pandoc
import Text.Pandoc.Shared
import Text.Highlighting.Kate.Types
$( derive makeTypeable ''ReaderOptions )
$( derive makeData ''ReaderOptions )
$( derive makeTypeable ''WriterOptions )
$( derive makeData ''WriterOptions )
...
From what I understand, `derive makeData` does some magic, so that later
one could say `deriving (Data)` for a type that contains `ReaderOptions`
and `WriterOptions`. With newer pandoc, it seems that some types were
added. With `TrackChanges` used in `ReaderOptions`, I can add similar
`derive makeTypeable/makeData` lines and everything is ok. With `MediaBag`
used in `WriterOptions` however, I can't do this.
Without `derive makeData` for `MediaBag`, I get the following error for `$(
derive makeData WriterOptions )`:
No instance for (Data MediaBag) arising from a use of `k'
Possible fix: add an instance declaration for (Data MediaBag)
In the expression:
... A VERY LONG EXPRESSION WITH A LOT OF `k` INFIX CALLS ...
If I add `$( derive makeData MediaBag)` before, I get this error on it:
Not in scope: data constructor `MediaBag'
I have `import Text.Pandoc.MediaBag`.
From what I could make out, the reason is probably that others, such as
`TrackChanges` are defined with the `data` keyword, but `MediaBag` is
defined with the `newtype` keyword. Is that so? How then, can I make `$(
derive makeData ''MediaBag)` work? If not possible, how can I make `$(
derive makeData ''WriterOptions )` work?
Thanks for the help,
Shahbaz
On Sunday, June 30, 2013 at 8:30:37 PM UTC+2, fiddlosopher wrote:
>
> Thanks for doing this. I've updated pandoc-extras.
>
> +++ Shahbaz Youssefi [Jun 30 13 13:04 ]:
> > Hi again,
> > I updated libpandoc (for C bindings) to the current version of pandoc
> > and made some improvements. I sent a pull request to toyvo, but it
> has
> > been left unanswered (he's probably not so active on github). In the
> > meantime, you could
> > [refer]([1]https://github.com/jgm/pandoc/wiki/Pandoc-Extras) to my
> fork
> > at:
> > [2]https://github.com/ShabbyX/libpandoc
> > Have a nice day,
> > Shahbaz
> >
>
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/01aacd0c-291e-455d-9fc0-0673a904671c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 5247 bytes --]
next prev parent reply other threads:[~2015-02-24 14:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 16:32 Shahbaz Youssefi
[not found] ` <cc84a902-1bc5-433f-b176-ce71dd8e3acd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2013-06-26 17:14 ` John MacFarlane
[not found] ` <20130626171432.GA1663-nFAEphtLEs+AA6luYCgp0U1S2cYJDpTV9nwVQlTi/Pw@public.gmane.org>
2013-06-28 9:23 ` Shahbaz Youssefi
[not found] ` <CALeOzZ_ypqU1fT=cBd8-JNLBeEG3RK0v2VJ1JTh3Q1FS11n6uQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-28 12:12 ` Shahbaz Youssefi
[not found] ` <CALeOzZ-Gf=QTQdWa6yb8yG3EWiOUE1kmmUHwT9Axj6aHgPhedQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-30 11:04 ` Shahbaz Youssefi
[not found] ` <CALeOzZ_BcVwuYTJwpQBSOhd9FMbU=Nu_F4=TtDeHLfNc2h3LYQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-30 18:30 ` John MacFarlane
[not found] ` <20130630183036.GA17415-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2015-02-24 14:39 ` Shahbaz Youssefi [this message]
[not found] ` <01aacd0c-291e-455d-9fc0-0673a904671c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-02-24 14:44 ` Matthew Pickering
[not found] ` <CALuQ0m_3c63CN4VLEqMM953bxi=mou4M7+rukbdo9H1=7em7sQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-24 14:51 ` Shahbaz Youssefi
[not found] ` <CALeOzZ9Ru015fD-=djS34LYOryiaCXs6NnmbBP=51L-9ZxexTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-24 15:00 ` Shahbaz Youssefi
[not found] ` <CALeOzZ9_oPFaDY0FEnLSSOVno2Ut6oq0VAK1q5gYKYZwfQmimg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-26 18:56 ` Shahbaz Youssefi
[not found] ` <CALeOzZ8xyQC6w3xadF4q7szJW7XhXwGytHuvS1oX8S_b2AzKHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-26 23:02 ` Matthew Pickering
[not found] ` <CALuQ0m980cpfsfEd2ugnwydg7jdqtdV44VLgNYhY8SX8-bpfoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-02-27 10:03 ` Shahbaz Youssefi
2021-06-02 10:23 Esteban Lorenzano
[not found] ` <058b4e30-1bcc-4b5a-be92-d47e7abf47d7n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-06-02 10:53 ` Albert Krewinkel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01aacd0c-291e-455d-9fc0-0673a904671c@googlegroups.com \
--to=shabbyx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).