on develop help sign in
Fix non-debug showNodeId
7d81287Ryan Trinkle
src/Reflex/Spider/Internal.hs+11−8
@@ -34,12 +34,6 @@ debugPropagate :: Bool
34
34
35debugInvalidateHeight :: Bool
35debugInvalidateHeight :: Bool
36
36
37−class HasNodeId a where
38− getNodeId :: a -> Int
39−
40−showNodeId :: HasNodeId a => a -> String
41−showNodeId = ("#"<>) . show . getNodeId
42−
43#ifdef DEBUG
37#ifdef DEBUG
44
38
45#define DEBUG_NODEIDS
39#define DEBUG_NODEIDS
@@ -48,6 +42,9 @@ debugPropagate = True
48
42
49debugInvalidateHeight = True
43debugInvalidateHeight = True
50
44
45+class HasNodeId a where
46+ getNodeId :: a -> Int
47+
51instance HasNodeId (Hold a) where
48instance HasNodeId (Hold a) where
52 getNodeId = holdNodeId
49 getNodeId = holdNodeId
53
50
@@ -66,14 +63,20 @@ instance HasNodeId (FanSubscribed a) where
66instance HasNodeId (CoincidenceSubscribed a) where
63instance HasNodeId (CoincidenceSubscribed a) where
67 getNodeId = coincidenceSubscribedNodeId
64 getNodeId = coincidenceSubscribedNodeId
68
65
66+instance HasNodeId (RootSubscribed a) where
67+ getNodeId = rootSubscribedNodeId
68+
69+showNodeId :: HasNodeId a => a -> String
70+showNodeId = ("#"<>) . show . getNodeId
71+
69#else
72#else
70
73
71debugPropagate = False
74debugPropagate = False
72
75
73debugInvalidateHeight = False
76debugInvalidateHeight = False
74
77
75−instance HasNodeId a where
78+showNodeId :: a -> String
76− getNodeId = const ""
79+showNodeId = const ""
77
80
78#endif
81#endif
79
82