[Haskell-cafe] Functions from Data.Hashtable

Jason Dagit dagit at codersbase.com
Tue Apr 7 18:35:40 EDT 2009


On Tue, Apr 7, 2009 at 3:23 PM, Peter Verswyvelen <bugfact at gmail.com> 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
>
> I find this a bit odd. Is this by design?

Speaking of design.  I think the version in HashTable would be better
for partial application in most cases.  With that version you can
partially apply the hashtable you want to use and then get a function
(key -> IO (Maybe val)).  So I think most uses wouldn't need to sneak
in a flip.

Jason


More information about the Haskell-Cafe mailing list