yes I agree. It seems to be mentioned here too
http://www.haskell.org/haskellwiki/Parameter_order

On Wed, Apr 8, 2009 at 12:38 AM, Henning Thielemann <
[email protected]> wrote:

>
> On Wed, 8 Apr 2009, Peter Verswyvelen wrote:
>
>  These functions have their arguments reversed when compare to e.g. Map
>> For example
>>
>> Data.HashTable.lookup :: HashTable key val -> key -> IO (Maybe val)
>>
>> Data.Map.lookup :: Ord key => key -> Map key val -> Maybe val
>>
>
> For my taste, Data.Map.lookup has the wrong parameter order, since I often
> need the same Map with different keys and not vice versa. The
> HashTable.lookup parameter order can also be read as mapping a Map to the
> function it represents. I mean (HashTable key val) and (Map key val)
> represent functions of type (key -> val) and you can write:
>  Data.HashTable.lookup :: HashTable key val -> (key -> IO (Maybe val))
>
> http://www.haskell.org/haskellwiki/Parameter_order
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to