-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Typed directory forest -- -- Typed directory forest @package dirforest @version 0.1.0.0 -- | A directory forest of files associated with values -- -- This module is meant to be imported like this: -- --
--   import Data.DirForest (DirForest)
--   import qualified Data.DirForest as DF
--   
module Data.DirForest data DirTree a NodeFile :: a -> DirTree a NodeDir :: DirForest a -> DirTree a newtype DirForest a DirForest :: Map FilePath (DirTree a) -> DirForest a [unDirForest] :: DirForest a -> Map FilePath (DirTree a) data InsertionError a FileInTheWay :: Path Rel File -> a -> InsertionError a DirInTheWay :: Path Rel Dir -> DirForest a -> InsertionError a -- | File or Dir data FOD a F :: a -> FOD a D :: FOD a eq1DirTree :: (a -> b -> Bool) -> DirTree a -> DirTree b -> Bool ord1DirTree :: (a -> b -> Ordering) -> DirTree a -> DirTree b -> Ordering eq1DirForest :: (a -> b -> Bool) -> DirForest a -> DirForest b -> Bool ord1DirForest :: (a -> b -> Ordering) -> DirForest a -> DirForest b -> Ordering -- | True iff the forest is entirely empty null :: DirForest a -> Bool -- | True iff there are only empty directories in the directory forest nullFiles :: DirForest a -> Bool lookup :: forall a. Path Rel File -> DirForest a -> Maybe a -- | The empty forest empty :: DirForest a singletonFile :: Path Rel File -> a -> DirForest a singletonDir :: Path Rel Dir -> DirForest a insertFile :: forall a. Path Rel File -> a -> DirForest a -> Either (InsertionError a) (DirForest a) insertDir :: forall a. Path Rel Dir -> DirForest a -> Either (InsertionError a) (DirForest a) mapWithPath :: (Path Rel File -> a -> b) -> DirForest a -> DirForest b traverseWithPath :: forall a b f. Applicative f => (Path Rel File -> a -> f b) -> DirForest a -> f (DirForest b) traverseWithPath_ :: forall a b f. Applicative f => (Path Rel File -> a -> f b) -> DirForest a -> f () -- | Remove all empty directories from a DirForest -- -- This will return Nothing if the root was also empty. pruneEmptyDirs :: DirForest a -> Maybe (DirForest a) anyEmptyDir :: DirForest a -> Bool fromFileMap :: Map (Path Rel File) a -> Either (InsertionError a) (DirForest a) toFileMap :: DirForest a -> Map (Path Rel File) a fromMap :: Map FilePath (FOD a) -> Either (InsertionError a) (DirForest a) toMap :: DirForest a -> Map FilePath (FOD a) fromFileList :: [(Path Rel File, a)] -> Either (InsertionError a) (DirForest a) toFileList :: DirForest a -> [(Path Rel File, a)] read :: forall a b m. MonadIO m => Path b Dir -> (Path b File -> m a) -> m (DirForest a) readNonHidden :: forall a b m. MonadIO m => Path b Dir -> (Path b File -> m a) -> m (DirForest a) readFiltered :: forall a b m. MonadIO m => (Path b File -> Bool) -> (Path b Dir -> Bool) -> Path b Dir -> (Path b File -> m a) -> m (DirForest a) readNonHiddenFiltered :: forall a b m. MonadIO m => (Path b File -> Bool) -> (Path b Dir -> Bool) -> Path b Dir -> (Path b File -> m a) -> m (DirForest a) readOneLevel :: forall a b m. MonadIO m => Path b Dir -> (Path b File -> m a) -> m (DirForest a) readOneLevelNonHidden :: forall a b m. MonadIO m => Path b Dir -> (Path b File -> m a) -> m (DirForest a) readOneLevelFiltered :: forall a b m. MonadIO m => (Path b File -> Bool) -> (Path b Dir -> Bool) -> Path b Dir -> (Path b File -> m a) -> m (DirForest a) readOneLevelNonHiddenFiltered :: forall a b m. MonadIO m => (Path b File -> Bool) -> (Path b Dir -> Bool) -> Path b Dir -> (Path b File -> m a) -> m (DirForest a) hiddenRel :: Path Rel t -> Bool write :: forall a b. (Show a, Ord a) => Path b Dir -> DirForest a -> (Path b File -> a -> IO ()) -> IO () data InsertValidation e a InsertionErrors :: NonEmpty (InsertionError e) -> InsertValidation e a NoInsertionErrors :: a -> InsertValidation e a unpackInsertValidation :: InsertValidation e a -> Either (NonEmpty (InsertionError e)) a union :: DirForest a -> DirForest a -> InsertValidation a (DirForest a) unionWith :: (a -> a -> a) -> DirForest a -> DirForest a -> InsertValidation a (DirForest a) unionWithKey :: forall a. (Path Rel File -> a -> a -> a) -> DirForest a -> DirForest a -> InsertValidation a (DirForest a) unions :: [DirForest a] -> Either (InsertionError a) (DirForest a) intersection :: DirForest a -> DirForest b -> DirForest a intersectionWith :: (a -> b -> c) -> DirForest a -> DirForest b -> DirForest c intersectionWithKey :: forall a b c. (Path Rel File -> a -> b -> c) -> DirForest a -> DirForest b -> DirForest c intersections :: [DirForest a] -> DirForest a difference :: DirForest a -> DirForest b -> DirForest a differenceWith :: (a -> b -> Maybe a) -> DirForest a -> DirForest b -> DirForest a differenceWithKey :: forall a b. (Path Rel File -> a -> b -> Maybe a) -> DirForest a -> DirForest b -> DirForest a filter :: (a -> Bool) -> DirForest a -> DirForest a filterWithKey :: forall a. (Path Rel File -> a -> Bool) -> DirForest a -> DirForest a filterHidden :: forall a. DirForest a -> DirForest a instance Autodocodec.Class.HasCodec a => Data.Aeson.Types.ToJSON.ToJSON (Data.DirForest.DirTree a) instance Autodocodec.Class.HasCodec a => Data.Aeson.Types.FromJSON.FromJSON (Data.DirForest.DirTree a) instance GHC.Base.Functor Data.DirForest.DirTree instance GHC.Generics.Generic (Data.DirForest.DirTree a) instance GHC.Show.Show a => GHC.Show.Show (Data.DirForest.DirTree a) instance Autodocodec.Class.HasCodec a => Data.Aeson.Types.ToJSON.ToJSON (Data.DirForest.DirForest a) instance Autodocodec.Class.HasCodec a => Data.Aeson.Types.FromJSON.FromJSON (Data.DirForest.DirForest a) instance GHC.Base.Functor Data.DirForest.DirForest instance GHC.Generics.Generic (Data.DirForest.DirForest a) instance GHC.Show.Show a => GHC.Show.Show (Data.DirForest.DirForest a) instance GHC.Base.Functor Data.DirForest.FOD instance GHC.Generics.Generic (Data.DirForest.FOD a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.DirForest.FOD a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.DirForest.FOD a) instance GHC.Show.Show a => GHC.Show.Show (Data.DirForest.FOD a) instance GHC.Generics.Generic (Data.DirForest.InsertionError a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.DirForest.InsertionError a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.DirForest.InsertionError a) instance GHC.Show.Show a => GHC.Show.Show (Data.DirForest.InsertionError a) instance GHC.Base.Functor (Data.DirForest.InsertValidation e) instance GHC.Generics.Generic (Data.DirForest.InsertValidation e a) instance (GHC.Classes.Eq e, GHC.Classes.Eq a) => GHC.Classes.Eq (Data.DirForest.InsertValidation e a) instance (GHC.Show.Show e, GHC.Show.Show a) => GHC.Show.Show (Data.DirForest.InsertValidation e a) instance (Data.Validity.Validity e, Data.Validity.Validity a) => Data.Validity.Validity (Data.DirForest.InsertValidation e a) instance GHC.Base.Applicative (Data.DirForest.InsertValidation e) instance Data.Validity.Validity a => Data.Validity.Validity (Data.DirForest.InsertionError a) instance Data.Validity.Validity a => Data.Validity.Validity (Data.DirForest.FOD a) instance Data.Validity.Validity a => Data.Validity.Validity (Data.DirForest.DirTree a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.DirForest.DirTree a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.DirForest.DirTree a) instance Data.Functor.Classes.Eq1 Data.DirForest.DirTree instance Data.Functor.Classes.Ord1 Data.DirForest.DirTree instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.DirForest.DirTree a) instance Data.Foldable.Foldable Data.DirForest.DirTree instance Data.Traversable.Traversable Data.DirForest.DirTree instance Autodocodec.Class.HasCodec a => Autodocodec.Class.HasCodec (Data.DirForest.DirTree a) instance Data.Validity.Validity a => Data.Validity.Validity (Data.DirForest.DirForest a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.DirForest.DirForest a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.DirForest.DirForest a) instance Data.Functor.Classes.Eq1 Data.DirForest.DirForest instance Data.Functor.Classes.Ord1 Data.DirForest.DirForest instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.DirForest.DirForest a) instance Data.Foldable.Foldable Data.DirForest.DirForest instance Data.Traversable.Traversable Data.DirForest.DirForest instance Autodocodec.Class.HasCodec a => Autodocodec.Class.HasCodec (Data.DirForest.DirForest a)