Safe Haskell | Safe-Infered |
---|
Documentation
The Label
type.
A value of type Label x
is really a value of type x
, but with
a textual label. The Show
instance returns this label.
This can be tremendously useful for allowing you to show
values
which would not otherwise be printable. For example, functions.
Rather than passing a function, you can pass a labelled function.
This allows you to know, at runtime, which function you're
dealing with, which is very useful for test purposes.
You can use label
to extract the label text, and value
to
extract the actual data value.
The Show
instance uses the label
, but the other instances use
only the value
, ignoring the label
. (In particular, any
operations which alter the value
leave the label
untouched.)