hgeometry-ipe-0.13: Reading and Writing ipe7 files.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Ipe.PathParser

Description

Parser for a Path in Ipe.

Synopsis

Documentation

class Fractional r => Coordinate r where Source #

Represent stuff that can be used as a coordinate in ipe. (similar to show/read)

Minimal complete definition

Nothing

Methods

fromSeq :: Integer -> Maybe (Int, Integer) -> r Source #

default fromSeq :: (Ord r, Fractional r) => Integer -> Maybe (Int, Integer) -> r Source #

Instances

Instances details
Coordinate Double Source # 
Instance details

Defined in Ipe.PathParser

Coordinate Float Source # 
Instance details

Defined in Ipe.PathParser

Coordinate (Ratio Integer) Source # 
Instance details

Defined in Ipe.PathParser

Coordinate (RealNumber p) Source # 
Instance details

Defined in Ipe.PathParser

readCoordinate :: Coordinate r => Text -> Either Text r Source #

Running the parsers

Read/parse a single coordinate value.

readPoint :: Coordinate r => Text -> Either Text (Point 2 r) Source #

Read/parse a single point

readMatrix :: Coordinate r => Text -> Either Text (Matrix 3 3 r) Source #

Try to read/parse a matrix.

readRectangle :: Coordinate r => Text -> Either Text (Rectangle () r) Source #

Try to read/parse a Rectangle

runParser :: Parser a -> Text -> Either Text a Source #

Run a parser

readPathOperations :: Coordinate r => Text -> Either Text [Operation r] Source #

Parse a sequence of path operations.

pOperation :: forall r. Coordinate r => Parser (Operation r) Source #

Parse an operation