Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Parser for a Path
in Ipe.
Synopsis
- class Fractional r => Coordinate r where
- readCoordinate :: Coordinate r => Text -> Either Text r
- readPoint :: Coordinate r => Text -> Either Text (Point 2 r)
- readMatrix :: Coordinate r => Text -> Either Text (Matrix 3 3 r)
- readRectangle :: Coordinate r => Text -> Either Text (Rectangle () r)
- runParser :: Parser a -> Text -> Either Text a
- readPathOperations :: Coordinate r => Text -> Either Text [Operation r]
- pOperation :: forall r. Coordinate r => Parser (Operation r)
- pPoint :: Coordinate r => Parser (Point 2 r)
- pCoordinate :: Coordinate r => Parser r
Documentation
class Fractional r => Coordinate r where Source #
Represent stuff that can be used as a coordinate in ipe. (similar to show/read)
Nothing
Instances
Coordinate Double Source # | |
Coordinate Float Source # | |
Coordinate (Ratio Integer) Source # | |
Coordinate (RealNumber p) Source # | |
Defined in Ipe.PathParser |
readCoordinate :: Coordinate r => Text -> Either Text r Source #
Running the parsers
Read/parse a single coordinate value.
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
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
pCoordinate :: Coordinate r => Parser r Source #