Skip to content

Commit

Permalink
Add comment for stdlibOrFile
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman committed Oct 19, 2022
1 parent 25977ca commit 652d224
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Juvix/Data/Effect/Files.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Data.HashSet qualified as HashSet
import Juvix.Data.Effect.Files.Error
import Juvix.Extra.Stdlib qualified as Stdlib
import Juvix.Prelude.Base
import Polysemy.Law (Arbitrary1(liftArbitrary))

data Files m a where
ReadFile' :: FilePath -> Files m Text
Expand All @@ -34,6 +35,13 @@ makeLenses ''StdlibState
initState :: FilesState
initState = FilesState Nothing

-- | Try to resolve a filepath `p` to a path within standard library.
--
-- When `p` is not a member of the standard library or no stanard library is
-- registered, resolve `p` to an absolute path based at `rootPath` instead.
--
-- This function throws an error if `p` is a member of the standard library and
-- also present within `rootPath`.
stdlibOrFile ::
forall r.
Members '[Embed IO, Error FilesError] r =>
Expand Down

0 comments on commit 652d224

Please sign in to comment.