[Haskell-cafe] polyvariadic function for Applicative instances

Xiao-Yong Jin xj2106 at columbia.edu
Sun May 9 12:39:56 EDT 2010


Hi,

Is it possible to have a function accept variable number of
arguments, such that 'f' can be instantiated to different
concrete types as

f :: Applicative a => (e1 -> f) -> a e1 -> A f
f g a = pure g <*> a

f :: Applicative a => (e1 -> e2 -> f) -> a e1 -> a e2 -> A f
f g a b = pure g <*> a <*> b

Thanks,
Xiao-Yong
-- 
J    c/*    __o/*
X    <\     * (__
Y    */\      <


More information about the Haskell-Cafe mailing list