loc-test-0.1.1.0: Test-related utilities related to the /loc/ package.

Safe HaskellNone
LanguageHaskell2010

Test.Loc.Hedgehog.Gen

Contents

Description

Hedgehog generators for types defined in the loc package.

Synopsis

Line

line Source #

Arguments

:: Monad m 
=> Bounds Line

Minimum and maximum line number

-> Gen m Line 

line a b generates a line number on the linear range a to b.

line' :: Monad m => Gen m Line Source #

Generates a line number within the default bounds (1, defMaxLine).

defMaxLine :: Line Source #

The default maximum line: 99.

Column

column Source #

Arguments

:: Monad m 
=> Bounds Column

Minimum and maximum column number

-> Gen m Column 

column a b generates a column number on the linear range a to b.

column' :: Monad m => Gen m Column Source #

Generates a column number within the default bounds (1, defMaxColumn).

defMaxColumn :: Column Source #

The default maximum column number: 99.

Loc

loc Source #

Arguments

:: Monad m 
=> Bounds Line

Minimum and maximum line number

-> Bounds Column

Minimum and maximum column number

-> Gen m Loc 

loc lineBounds columnBounds generates a Loc with the line number bounded by lineBounds and column number bounded by columnBounds.

loc' :: Monad m => Gen m Loc Source #

Generates a Loc within the default line and column bounds.

Span

span Source #

Arguments

:: Monad m 
=> Bounds Line

Minimum and maximum line number

-> Bounds Column

Minimum and maximum column number

-> Gen m Span 

span lineBounds columnBounds generates a Span with start and end positions whose line numbers are bounded by lineBounds and whose column numbers are bounded by columnBounds.

span' :: Monad m => Gen m Span Source #

Generates a Span with start and end positions within the default line and column bounds.

Area

area Source #

Arguments

:: Monad m 
=> Bounds Line

Minimum and maximum line number

-> Bounds Column

Minimum and maximum column number

-> Gen m Area 

area lineBounds columnBounds generates an Area consisting of Spans with start and end positions whose line numbers are bounded by lineBounds and whose column numbers are bounded by columnBounds.

area' :: Monad m => Gen m Area Source #

Generates an Area consisting of Spans with start and end positions within the default line and column bounds.

Generator bounds

type Bounds a = (a, a) Source #

Inclusive lower and upper bounds on a range.

boundsSize :: Num n => (n, n) -> n Source #

The size of a range specified by Bounds.

Assumes the upper bound is at least the lower bound.