HMock-0.5.1.2: A flexible mock framework for testing effectful code.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.HMock.Internal.Util

Description

Internal utilities used for HMock implementation.

Synopsis

Documentation

data Located a Source #

A value together with its source location.

Constructors

Loc (Maybe String) a 

Instances

Instances details
Functor Located Source # 
Instance details

Defined in Test.HMock.Internal.Util

Methods

fmap :: (a -> b) -> Located a -> Located b #

(<$) :: a -> Located b -> Located a #

locate :: CallStack -> a -> Located a Source #

Annotates a value with its source location from the call stack.

withLoc :: Located String -> String Source #

Formats a Located String to include its source location.

choices :: [a] -> [(a, [a])] Source #

Returns all ways to choose one element from a list, and the corresponding remaining list.