Copyright | Copyright 2017 Awake Security |
---|---|
License | Apache-2.0 |
Maintainer | opensource@awakesecurity.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Typeclasses that allow mocking via dependency injection (i.e.: free monads
or similar techniques) in language-ninja
.
This module re-exports all of the modules under the Language.Ninja.Mock namespace for convenience.
It is recommended that you import it with the following style:
import qualified Language.Ninja.Mock as Mock
Since: 0.1.0
- class Monad m => MonadReadFile m where
Language.Ninja.Mock.ReadFile
class Monad m => MonadReadFile m where Source #
This typeclass allows you to write code that reads files from the filesystem and then later run that code purely against a virtual filesystem of some description.
Since: 0.1.0
readFile :: Path -> m Text Source #
Read the file located at the given path and decode it into Text
.
TODO: some notion of error handling should be encoded into the type
Since: 0.1.0
MonadReadFile IO Source # | The obvious instance for Since: 0.1.0 |
(MonadTrans t, Monad (t m), MonadReadFile m) => MonadReadFile (t m) Source # | A placeholder (undecidable) instance that allows this constraint to
propagate through monad transformers without needing to Since: 0.1.0 |