Chasing BottomsContentsIndex
Test.ChasingBottoms.ApproxShow
Portabilitynon-portable (GHC-specific)
Stabilityexperimental
Maintainerhttp://www.cs.chalmers.se/~nad/
Description
Functions for converting arbitrary (non-function, partial, possibly infinite) values into strings.
Synopsis
type Prec = Int
class ApproxShow a where
approxShowsPrec :: Nat -> Prec -> a -> ShowS
approxShows :: Nat -> a -> ShowS
approxShow :: Nat -> a -> String
Documentation
type Prec = Int
Precedence level.
class ApproxShow a where
Methods
approxShowsPrec :: Nat -> Prec -> a -> ShowS

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
approxShow :: Nat -> a -> String
show/hide Instances
Produced by Haddock version 0.7