module Effectful.FileSystem.Effect
  ( -- * Effect
    FileSystem

    -- ** Handlers
  , runFileSystem
  ) where

import Effectful
import Effectful.Dispatch.Static

-- | An effect for interacting with the filesystem.
data FileSystem :: Effect

type instance DispatchOf FileSystem = Static WithSideEffects
data instance StaticRep FileSystem = FileSystem

-- | Run the 'FileSystem' effect.
runFileSystem :: (HasCallStack, IOE :> es) => Eff (FileSystem : es) a -> Eff es a
runFileSystem :: forall (es :: [Effect]) a.
(HasCallStack, IOE :> es) =>
Eff (FileSystem : es) a -> Eff es a
runFileSystem = StaticRep FileSystem -> Eff (FileSystem : es) a -> Eff es a
forall (e :: Effect) (sideEffects :: SideEffects) (es :: [Effect])
       a.
(HasCallStack, DispatchOf e ~ 'Static sideEffects,
 MaybeIOE sideEffects es) =>
StaticRep e -> Eff (e : es) a -> Eff es a
evalStaticRep StaticRep FileSystem
FileSystem