-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generate Graphviz documents from a Haskell representation. -- @package dataflow @version 0.4.2.0 module DataFlow.Core -- | An identifier corresponding to those in Graphviz. type ID = String -- | The name of a Diagram or Object. type Name = String -- | Operation heading. type Operation = String -- | Operation description. type Description = String -- | The top level diagram. data Diagram Diagram :: Name -> [Object] -> Diagram -- | An object in a diagram. data Object -- | A Input or Output in DFD. InputOutput :: ID -> Name -> Object -- | Surrounds other objects, denoting a boundary. TrustBoundary :: ID -> Name -> [Object] -> Object -- | A "Function" in DFD. Function :: ID -> Name -> Object -- | A "Database" in DFD. Database :: ID -> Name -> Object -- | Describes the flow of data between two objects. Flow :: ID -> ID -> Operation -> Description -> Object -- | The Renderer represents some output generator that runs on a -- Diagram. type Renderer t = WriterT [String] (State RendererState) t -- | Run the Renderer and get the output as a String. evalDiagram :: Renderer () -> String -- | Write a string to the output (no linefeed). write :: String -> Renderer () -- | Write a string to the output (with linefeed). writeln :: String -> Renderer () -- | Get the next "step" number (the order of flow arrows in the diagram). nextStep :: Renderer Int -- | Increase indent with 2 spaces. indent :: Renderer () -- | Decrease indent with 2 spaces. dedent :: Renderer () -- | Indent the output of gen with 2 spaces. withIndent :: Renderer () -> Renderer () -- | Write a blank line. blank :: Renderer () -- | Write a label with the output of gen as its contents. label :: Renderer () -> Renderer () -- | Write an HTML tag t with the output of gen as its contents. tag :: String -> String -> Renderer () -> Renderer () -- | Write a <b> tag surrounding the output of another -- Renderer. bold :: Renderer () -> Renderer () -- | Write a <table> tag, with attributes, surrounding the output of -- another Renderer. table :: String -> Renderer () -> Renderer () -- | Write a <tr> tag surrounding the output of another -- Renderer. tr :: Renderer () -> Renderer () -- | Write a <td> tag surrounding the output of another -- Renderer. td :: Renderer () -> Renderer () -- | The enclosing characters in a block. data Enclosing Brackets :: Enclosing CurlyBrackets :: Enclosing -- | Write an object with the given Enclosing characters, ID -- and Renderer as its contents. objectWith :: Enclosing -> ID -> Renderer () -> Renderer () -- | Write an attributes declaration for the given ID. attrs :: ID -> String -> Renderer () instance Show Object instance Eq Object module DataFlow.DFD type DFDState v = State (Map (ID, ID) Bool) v type DFDRenderer t = DFDState (Renderer t) -- | Type class for types that can be rendered as DFD. class RenderDFD t dfd :: RenderDFD t => t -> DFDRenderer () return' :: t -> DFDRenderer t exists :: (ID, ID) -> DFDState Bool register :: (ID, ID) -> DFDState () shouldInvert :: (ID, ID) -> DFDState Bool -- | Generates the DFD output as a String. evalDfd :: Diagram -> String -- | Prints the DFD output to stdout. printDfd :: Diagram -> IO () instance RenderDFD Diagram instance RenderDFD Object