app f xs ==> f(xs)
app f xs ==> f(xs)
>>> 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.
typeRep @(Maybe Int) === App (typeRep @Maybe) (typeRep @Int)Note that this will also match a function type,
typeRep @(Int# -> Char) === App (App arrow (typeRep @Int#)) (typeRep @Char)where arrow :: TypeRep ((->) :: TYPE IntRep -> Type -> Type).