[Haskell-cafe] Functions from Data.Hashtable
Peter Verswyvelen
bugfact at gmail.com
Tue Apr 7 18:43:15 EDT 2009
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 <
lemming at henning-thielemann.de> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090408/b77420c6/attachment.htm
More information about the Haskell-Cafe
mailing list