[Haskell-cafe] Partial application

Donald Bruce Stewart dons at cse.unsw.edu.au
Thu Jan 18 04:42:40 EST 2007


phiroc:
> Hello,
> 
> could someone please give me an example of the "partial application" of the
> following curried function:
> 
> add' :: Int -> Int -> Int
> add' a b = a + b
> 
> Normally, add' 1 should work, but it doesn't.

    Prelude> let add' :: Int -> Int -> Int ; add' a b = a + b

    Prelude> let add1 = add' 1
    Prelude> add1 7
    8

-- Don


More information about the Haskell-Cafe mailing list