>>> app not ('d',True) ('d',False)Sometimes it is necessary to specify the result type, such that the function becomes monomorphic >>> app (+1) (True,5) :: (Bool,Integer) (True,6) One may also use appPoly, which doesn't require specifying the result type. However it can only apply functions to the first element of an n-ary tuple.
>>> app1 (+1) (5,6,7) (6,6,7)
>>> appF (\a b c -> if a then b else c) (False,1,2) 2
>>> appN not (Proxy 2) (False,True,False) (False,True,True)appN also works for polymorphic functions
>>> appN show (5,'c',False) (Proxy :: Proxy 2) (5,'c',"False")
>>> appPoly show (5,False) ("5",False)
>>> appendT (5,'c') ('d',False) (5,'c','d',False)
>>> mapPolyT (+1) (5,6,7,8) (6,7,8,9)
>>> mapPolyT (+1) (5,6,7,False) No instance for (Num Bool) arising from the literal `5'