I am attempting to create a set of diagrams, using the following main function:
main = mainWith [("here0", myDiagram), ("here1", myDiagram)]
and am getting the following error:
No diagram selected.
Available diagrams:
here0 here1
Any idea what this error means?
More details:
My "myDiagram" has type:
myDiagram :: Diagram B
and the program works correctly when the main function is instead:
main = mainWith myDiagram
EDIT:
Thanks for the comments. I looked at the linked command-line tutorial and attempted to follow it as closely as possible (including specifying the -s option), but am still running into the same issue. Here's exactly what I did:
Created a file "Animation.hs":
{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
main = mainWith [("myBlue", myBlue), ("myGreen", myGreen)]
myBlue :: Diagram B
myBlue = circle 1 # lw none # fc blue
myGreen :: Diagram B
myGreen = circle 1 # lw none # fc green
Compiled it via:
ghc --make Animation.hs
Displayed the available diagrams to render, with:
./Animation --list
which, as expected, returned:
Available diagrams:
myBlue myGreen
But finally, attempting to generate one of the .svg's via:
./Animation -o out.svg -w 400 -s myBlue
returned:
No diagram selected.
Available diagrams:
myBlue myGreen
I feel like there must be something simple that I'm missing but cannot seem to find it -- I am specifying a listed available diagram with "-s myBlue".