We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
WiringTree
1 parent 175aa50 commit dec939eCopy full SHA for dec939e
stbx-core/src/Statebox/Core/WiringTree.purs
@@ -0,0 +1,16 @@
1
+module Statebox.Core.WiringTree where
2
+
3
+import Prelude
4
+import Data.Array (head)
5
+import Data.Maybe (Maybe)
6
7
+import Statebox.Core.Types (Diagram, Net, Wiring)
8
9
+data WiringTree
10
+ = Net Net
11
+ | Diagram Diagram (Array WiringTree)
12
13
+-- | This function translates a `Wiring` into a `WiringTree`
14
+-- | For the moment, we forget about diagrams and gluings and we consider only simple nets
15
+wiringToWiringTree :: Wiring -> Maybe WiringTree
16
+wiringToWiringTree wiring = Net <$> head wiring.nets
0 commit comments