From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/12117 Path: news.gmane.org!not-for-mail From: Shahbaz Youssefi Newsgroups: gmane.text.pandoc Subject: Re: C bindings Date: Tue, 24 Feb 2015 06:39:07 -0800 (PST) Message-ID: <01aacd0c-291e-455d-9fc0-0673a904671c@googlegroups.com> References: <20130626171432.GA1663@protagoras.phil.berkeley.edu> <20130630183036.GA17415@Johns-MacBook-Pro.local> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1869_201117170.1424788747557" X-Trace: ger.gmane.org 1424788759 7419 80.91.229.3 (24 Feb 2015 14:39:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2015 14:39:19 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCROTOMZXUKRBDE2WKTQKGQEIZBLCUA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Feb 24 15:39:18 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pd0-f184.google.com ([209.85.192.184]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YQGdm-0003FB-5U for gtp-pandoc-discuss@m.gmane.org; Tue, 24 Feb 2015 15:39:15 +0100 Original-Received: by pdbfp1 with SMTP id fp1sf7131385pdb.0 for ; Tue, 24 Feb 2015 06:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=8NIWvF3gs717/1JEbbmFk1H6LjgtoKVy+dr3nVJIujY=; b=iiJ5jvUh37K+IiYc8NuIWbrs3A+qIaYvGAkPtoR0njVhs8hcs0eY/14/WN9VLdVfGW LIv5niG0zn1ZHMBRx3NY0lt0e8iZ1Jv7x2Ax6Eeh6enk16O1zZp6n4zGrCdJIhzZe0LF isNbHoJ8E1bbPmM4zdqFa2Aftlwz2ZKmhHTGQMz9MGLYk/IGrjK7XrSkqIsgC96nhCu7 GO/4m9Oql2lhJCZfLHLc5gMTQvl8Bd4T4lFu6Faa48VdRNMkTEWMovdSH48cdu2Rob09 vov+n2TazxMAEr9Ze4VLbw0Om7fdn3smHpE+Cyr8QlPJqoOkcGW50FPBZcsi0k8N215O emCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=8NIWvF3gs717/1JEbbmFk1H6LjgtoKVy+dr3nVJIujY=; b=sF4deHzss1n9TLgJ+qIkxERRqTmaRRbI3CPNW/183j3p5eeM/KeKFNay8/Z9Mb6vBX DGYwGYmtTmeA8zte1tNLuw/9h9Jg1EyrCwy+pJ/Rz8fpFtUSN/B3hwnECcBUTxkMm4uU KHElmpbXJ9iwO8hFIIprshs+xlF0Y/L4JUBl/XkJodArRI146HM4bb4AXxxXzE5NJg17 HzuZK0tbsAwiEy3mFgXLvXLuw96KWNeS5WIm0Ji82qtF4oKIyOUUiIQjXebkJEh/OXuu O1aZyP+ecDQIHkM8qvl8L5Xwj8cXBRUM6jt2q5OQCauGXSEdQtxPY6d9B3g+ZD0vaqv0 0E6A== X-Received: by 10.140.84.213 with SMTP id l79mr177860qgd.41.1424788748327; Tue, 24 Feb 2015 06:39:08 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.22.163 with SMTP id 32ls2842076qgn.48.gmail; Tue, 24 Feb 2015 06:39:07 -0800 (PST) X-Received: by 10.140.30.118 with SMTP id c109mr198403qgc.15.1424788747989; Tue, 24 Feb 2015 06:39:07 -0800 (PST) In-Reply-To: <20130630183036.GA17415-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org> X-Original-Sender: shabbyX-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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:12117 Archived-At: ------=_Part_1869_201117170.1424788747557 Content-Type: multipart/alternative; boundary="----=_Part_1870_37015812.1424788747557" ------=_Part_1870_37015812.1424788747557 Content-Type: text/plain; charset=UTF-8 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. ------=_Part_1870_37015812.1424788747557 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I'm updating libpandoc to align with pandoc 1.1= 3, but I'm currently having a compilation issue that is beyond my understan= ding.

In [LibPandoc/Instances.hs](https://github.com/ShabbyX/libpand= oc/blob/master/src/LibPandoc/Instances.hs), there is the following code, th= at had been working with pandoc 1.11:

    {-# LANGUAG= E TemplateHaskell #-}

    module LibPandoc.Instances = where

    import Data.Data
    impo= rt Data.DeriveTH
    import Text.Pandoc
  &n= bsp; import Text.Pandoc.Shared
    import Text.Highlighti= ng.Kate.Types

    $( derive makeTypeable ''ReaderOpti= ons )
    $( derive makeData ''ReaderOptions )
 &= nbsp;  $( derive makeTypeable ''WriterOptions )
    = $( derive makeData ''WriterOptions )
    ...

From = what I understand, `derive makeData` does some magic, so that later one cou= ld say `deriving (Data)` for a type that contains `ReaderOptions` and `Writ= erOptions`.  With newer pandoc, it seems that some types were added.&n= bsp; With `TrackChanges` used in `ReaderOptions`, I can add similar `derive= makeTypeable/makeData` lines and everything is ok.  With `MediaBag` u= sed in `WriterOptions` however, I can't do this.

Without `derive mak= eData` for `MediaBag`, I get the following error for `$( derive makeData Wr= iterOptions )`:

    No instance for (Data MediaBag) a= rising from a use of `k'
    Possible fix: add an instanc= e declaration for (Data MediaBag)
    In the expression:<= br>        ... A VERY LONG EXPRESSION WI= TH A LOT OF `k` INFIX CALLS ...

If I add `$( derive makeData MediaBa= g)` 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 de= fined with the `newtype` keyword.  Is that so? How then, can I make `$= ( derive makeData ''MediaBag)` work? If not possible, how can I make `$( de= rive makeData ''WriterOptions )` work?

Thanks for the help,
Shahb= az

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 v= ersion 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/ShabbyX/libpandoc
>    Have a nice day,
>    Shahbaz
>=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 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/01aacd0c-291e-455d-9fc0-0673a904671c%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1870_37015812.1424788747557-- ------=_Part_1869_201117170.1424788747557--