Function Composition in Haskell
- by Watts
I have a function that takes 3 functions and switches the types and combine to make a new function.
For example a test case call would be : (chain init tail reverse ) "Haskell!" the output should be lleksa
I've tried to do this problem a few different ways including using the map function but I kept getting association problems. so i did
chain :: Ord a => [a] -> a
chain f g h x = f.g.h$x
my error is Couldn't match expected type[t0->t1->t2->a0]
When I type the problem directly into prelude like replacing f, g, h, x with the values it comes out right
Is there even a way to do three functions, I've only seen two in examples