[Haskell-cafe] Composition Operator
Lennart Augustsson
lennart at augustsson.net
Sat Sep 22 11:12:00 EDT 2007
I'm not sure what you mean by "abstract function". It's a function like any
other function.
But otherwise you're right. :)
-- Lennart
On 9/22/07, PR Stanley <prstanley at ntlworld.com> wrote:
>
> Ah, I understand now. Let me get this right:
> The resulting (a -> c) is a kind of abstract function formed by the
> pairing of <a -> b) and (b -> c), hence the lambda \x -> g (f x), correct?
> Thanks, Paul
>
> At 05:11 22/09/2007, you wrote:
> >Hello,
> >
> >It's probably easiest to think of composition as a function which
> >takes two arguments (both functions), (g :: b -> c) and (f :: a -> b),
> >and returns a new function of type a -> c. We could write this
> >explicitly as
> >
> > composition :: (b -> c, a -> b) -> a -> c
> > composition (g,f) = \x -> g (f x)
> >
> >then (.) is the currying of composition:
> >
> > (.) = curry composition
> >
> >or
> >
> > (.) g f = \x -> g (f x)
> >
> >-Jeff
> >
> >
> >On 9/21/07, PR Stanley <prstanley at ntlworld.com> wrote:
> > > Hi
> > > (.) :: (b -> c) -> (a -> b) -> (a -> c)
> > > While I understand the purpose and the semantics of the (.) operator
> > > I'm not sure about the above definition.
> > > Is the definition interpreted sequentially - (.) is a fun taht takes
> > > a fun of type (b -> c) and returns another fun of type (a -> b) etc?
> > > Any ideas?
> > > Thanks, Paul
> > >
> > > _______________________________________________
> > > Haskell-Cafe mailing list
> > > Haskell-Cafe at haskell.org
> > > http://www.haskell.org/mailman/listinfo/haskell-cafe
> > >
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070922/942231cf/attachment.htm
More information about the Haskell-Cafe
mailing list