Dne 28.5.2013 12:32, Johannes Waldmann napsal(a):
Jose A. Lopes <jose.lopes <at> ist.utl.pt> writes:

     unionWith :: Ord k => (a -> b -> c) -> Map k a -> Map
     k b -> Map k c
what should be the result of

unionWith undefined (M.singleton False 42) (M.singleton True "bar")  ?
Perhaps the generalized signature should be instead:

```haskell
unionWith :: Ord k => (Maybe a -> Maybe b -> c) -> Map k a -> Map k b -> Map k c
```
(The function would always get at least one `Just`.)
But this functionality can be achieved using `map`s and the current `unionWith`.

P.P.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to