On Fri, Nov 18, 2011 at 1:58 AM, Roman Leshchinskiy <[email protected]>
wrote:
> Johan Tibell wrote:
>>
>> map (\ v -> undefined) == undefined
>> mapKeys (\ k -> undefined) == undefined
>
> Not really related to the question but I don't really understand how these
> properties can possibly hold. Shouldn't it be:
>
> map (\v -> undefined) x = undefined
>
> And even then, does this really hold for empty maps?
It doesn't hold. It needs the side condition that the map is initially
empty. I wonder if there's any function in the API that'd let me
express this property (of HOFs) that doesn't require a side condition.
I don't think so e.g.
insertWith (\old new -> undefined) k v m
has a side condition that k is in the map.
-- Johan
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe