given two Vector and a list of strings, I generate a plot of one vector as a function of the other [1]. At each x,y point, I am trying to place the corresponding string. For the purpose, I zip3 all three sequences, define an annotation function, and invoke it with mapM_ in the context of withAnnotations [2]:
...
let annotation (x, y, label) = text (x + 2, y) (setText label)
in withAnnotations $ do mapM_ annotation $ zip3 (toList vx) (toList vy) labels
The code above compiles and runs, the plot shows, but no text annotations appear at all.
I understand that I am not using the Annote monad correctly: the mapM_ drops every returned value, so the state is not altered.
What is the correct way to invoke withAnnotations over a list of (x, y, String) ?
Needless to say, I am a beginner in Haskell. Apologies if the above is too trivial.
Thanks very much in advance.
Albert
PS: unfortunately I had sent this message to haskell-cafe; sorry!