twentefp-graphs-0.1.0.3: Lab Assignments Environment at Univeriteit Twente

Safe HaskellNone
LanguageHaskell98

FPPrac.Graphs

Synopsis

Documentation

data Graph Source

Constructors

Graph 

Fields

nodes :: [Node]
 
edges :: [Edge]
 
directed :: Directed
 
weighted :: Weighted
 

Instances

data ColorG Source

Constructors

Red 
Blue 
Green 
Purple 
Grey 
Yellow 
Orange 
Black 
White 

Instances

data Thickness Source

Constructors

Thin 
Thick 

data Directed Source

Constructors

Directed 
Undirected 

Instances

data Weighted Source

Constructors

Weighted 
Unweighted 

Instances

data GraphInput Source

The input expected in a graph graphical program

type Pos = (Float, Float)

Type to express a position on the screen. It uses the format (x,y). As Canvas is used in the example implementation, remember that the lefttop corner is (0,0) and the leftbottom corner is (0, height of screen).

data MouseButton :: *

The MouseButton on the mouse.

Constructors

MLeft 
MRight 
MMiddle 

Instances

Show MouseButton 
FromJSON MouseButton

How to parse a MouseButton from a JSON formatted String.

type KeyboardButton = [Char]

Type to express how a KeyboardButton is modelled.

onNode :: [Node] -> Pos -> Maybe Node Source

Checkes to see if there is a node on a certain position

preEventloop :: (a -> GraphInput -> ([GraphOutput], a)) -> a -> IO () Source

Starting point for the library. Call this function to start the eventloop with the given handler. Takes Input and returns Output instead of the standardized Input and Output.