{-# LANGUAGE GeneralizedNewtypeDeriving #-}moduleTest.SmallCheck.SeriesMonadwhereimportControl.ApplicativeimportControl.MonadimportControl.Monad.LogicimportControl.Monad.Reader-- | Maximum depth of generated test values.---- For data values, it is the depth of nested constructor applications.---- For functional values, it is both the depth of nested case analysis-- and the depth of results.typeDepth=Int-- | 'Series' is a `MonadLogic` action that enumerates values of a certain-- type, up to some depth.---- The depth bound is tracked in the 'SC' monad and can be extracted using-- 'getDepth' and changed using 'localDepth'.---- To manipulate series at the lowest level you can use its 'Monad',-- 'MonadPlus' and 'MonadLogic' instances. This module provides some-- higher-level combinators which simplify creating series.---- A proper 'Series' should be monotonic with respect to the depth — i.e.-- @localDepth (+1) s@ should emit all the values that @s@ emits (and-- possibly some more).---- It is also desirable that values of smaller depth come before the values-- of greater depth.newtypeSeriesma=Series(ReaderTDepth(LogicTm)a)deriving(Functor,Monad,Applicative,MonadPlus,Alternative,MonadLogic)instanceMonadTransSerieswherelifta=Series$lift.lift$arunSeries::Depth->Seriesma->LogicTmarunSeriesd(Seriesa)=runReaderTad