diagrams / diagrams-pandoc

A pandoc filter to express diagrams inline using the haskell EDSL diagrams.
BSD 3-Clause "New" or "Revised" License
37 stars 9 forks source link

Couldn't match expected type ‘V2’ #11

Closed cdupont closed 7 years ago

cdupont commented 7 years ago

I have this error:

Error while interpreting
example = square 1
<interactive>:2:1:
    Couldn't match expected type ‘V2’
                with actual type ‘V (IO (QDiagram Cairo V2 Double Any))’
    In the expression: example
    In an equation for ‘e_1’: e_1 = example
    In the expression:
        (let e_1 = example in e_1) :: IO (QDiagram Cairo V2 Double Any)

While trying to run the tests of diagrams-pandoc:

$ cd test
$ stack exec ./tests.sh 
cdupont commented 7 years ago

any update?

cdupont commented 7 years ago

Actually this is the error I have:

Error while interpreting
example = square 1 # fc aqua `atop` circle 1
<interactive>:2:1:
    No instance for (Typeable n0) arising from a use of ‘example’
    In the expression: example
    In an equation for ‘e_1’: e_1 = example
    In the expression:
        (let e_1 = example in e_1) :: IO (QDiagram Cairo V2 Double Any)
<interactive>:3:28:
    Couldn't match expected type ‘IO (QDiagram Cairo V2 Double Any)’
                with actual type ‘QDiagram b0 V2 n0 m0’
    Relevant bindings include
      e_1 :: QDiagram b0 V2 n0 m0 (bound at <interactive>:1:29)
    In the expression: e_1
    In the expression:
        (let e_1 = example in e_1) :: IO (QDiagram Cairo V2 Double Any)

with:

cdupont commented 7 years ago

Still getting this error. It's a bit blocking for me :) Steps to reproduce:

stack init --resolver lts-6.27
stack install
cd tests
echo "stack exec diagrams-pandoc" >> filter
chmod a+x filter
pandoc -t html test1.md --filter ./filter -o test1.html -s

gives:

diagrams-pandoc: /home/cdupont/.stack/snapshots/x86_64-linux/lts-6.11/7.10.3/lib/x86_64-linux-ghc-7.10.3/glib-0.13.2.2-1k0TiRm3S3u0RjZ08MH1od/libHSglib-0.13.2.2-1k0TiRm3S3u0RjZ08MH1od.a: unhandled ELF relocation(RelA) type 42

Error while interpreting
example = square 1
<interactive>:2:1:
    Couldn't match expected type ‘V2’
                with actual type ‘V (IO (QDiagram Cairo V2 Double Any))’
    In the expression: example
    In an equation for ‘e_1’: e_1 = example
    In the expression:
        (let e_1 = example in e_1) :: IO (QDiagram Cairo V2 Double Any)
byorgey commented 7 years ago

Sorry for the lack of response, I don't have any experience with diagrams-pandoc, and I haven't heard from @bergey in a while. I might try to look at it at some point, but I won't have much time over the next few weeks.

byorgey commented 7 years ago

So I am able to reproduce this, but after looking more carefully at the error message it looks like the first line is the real problem, and the subsequent stuff about "Error while interpreting..." is just a red herring. This is not a diagrams-pandoc problem but a GHC/linker problem. See https://ghc.haskell.org/trac/ghc/ticket/12147 and https://github.com/DanielG/ghc-mod/issues/762 (the latter thread has some potential workarounds if you read all the way through it).

cdupont commented 7 years ago

Thanks!