[Haskell-cafe] Why does `flip` cause function type so different ?

Ivan Miljenovic ivan.miljenovic at gmail.com
Thu Mar 18 23:45:04 EDT 2010


Hint: look at the type of flip...

Also, there's a haskell-beginners mailing list.  You may wish to post
there rather than asking us every question you get whilst learning
Haskell.

On 19 March 2010 14:34, zaxis <z_axis at 163.com> wrote:
>
>>let f x xs = [x:xs,xs]
>> :t  f
> f :: a -> [a] -> [[a]]
>
>>:t  (>>=) .f
> (>>=) .f :: a -> ([[a]] -> [a] -> b) -> [a] -> b
>
>> :t (flip (>>=) .f)
> (flip (>>=) .f) :: a -> [[a]] -> [[a]]
>
> Why is the type of `(>>=) .f` and `flip (>>=) .f` so different ?
>
> Sincerely!
>
> -----
> fac n = let {  f = foldr (*) 1 [1..n] } in f
> --
> View this message in context: http://old.nabble.com/Why-does-%60flip%60-cause-function-type-so-different---tp27950886p27950886.html
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list