File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ package Prelude(
260260
261261 primMethod , -- TODO: Needed only in PreludeBSV for vMkRWire1, should be removed.
262262 WrapField (.. ), WrapMethod (.. ), WrapPorts (.. ),
263- Port (.. ), SplitPorts (.. )
263+ Port (.. ), unPort , SplitPorts (.. )
264264 ) where
265265
266266infixr 0 $
@@ -4629,6 +4629,9 @@ class SplitPorts a p | a -> p where
46294629data Port a = Port a
46304630 deriving (FShow )
46314631
4632+ unPort :: Port a -> a
4633+ unPort (Port a) = a
4634+
46324635-- XXX if the default instance is the only one, then it gets inlined in CtxReduce
46334636-- and other instances for this class are ignored.
46344637instance SplitPorts () () where
@@ -4639,7 +4642,7 @@ instance SplitPorts () () where
46394642-- Default instance: don't split anything we don't know how to split.
46404643instance SplitPorts a (Port a ) where
46414644 splitPorts = Port
4642- unsplitPorts ( Port a) = a
4645+ unsplitPorts = unPort
46434646 portNames _ base = Cons base Nil
46444647
46454648{-
Original file line number Diff line number Diff line change @@ -92,12 +92,12 @@ class DeepSplitPorts a p | a -> p where
9292
9393instance DeepSplitPorts (UInt n ) (Port (UInt n )) where
9494 deepSplitPorts = Port
95- deepUnsplitPorts ( Port x) = x
95+ deepUnsplitPorts = unPort
9696 deepSplitPortNames _ base = Cons base Nil
9797
9898instance DeepSplitPorts (Int n ) (Port (Int n )) where
9999 deepSplitPorts = Port
100- deepUnsplitPorts ( Port x) = x
100+ deepUnsplitPorts = unPort
101101 deepSplitPortNames _ base = Cons base Nil
102102
103103instance DeepSplitPorts () () where
You can’t perform that action at this time.
0 commit comments