Diagrams/Dev/Migrate0.7
This page describes breaking API changes between diagrams 0.6 and 0.7, along with explanations of how to migrate to the new 0.7 API.
Diagrams.Coordinates
no longer exported by default
For better compatibility with lens
, the Diagrams.Coordinates
module (which contains, among other things, the (&)
operator for constructing literal points and vectors) is no longer exported from Diagrams.Prelude
. You must now import Diagrams.Coordinates
explicitly in order to make use of it.
CircleFrac
becomes Turn
CircleFrac
has been renamed Turn
(though CircleFrac
is retained as a deprecated synonym). This should really only affect you if you were using the CircleFrac
constructor; use the new Turn
constructor instead.
Trail refactoring
The single biggest breaking change is a big fundamental refactoring in the way that segments and trails work.
- Segments can now be either "closed" or "open". If you were directly dealing with segments before, you will now want to deal with "open" segments, which involves changing their type from (say)
Segment R2
toSegment Closed R2
, and wrapping the final offset vector in anOffsetClosed
constructor.
Path
s now containLocated Trail
s instead of pairs of trails and points. If you were explicitly constructing aPath
from such pairs, instead use theat
function to constructLocated Trail
s.
- The
PathLike
class has become theTrailLike
class; the newtrailLike
function takes aLocated Trail
as an argument.
For more help with converting, see the user manual or ask for help in the #diagrams IRC channel on freenode.org.