-- | List devices
listDevices' :: DeviceManager -> STM [Text]
listDevices' dm = go Text.empty <$> readTVar (dmDevices dm)
   where
      go parent n = parent : (cs >>= f)
         where
            cs       = Map.assocs (deviceNodeChildren n)
            f (p,n') = go (Text.concat [parent, Text.pack "/", p]) n'


-- | List devices classes
listDevices' :: DeviceManager -> STM [Text]
listDevices' dm = go Text.empty <$> readTVar (dmDevices dm)
   where
      go parent n = parent : (cs >>= f)
         where
            cs       = Map.assocs (deviceNodeChildren n)
            f (p,n') = go (Text.concat [parent, Text.pack "/", p]) n'


-- | List devices classes
listDevices' dm = go Text.empty <$> readTVar (dmDevices dm)
   where
      go parent n = parent : (cs >>= f)
         where
            cs       = Map.assocs (deviceNodeChildren n)
            f (p,n') = go (Text.concat [parent, Text.pack "/", p]) n'


-- | List devices classes