Improved documentation for Bool (Was: [Haskell-cafe] Comments
from OCaml Hacker Brian Hurt)
benja.fallenstein at gmail.com
Sun Jan 18 12:17:09 EST 2009
On Sun, Jan 18, 2009 at 5:48 PM, <roconnor at theorem.ca> wrote:
> I noticed the Bool datatype isn't well documented. Since Bool is not a
> common English word, I figured it could use some haddock to help clarify it
> for newcomers.
> -- |The Bool datatype is named after George Boole (1815-1864).
> -- The Bool type is the coproduct of the terminal object with itself.
Russell, this does seem like it might be very helpful, but it might be
useful to include a note about what category you are working in.
People may sometimes naively assume that one is working in the
category of Haskell/Hugs/GHC data types and Haskell functions, in
which there are no terminal -- or initial -- objects ('undefined' and
'const undefined' are distinct maps between any two objects X and Y),
or else in the similar category without lifted bottoms, in which the
empty type is terminal and the unit type isn't ('undefined' and 'const
()' are both maps from any object X to the unit type). These niceties
will not confuse the advanced reader, but it may help the beginner if
you are more explicit.
More information about the Libraries