[Haskell-cafe] Compose

Felipe Almeida Lessa felipe.lessa at gmail.com
Sun Sep 30 10:58:44 EDT 2007


On 9/30/07, PR Stanley <prstanley at ntlworld.com> wrote:
> So the question is, does compose as a function or keyword exist in
> Haskell and if so how can the above code frag be corrected?
> O and, is compose in any way related to curry and uncurry?

You can't write that function in Haskell as the list is heterogeneous.
If all functions were of the same type, then you could do something
like

compose :: [a -> a] -> (a -> a)
compose = foldr (.) id

HTH,

-- 
Felipe.


More information about the Haskell-Cafe mailing list