Re: [Haskell-cafe] [Haskell] ANNOUNCE: set-monad

18 Jun
2012
18 Jun
'12
4:54 p.m.
Hi Derek,
On 16 June 2012 21:53, Derek Elkins
The law that ends up failing is toList . fromList /= id, i.e. fmap g . toList . fromList . fmap h /= fmap g . fmap h
This is not related to functor laws. The property that you desire is about toList and fromList. The toList and fromList functions are not required to satisfy toList . fromList /= id. This does not hold for Data.Set and it does not hold for the Data.Set.Monad wrapper either. Duplicates are lost when lists are converted into sets. Other instances of fromList and toList also fail to satisfy the property that you desire (e.g., Map). Cheers, George
4721
Age (days ago)
4721
Last active (days ago)
0 comments
1 participants
participants (1)
-
George Giorgidze