What are these operators doing?
(.) :: (b -> c) -> (a -> b) -> a -> c
(<$>) :: Functor f => (a -> b) -> f a -> f b
(<*>) :: Applicative f => f (a -> b) -> f a -> f b
I don’t have any idea when I see the signatures. Perhaps some example with a simple and easy to understand explanation will help me.
I am also learning Haskell, and my recommendation is to have a look into Learn You a Haskell for Great Good!, and more precisely:
(.)read Function composition<$>and<*>read Applicative functorsIn essence:
(.)is function composition: if you haveg :: a -> bandf :: b -> cthenf . gis essentiallyf(g(x)): first usegon anato get aband then usefon thatbto get ac<$>takes a function taking anaand returning ab, and a functor that contains ana, and it returns a functor that contains ab. So<$>is the same asfmap :: (a -> b) -> f a -> f b<*>takes a functor that contains a function taking anaand returning ab, and a functor that contains ana, and it returns a functor that contains ab. So<*>kind of extract the function from a functor and applies it to an arguments also inside a functor, and finally returns the result into a functorNote the explanations that you find in the book chapters are better than my attempt above