language-ninja-0.2.0: A library for dealing with the Ninja build language.

CopyrightCopyright 2017 Awake Security
LicenseApache-2.0
Maintaineropensource@awakesecurity.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Ninja.Mock.ReadFile0.1.0

Description

A typeclass exposing an interface that allows reading a file from a filesystem (virtual or otherwise).

Synopsis

Documentation

class Monad m => MonadReadFile m where Source 0.1.0#

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.

Minimal complete definition

readFile

Methods

readFile :: Path -> m Text 0.1.0Source #

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

Instances

MonadReadFile IO

The obvious instance for IO.0.1.0

Methods

readFile :: Path -> IO Text Source #

(MonadTrans t, Monad (t m), MonadReadFile m) => MonadReadFile (t m)

A placeholder (undecidable) instance that allows this constraint to propagate through monad transformers without needing to lift manually.0.1.0

Methods

readFile :: Path -> t m Text Source #