@@ -411,15 +411,7 @@ watchPathsWith ::
411411 (Config -> Config)
412412 -> NonEmpty (Array Word8)
413413 -> SerialT IO Event
414−watchPathsWith f paths =
415− S.bracket before after (S.concatMapWith parallel eventStreamAggr)
416−
417− where
418−
419− before =
420− let cfg = f $ setRecursiveMode False defaultConfig
421− in return $ pathsToHandles (utf8ToStringList paths) cfg
422− after = liftIO . closePathHandleStream
414+watchPathsWith f = watchTreesWith (f . setRecursiveMode False)
423415
424416-- | Like 'watchPathsWith' but uses the 'defaultConfig' options.
425417--
@@ -432,6 +424,14 @@ watchPathsWith f paths =
432424watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
433425watchPaths = watchPathsWith id
434426
427+-- XXX
428+-- Document the path treatment for Linux/Windows/macOS modules.
429+-- Remove the utf-8 encoding requirement of paths? It can be encoding agnostic
430+-- "\" separated bytes, the application can decide what encoding to use.
431+-- Instead of always using widechar (-W) APIs can we call the underlying APIs
432+-- based on the configured code page?
433+-- https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page
434+--
435435-- | Start monitoring a list of file system paths for file system events with
436436-- the supplied configuration operation over the 'defaultConfig'. The
437437-- paths could be files or directories. When the path is a directory, the