Is it possible to encode a generic “lift” function in Haskell?
I'm not the biggest fan of varargs, but I always thought both the applicative ( f <$> x <*> y ) and idiom ( [i| f x y |] ) styles have too many symbols. I usually prefer going the liftA2 f x y way, but I, too, think that A2 is a little ugly. From this question , I've learned it is possible to implement vararg functions in Haskell. This way, is it possible to use the same principle in order implement a lift function, such that: lift f a b == pure f <*> a <*> b I've tried replacing the + by <*> on the quoted code: class Lift r where lift :: a -> r instance Lift a where lift = id instance (Lift r