From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/12157 Path: news.gmane.org!not-for-mail From: Matthew Pickering Newsgroups: gmane.text.pandoc Subject: Re: C bindings Date: Thu, 26 Feb 2015 23:02:03 +0000 Message-ID: References: <20130626171432.GA1663@protagoras.phil.berkeley.edu> <20130630183036.GA17415@Johns-MacBook-Pro.local> <01aacd0c-291e-455d-9fc0-0673a904671c@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bf0d15280c2aa051005bd6d X-Trace: ger.gmane.org 1424991727 27359 80.91.229.3 (26 Feb 2015 23:02:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Feb 2015 23:02:07 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCO2LGEC4AIBB3GLX2TQKGQEPSOQYYY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 27 00:02:06 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-lb0-f188.google.com ([209.85.217.188]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YR7RV-0002TA-FQ for gtp-pandoc-discuss@m.gmane.org; Fri, 27 Feb 2015 00:02:05 +0100 Original-Received: by lbiz12 with SMTP id z12sf4177189lbi.7 for ; Thu, 26 Feb 2015 15:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=FCE1mX+x4JEloc4fcgAGIs9kY0ngsTVeVlRjRtqzz3Q=; b=XnNzaFA7XjE/utjhxKXbSvX2vMUWbmu5XjgJLpdjM9Z4XQotXV70kiimHpDG76WU9p UO79CDK0NXVoMGbIQ9RIi6DCSYNj+zELGj2oQnpuP46OTpVvk1591mtZ/wfngFrrFxoe IDy33Bx32O2p2DWydCi6NPVv2+Iubucn+aw9ecY+GPZWzkD0zol9CzhHoNoMetlTHeH3 YOLAn2MCAjBMm3yIqLAXq5yDeQdakCoZOaMVRSpA2xse889Ei6IQvaZF/OpxwrfoDVdX RUeLQzmNfwin9Op7/7QMfk/7IW8fOhlFfFjTcCmcvRvqoEHWiSOBxg7GtxdsBYY/Fr6y fCfw== X-Received: by 10.152.116.51 with SMTP id jt19mr161176lab.32.1424991725215; Thu, 26 Feb 2015 15:02:05 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.152.27.40 with SMTP id q8ls104678lag.29.gmail; Thu, 26 Feb 2015 15:02:04 -0800 (PST) X-Received: by 10.112.131.106 with SMTP id ol10mr1661391lbb.20.1424991723947; Thu, 26 Feb 2015 15:02:03 -0800 (PST) Original-Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com. [2a00:1450:400c:c00::229]) by gmr-mx.google.com with ESMTPS id r6si16590wix.0.2015.02.26.15.02.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 15:02:03 -0800 (PST) Received-SPF: pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:400c:c00::229 as permitted sender) client-ip=2a00:1450:400c:c00::229; Original-Received: by wghn12 with SMTP id n12so15637621wgh.1 for ; Thu, 26 Feb 2015 15:02:03 -0800 (PST) X-Received: by 10.194.71.98 with SMTP id t2mr22005495wju.72.1424991723764; Thu, 26 Feb 2015 15:02:03 -0800 (PST) Original-Received: by 10.194.2.174 with HTTP; Thu, 26 Feb 2015 15:02:03 -0800 (PST) In-Reply-To: X-Original-Sender: matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:400c:c00::229 as permitted sender) smtp.mail=matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:12157 Archived-At: --047d7bf0d15280c2aa051005bd6d Content-Type: text/plain; charset=UTF-8 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 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 > 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 >> 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 >>>> 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 >>>>> >>>>> . >>>>> 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 >>>> >>>> . >>>> >>>> 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 > > . > > 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. For more options, visit https://groups.google.com/d/optout. --047d7bf0d15280c2aa051005bd6d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 t= hem as they can be derived for all types..
=
On Thu, Feb 26, 2015 at 6:56 PM, Shahbaz You= ssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
@Matthew, so is that what's going to happen? Sh= ould I just wait for the next release of pandoc and those types would be de= rived?

On Tue, Feb 24, 2015 at 4:00 PM, Shahbaz Youssefi <s= habbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
P.S. libpandoc derives LibPandocSettings from those types be= cause it uses a Data.Generics.Rep.toRep function on it.
=

On Tue, Feb 24, 2= 015 at 3:51 PM, Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:<= br>
I would imagine it = would. I can't say I really understand what they are, but bottom line i= s that [`LibPandocSettings` in the libpandoc implementation](https://github.com/ShabbyX/libpandoc/blob/master/src/Li= bPandoc/Settings.hs#L10) contains `ReaderOptions` and `WriterOptions` a= nd 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 meantim= e, see if I can just remove this requirement.

On Tue, Feb 24, 2015 at 3:4= 4 PM, Matthew Pickering <matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Would it just= be easier if we derived Data and Typeable instances in pandoc?
<= div>

On Tue, Feb 2= 4, 2015 at 2:39 PM, Shahbaz Youssefi <shabbyx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wro= te:
Hi,

I'm u= pdating libpandoc to align with pandoc 1.13, but I'm currently having a= compilation issue that is beyond my understanding.

In [LibPandoc/In= stances.hs](https://github.com/ShabbyX/libpa= ndoc/blob/master/src/LibPandoc/Instances.hs), there is the following co= de, that had been working with pandoc 1.11:

=C2=A0=C2=A0=C2=A0 {-# L= ANGUAGE TemplateHaskell #-}

=C2=A0=C2=A0=C2=A0 module LibPandoc.Inst= ances where

=C2=A0=C2=A0=C2=A0 import Data.Data
=C2=A0=C2=A0=C2= =A0 import Data.DeriveTH
=C2=A0=C2=A0=C2=A0 import Text.Pandoc
=C2=A0= =C2=A0=C2=A0 import Text.Pandoc.Shared
=C2=A0=C2=A0=C2=A0 import Text.Hi= ghlighting.Kate.Types

=C2=A0=C2=A0=C2=A0 $( derive makeTypeable '= ;'ReaderOptions )
=C2=A0=C2=A0=C2=A0 $( derive makeData ''Re= aderOptions )
=C2=A0=C2=A0=C2=A0 $( derive makeTypeable ''Writer= Options )
=C2=A0=C2=A0=C2=A0 $( derive makeData ''WriterOptions = )
=C2=A0=C2=A0=C2=A0 ...

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`.=C2=A0 With newer pandoc= , it seems that some types were added.=C2=A0 With `TrackChanges` used in `R= eaderOptions`, I can add similar `derive makeTypeable/makeData` lines and e= verything is ok.=C2=A0 With `MediaBag` used in `WriterOptions` however, I c= an't do this.

Without `derive makeData` for `MediaBag`, I get th= e following error for `$( derive makeData WriterOptions )`:

=C2=A0= =C2=A0=C2=A0 No instance for (Data MediaBag) arising from a use of `k'<= br>=C2=A0=C2=A0=C2=A0 Possible fix: add an instance declaration for (Data M= ediaBag)
=C2=A0=C2=A0=C2=A0 In the expression:
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 ... A VERY LONG EXPRESSION WITH A LOT OF `k` INFIX CA= LLS ...

If I add `$( derive makeData MediaBag)` before, I get this e= rror on it:

=C2=A0=C2=A0=C2=A0 Not in scope: data constructor `Media= Bag'

I have `import Text.Pandoc.MediaBag`.

From what I co= uld make out, the reason is probably that others, such as `TrackChanges` ar= e defined with the `data` keyword, but `MediaBag` is defined with the `newt= ype` keyword.=C2=A0 Is that so? How then, can I make `$( derive makeData &#= 39;'MediaBag)` work? If not possible, how can I make `$( derive makeDat= a ''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.=C2=A0 I've u= pdated pandoc-extras.

+++ Shahbaz Youssefi [Jun 30 13 13:04 ]:
> =C2=A0 =C2=A0Hi again,
> =C2=A0 =C2=A0I updated libpandoc (for C bindings) to the current v= ersion of pandoc
> =C2=A0 =C2=A0and made some improvements. I sent a pull request to = toyvo, but it has
> =C2=A0 =C2=A0been left unanswered (he's probably not so active= on github). In the
> =C2=A0 =C2=A0meantime, you could
> =C2=A0 =C2=A0[refer]([1]https://github.com/jgm/pandoc/wiki/Pandoc-Extras) to my fork
> =C2=A0 =C2=A0at:
> =C2=A0 =C2=A0[2]https://github.com/ShabbyX/libpand= oc
> =C2=A0 =C2=A0Have a nice day,
> =C2=A0 =C2=A0Shahbaz
>=20

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https:= //groups.google.com/d/msgid/pandoc-discuss/01aacd0c-291e-455d-9fc0-0673a904= 671c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CALuQ0m_3c63C= N4VLEqMM953bxi%3Dmou4M7%2Brukbdo9H1%3D7em7sQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CALeOzZ8xyQC6w3xadF= 4q7szJW7XhXwGytHuvS1oX8S_b2AzKHA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.= google.com/d/msgid/pandoc-discuss/CALuQ0m980cpfsfEd2ugnwydg7jdqtdV44VLgNYhY= 8SX8-bpfoA%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--047d7bf0d15280c2aa051005bd6d--