Is there a way to make applicative uses of <$>
and <*>
look nice when dealing with infix operators? I think that
((++) <$> a <*> ((++) <$> b <*> c ))
looks much more cluttered then
a ++ b ++ c
so I wonder if there is a nicer way.
Is there a way to make applicative uses of <$>
and <*>
look nice when dealing with infix operators? I think that
((++) <$> a <*> ((++) <$> b <*> c ))
looks much more cluttered then
a ++ b ++ c
so I wonder if there is a nicer way.
(<++>) = liftA2 (++)
a <++> b <++> c
or
liftA2 (++) a $ liftA2 (++) b c
See Thomas Davie's InfixApplicative package, which provides a general syntactic trick, rather than having to define a new operator for each lifting.