Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fails on diagrams-1.4 #15

Open
Wojocom opened this issue Jun 5, 2017 · 3 comments
Open

Test fails on diagrams-1.4 #15

Wojocom opened this issue Jun 5, 2017 · 3 comments

Comments

@Wojocom
Copy link

Wojocom commented Jun 5, 2017

pandoc -t html demo.md --filter diagrams-pandoc -o demo.html -s

gives following error message:

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)

with demo.md containing:

Here is a square :
''' {.diagram}
example = square 1
'''

Use following package versions:

  • diagrams-1.4
  • diagrams-builder-0.7.2.4
  • diagrams-cairo-1.3.1.1
  • diagrams-contrib-1.4.0.1
  • diagrams-core-1.3.0.8
  • diagrams-core-1.4
  • diagrams-lib-1.3.1.4-
  • diagrams-lib-1.4.1
  • diagrams-pandoc-0.2
  • diagrams-solve-0.1.0.1
  • diagrams-svg-1.4.1
@byorgey
Copy link
Member

byorgey commented Jun 5, 2017

Hmm. Does it work if you add a type annotation, like

Here is a square :
''' {.diagram}
example = square 1 :: Diagram B
'''

?

@Wojocom
Copy link
Author

Wojocom commented Jun 6, 2017

When I try type annotation I get this

Error while interpreting
example = square 1 :: Diagram B
/tmp/Diagram1804289383846930886.hs:11:11:
    Couldn't match type ‘V B’ with ‘V2’
    In the expression: square 1 :: Diagram B
    In an equation for ‘example’: example = square 1 :: Diagram B

Thank you for the quick response. Is there a way to have a look into /tmp/Diagram1804289383846930886.hs. It seems to get deleted.

BTW, compiling the following with GHC works:

{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts          #-}
{-# LANGUAGE TypeFamilies              #-}

import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine

 
example = square 1 :: Diagram B

main = mainWith example

@byorgey
Copy link
Member

byorgey commented Jun 6, 2017

Hmm, can you try instead doing

example = square 1 :: QDiagram Cairo V2 Double Any

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants