[Haskell-beginners] flip lookup in ghci

Rafael Gustavo da Cunha Pereira Pinto RafaelGCPP.Linux at gmail.com
Fri Feb 20 07:11:12 EST 2009


you are applying the type to lookup only!

try let lookupIn = ((flip lookup ) :: (Eq a) => [(a, b)] -> a -> Maybe b )

On Fri, Feb 20, 2009 at 07:27, Matt R <mattrussell324 at googlemail.com> wrote:

> So what's this all about then? How come a has become ()?
>
>  ghci> :t lookup
>  lookup :: (Eq a) => a -> [(a, b)] -> Maybe b
>  ghci> :t flip lookup
>  flip lookup :: (Eq a) => [(a, b)] -> a -> Maybe b
>  ghci> let lookupIn = (flip lookup :: (Eq a) => [(a, b)] -> a -> Maybe b )
>  ghci> :t lookupIn
>  lookupIn :: [((), b)] -> () -> Maybe b
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



-- 
Rafael Gustavo da Cunha Pereira Pinto
Electronic Engineer, MSc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090220/06daa777/attachment.htm


More information about the Beginners mailing list