ChasingBottoms-1.3.1.15: For testing partial and infinite values.
Copyright(c) Nils Anders Danielsson 2004-2022 2024
LicenseSee the file LICENCE.
Maintainerhttp://www.cse.chalmers.se/~nad/
Stabilityexperimental
Portabilitynon-portable (GHC-specific)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.ChasingBottoms.ApproxShow

Description

Functions for converting arbitrary (non-function, partial, possibly infinite) values into strings.

Synopsis

Documentation

type Prec = Int Source #

Precedence level.

class ApproxShow a where Source #

Minimal complete definition

approxShowsPrec

Methods

approxShowsPrec :: Nat -> Prec -> a -> ShowS Source #

The Data instance of ApproxShow makes sure that approxShowsPrec n behaves (more or less) like the derived version of showsPrec, with the following differences:

  • After n levels of descent into a term the output is replaced by "_".
  • All detectable occurences of bottoms are replaced by "_|_".
  • Non-bottom functions are displayed as "<function /= _|_>".

approxShows :: Nat -> a -> ShowS Source #

approxShow :: Nat -> a -> String Source #

Instances

Instances details
Data a => ApproxShow a Source # 
Instance details

Defined in Test.ChasingBottoms.ApproxShow