Skip to content

Commit 7d81287

Browse files
author
Ryan Trinkle
committed
Fix non-debug showNodeId
1 parent 82bb22a commit 7d81287

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/Reflex/Spider/Internal.hs

+11-8
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ debugPropagate :: Bool
3434

3535
debugInvalidateHeight :: Bool
3636

37-
class HasNodeId a where
38-
getNodeId :: a -> Int
39-
40-
showNodeId :: HasNodeId a => a -> String
41-
showNodeId = ("#"<>) . show . getNodeId
42-
4337
#ifdef DEBUG
4438

4539
#define DEBUG_NODEIDS
@@ -48,6 +42,9 @@ debugPropagate = True
4842

4943
debugInvalidateHeight = True
5044

45+
class HasNodeId a where
46+
getNodeId :: a -> Int
47+
5148
instance HasNodeId (Hold a) where
5249
getNodeId = holdNodeId
5350

@@ -66,14 +63,20 @@ instance HasNodeId (FanSubscribed a) where
6663
instance HasNodeId (CoincidenceSubscribed a) where
6764
getNodeId = coincidenceSubscribedNodeId
6865

66+
instance HasNodeId (RootSubscribed a) where
67+
getNodeId = rootSubscribedNodeId
68+
69+
showNodeId :: HasNodeId a => a -> String
70+
showNodeId = ("#"<>) . show . getNodeId
71+
6972
#else
7073

7174
debugPropagate = False
7275

7376
debugInvalidateHeight = False
7477

75-
instance HasNodeId a where
76-
getNodeId = const ""
78+
showNodeId :: a -> String
79+
showNodeId = const ""
7780

7881
#endif
7982

0 commit comments

Comments
 (0)