| Single mapto
deriving (Show, Eq)
-
+instance Functor HsValueMap where
+ fmap f (Single s) = Single (f s)
+ fmap f (Tuple maps) = Tuple (fmap (fmap f) maps)
-- | Creates a HsValueMap with the same structure as the given type, using the
-- given function for mapping the single types.
type SignalDefMap = HsValueMap SignalDef
useMapToDefMap :: SignalUseMap -> SignalDefMap
-useMapToDefMap (Single (SignalUse u)) = Single (SignalDef u)
-useMapToDefMap (Tuple uses) = Tuple (map useMapToDefMap uses)
+useMapToDefMap = fmap (\(SignalUse u) -> SignalDef u)
type SignalId = Int
data SignalUse = SignalUse {