From: Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: C bindings
Date: Fri, 27 Feb 2015 11:03:06 +0100 [thread overview]
Message-ID: <CALeOzZ85gD98v54g70R9Ez+jMgTg3rvtTJ6h4L+T=keupPs75w@mail.gmail.com> (raw)
In-Reply-To: <CALuQ0m980cpfsfEd2ugnwydg7jdqtdV44VLgNYhY8SX8-bpfoA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 8956 bytes --]
As far as I could figure out, it's ReaderOptions and WriterOptions that
need to be derived from Data and Typeable.
Thanks a lot!
P.S. Please let me know the commit that adds this. I'm curious to know how
you make WriterOptions derive from Data.
On Fri, Feb 27, 2015 at 12:02 AM, Matthew Pickering <
matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Could you perhaps give me a list of what we are currently missing and I
> can add them in. There's no reason for us not to derive them as they can be
> derived for all types..
>
> On Thu, Feb 26, 2015 at 6:56 PM, Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>
>> @Matthew, so is that what's going to happen? Should I just wait for the
>> next release of pandoc and those types would be derived?
>>
>> On Tue, Feb 24, 2015 at 4:00 PM, Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> wrote:
>>
>>> P.S. libpandoc derives LibPandocSettings from those types because it
>>> uses a Data.Generics.Rep.toRep function on it.
>>>
>>> On Tue, Feb 24, 2015 at 3:51 PM, Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> wrote:
>>>
>>>> I would imagine it would. I can't say I really understand what they
>>>> are, but bottom line is that [`LibPandocSettings` in the libpandoc
>>>> implementation](
>>>> https://github.com/ShabbyX/libpandoc/blob/master/src/LibPandoc/Settings.hs#L10)
>>>> contains `ReaderOptions` and `WriterOptions` and wants `deriving (Data,
>>>> Typeable)`.
>>>>
>>>> Again, I wouldn't know why `LibPandocSettings` wants to be derived from
>>>> those two types. I'll try to play around in the meantime, see if I can just
>>>> remove this requirement.
>>>>
>>>> On Tue, Feb 24, 2015 at 3:44 PM, Matthew Pickering <
>>>> matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>
>>>>> Would it just be easier if we derived Data and Typeable instances in
>>>>> pandoc?
>>>>>
>>>>> On Tue, Feb 24, 2015 at 2:39 PM, Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>> wrote:
>>>>>
>>>>>> 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
>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/01aacd0c-291e-455d-9fc0-0673a904671c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>> --
>>>>> 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/CALuQ0m_3c63CN4VLEqMM953bxi%3Dmou4M7%2Brukbdo9H1%3D7em7sQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CALuQ0m_3c63CN4VLEqMM953bxi%3Dmou4M7%2Brukbdo9H1%3D7em7sQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>
>> --
>> 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/CALeOzZ8xyQC6w3xadF4q7szJW7XhXwGytHuvS1oX8S_b2AzKHA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pandoc-discuss/CALeOzZ8xyQC6w3xadF4q7szJW7XhXwGytHuvS1oX8S_b2AzKHA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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/CALuQ0m980cpfsfEd2ugnwydg7jdqtdV44VLgNYhY8SX8-bpfoA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pandoc-discuss/CALuQ0m980cpfsfEd2ugnwydg7jdqtdV44VLgNYhY8SX8-bpfoA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CALeOzZ85gD98v54g70R9Ez%2BjMgTg3rvtTJ6h4L%2BT%3DkeupPs75w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: Type: text/html, Size: 13007 bytes --]
next prev parent reply other threads:[~2015-02-27 10:03 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
[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 [this message]
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='CALeOzZ85gD98v54g70R9Ez+jMgTg3rvtTJ6h4L+T=keupPs75w@mail.gmail.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).