Laws and partial values (was: [Haskell-cafe] mapM_ ->
Monoid.Monad.map)
Jonathan Cast
jonathanccast at fastmail.fm
Sun Jan 25 10:00:40 EST 2009
On Sat, 2009-01-24 at 03:08 -0700, Luke Palmer wrote:
> On Sat, Jan 24, 2009 at 2:40 AM, Ryan Ingram <ryani.spam at gmail.com>
> wrote:
> On Fri, Jan 23, 2009 at 10:49 PM, Thomas Davie
> <tom.davie at gmail.com> wrote:
> > Isn't the point of bottom that it's the least defined
> value. Someone above
> > made the assertion that for left identity to hold, _|_
> `mappend` () must be
> > _|_. But, as there is only one value in the Unit type, all
> values we have
> > no information about must surely be that value, so this is
> akin to saying ()
> > `mappend` () must be (), which our definition gives us.
>
>
> But _|_ is not ().
>
> Correction: _|_ is not always ().
For example: in Haskell.
Prelude> () `seq` True
True
Prelude> (undefined `asTypeOf` ()) `seq` True
*** Exception: Prelude.undefined
jcc
More information about the Haskell-Cafe
mailing list