Laws and partial values (was: [Haskell-cafe] mapM_ -> Monoid.Monad.map)

Thomas Davie tom.davie at gmail.com
Sat Jan 24 01:49:30 EST 2009


On 24 Jan 2009, at 02:33, Luke Palmer wrote:

> On Fri, Jan 23, 2009 at 6:10 PM, <roconnor at theorem.ca> wrote:
> On Fri, 23 Jan 2009, Derek Elkins wrote:
>
> mempty `mappend` undefined = undefined (left identity monoid law)
> The above definition doesn't meet this, similarly for the right  
> identity
> monoid law.  That only leaves one definition, () `mappend` () = ()  
> which
> does indeed satisfy the monoid laws.
>
> So the answer to the question is "Yes."  Another example of making
> things as lazy as possible going astray.
>
> I'd like to argue that laws, such as monoid laws, do not apply to  
> partial values.  But I haven't thought my position through yet.
>
> Please try to change your mind.

I'd actually argue that this is just the wrong way of formulating my  
statement.  Please correct my possibly ill informed maths, if Im doin  
it rong though...

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.

Bob


More information about the Haskell-Cafe mailing list