summaryrefslogtreecommitdiff
path: root/src/Grasp/Types/GNode.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-12-06 00:32:49 +1100
committerJed Barber <jjbarber@y7mail.com>2014-12-06 00:32:49 +1100
commitd3a9803cf89ea94975934dd8abb18bbc12408a7e (patch)
tree321ddb45e29a10d3dc1cd1c0ac9387d447db5afc /src/Grasp/Types/GNode.hs
parent2aa0bab498cffbc12d485d2c59f7aed04c69c409 (diff)
All newtype stubs now in their own files in their own subdir
Diffstat (limited to 'src/Grasp/Types/GNode.hs')
-rw-r--r--src/Grasp/Types/GNode.hs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Grasp/Types/GNode.hs b/src/Grasp/Types/GNode.hs
new file mode 100644
index 0000000..92c070e
--- /dev/null
+++ b/src/Grasp/Types/GNode.hs
@@ -0,0 +1,37 @@
+module Grasp.Types.GNode (
+ GNode,
+
+ mk,
+
+ toNode,
+ toInst,
+ toLNode
+ ) where
+
+
+
+
+import Grasp.Graph( Node, LNode )
+import Grasp.Types.Instruction( Instruction )
+
+
+
+
+newtype GNode = GNode (LNode Instruction)
+ deriving (Show, Eq)
+
+
+
+
+mk :: LNode Instruction -> GNode
+mk = GNode
+
+toNode :: GNode -> Node
+toNode (GNode n) = fst n
+
+toInst :: GNode -> Instruction
+toInst (GNode n) = snd n
+
+toLNode :: GNode -> LNode Instruction
+toLNode (GNode n) = n
+