Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Description : Converting data types into IpeTypes
Synopsis
- writeIpeFile :: IpeWriteText r => FilePath -> IpeFile r -> IO ()
- writeIpeFile' :: IpeWrite t => t -> FilePath -> IO ()
- writeIpePage :: IpeWriteText r => FilePath -> IpePage r -> IO ()
- toIpeXML :: IpeWrite t => t -> Maybe ByteString
- printAsIpeSelection :: IpeWrite t => t -> IO ()
- toIpeSelectionXML :: IpeWrite t => t -> Maybe ByteString
- class IpeWrite t where
- class IpeWriteText t where
- ipeWriteText :: t -> Maybe Text
- ipeWriteAttrs :: (RecordToList rs, RMap rs, ReifyConstraint IpeWriteText (Attr f) rs, AllConstrained IpeAttrName rs, RecAll (Attr f) rs IpeWriteText) => Attributes f rs -> [(Text, Text)]
- writeAttrValues :: (RMap rs, ReifyConstraint IpeWriteText f rs, RecAll f rs IpeWriteText) => Rec f rs -> Rec (Const (Maybe Text)) rs
Documentation
writeIpeFile :: IpeWriteText r => FilePath -> IpeFile r -> IO () Source #
Given a prism to convert something of type g into an ipe file, a file path, and a g. Convert the geometry and write it to file.
Write an IpeFiele to file.
writeIpeFile' :: IpeWrite t => t -> FilePath -> IO () Source #
Convert to ipe XML and write the output to a file.
writeIpePage :: IpeWriteText r => FilePath -> IpePage r -> IO () Source #
Creates a single page ipe file with the given page
printAsIpeSelection :: IpeWrite t => t -> IO () Source #
Convert the input to ipeXml, and prints it to standard out in such a way that the copied text can be pasted into ipe as a geometry object.
toIpeSelectionXML :: IpeWrite t => t -> Maybe ByteString Source #
Convert input into an ipe selection.
class IpeWrite t where Source #
Types that correspond to an XML Element. All instances should produce an
Element. If the type should produce a Node with the Text constructor, use
the IpeWriteText
typeclass instead.
Instances
class IpeWriteText t where Source #
For types that can produce a text value
ipeWriteText :: t -> Maybe Text Source #
Instances
ipeWriteAttrs :: (RecordToList rs, RMap rs, ReifyConstraint IpeWriteText (Attr f) rs, AllConstrained IpeAttrName rs, RecAll (Attr f) rs IpeWriteText) => Attributes f rs -> [(Text, Text)] Source #
Functon to write all attributes in a Rec
writeAttrValues :: (RMap rs, ReifyConstraint IpeWriteText f rs, RecAll f rs IpeWriteText) => Rec f rs -> Rec (Const (Maybe Text)) rs Source #
Writing the attribute values