Skip to content

Commit dec939e

Browse files
committed
[#328] [stbx-core] start defining WiringTree data structure
1 parent 175aa50 commit dec939e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)