[Haskell-cafe] nested function application question

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Jan 5 15:16:02 EST 2009


On 2009 Jan 5, at 13:57, David Menendez wrote:
> 2009/1/5 Ross Mellgren <rmm-haskell at z.odi.ac>:
>> If for some reason you absolutely need to avoid parentheses (mostly  
>> as a
>> thought exercise, I guess), you'd have to have a flipped version of
>> intercalate:
>
> Or a version of ($) that associates differently.
>
> infixl 0 $$
>
> f $$ x = f x
>
> *Main Data.ByteString> :t \x y z -> intercalate $$ intercalate x y $ 
> $ z
> \x y z -> intercalate $$ intercalate x y $$ z :: ByteString
>                                                 -> [ByteString]
>                                                 -> [ByteString]
>                                                 -> ByteString


...at which point we're reinventing Applicative, no?

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list