1
compose :: (b -> c) -> (a -> b) -> (a -> c)
g `compose` f = \x-> g (f x)

I have mentioned the function with the type declaration Can anyone tell me how the above function would work ?? I know compose takes two functions and gives us another function

JavaDeveloper
  • 77
  • 1
  • 5
  • 2
    an equivalent definition is `compose g f x = g (f x)`. it means, wherever in your code you see the left-hand side of that equation, you can use its right-hand side, with the actual arguments substituted for the corresponding parameters. nothing more to it than that. – Will Ness Oct 11 '17 at 11:04

0 Answers0