Thanks to all the people who responded to my question!
The solution from Wolfgang Jeltsch:
(f.).g
was what I was after. But the other responses were
useful also.
Thanks!
Mark.
On Thu, 2003-07-17 at 09:57, Dr Mark H Phillips wrote:
> Hi,
>
> Hopefully this is a simple question. I am wanti
G'day all.
On Sat, Jul 19, 2003 at 01:52:32AM -0400, Dylan Thurston wrote:
> It's maybe easiest to think in terms of group theory with an
> action on a set: you're just distinguishing between the multiplication
> of group elements and the actual action. This distinction is not
> usually reflecte
On Saturday, 2003-07-19, 07:52, CEST, Dylan Thurston wrote:
> [...]
> But if you have -Point, then you have a 0 Point, and there's no distinction
> between Points and Vectors at all!
Yes, I always thought (and still think) that the (main) difference between
points in affine geometry and radius v
On Sat, Jul 19, 2003 at 02:06:44PM +1000, Andrew J Bromage wrote:
> G'day all.
>
> On Fri, Jul 18, 2003 at 04:08:25AM -0400, Dylan Thurston wrote:
>
> > What's wrong with that solution?
>
> Working with these operators, I would spend a significant amount of
> time getting the '<' and '>' notatio
G'day all.
On Fri, Jul 18, 2003 at 04:08:25AM -0400, Dylan Thurston wrote:
> What's wrong with that solution?
Working with these operators, I would spend a significant amount of
time getting the '<' and '>' notations right rather than writing
code. I don't like that.
For example, using the sug
K. Fritz Ruehr (Wed, Jul 16, 2003 at 11:19:55PM -0700):
c0 = ($) -- application
> c1 = (.) -- good old composition
>
> c2 = (.) . (.)-- my (.<) from above
>
> c3 = (.) . (.) . (.)
>
> c4 = (.) . (.) . (.) . (.)
>
>
On Fri, Jul 18, 2003 at 11:39:48AM +1000, Andrew J Bromage wrote:
> > Someone mentioned multiplying by a scalar. I think this is a
> > good application, but what we need is to agree (somehow) on
> > the symbol used. I've used (*.) and (.*), with the dot being
> > on the side the scalar is on (on th
G'day all.
On Thu, Jul 17, 2003 at 04:46:13PM +0100, Jon Fairbairn wrote:
> Someone mentioned multiplying by a scalar. I think this is a
> good application, but what we need is to agree (somehow) on
> the symbol used. I've used (*.) and (.*), with the dot being
> on the side the scalar is on (on
What I nice application for a multi-variadic compositional operator
mcomp [1]. Only one operator does the trick, for functions of
arbitrary number of curried arguments. And I really mean the arbitrary
number of arguments, in both functions under composition. Given
> f1 x = x*x
> g2 a b = a + b
>
Tom Pledger wrote:
> K. Fritz Ruehr writes:
> :
> | But Jerzy Karczmarczuk enlightened me as to the full generality possible
> | along these lines (revealing the whole truth under the influence of at
> | least one beer, as I recall). Namely, one can define a sequence of
> | functions (let's u
On 2003-07-17 at 09:08+0200 Johannes Waldmann wrote:
> On Wed, 16 Jul 2003, K. Fritz Ruehr wrote:
>
> > I think the cutest way to get what you want here is to define a new
> ^^
> > operator as follows:
> >
> > (.<) = (.) . (.)
>
> Indeed this is cute - but let me add a gene
How about...
h a = f . g a
or...
f $ g 1 2
f :: Int -> Int
f x = x*x
g :: Int -> Int -> Int
g a b = a + b
...
But what I really want is a function with signature Int -> Int -> Int.
--
Brett Letner
Galois Connections, Inc.
http://www.galois.com
mailto:[EMAIL PROTECTED]
phone:(503)626-6616
On Wed, 16 Jul 2003, K. Fritz Ruehr wrote:
> I think the cutest way to get what you want here is to define a new
^^
> operator as follows:
>
> (.<) = (.) . (.)
Indeed this is cute - but let me add a general comment here:
in my code, I don't define any operators at all (only
K. Fritz Ruehr writes:
:
| But Jerzy Karczmarczuk enlightened me as to the full generality possible
| along these lines (revealing the whole truth under the influence of at
| least one beer, as I recall). Namely, one can define a sequence of
| functions (let's use a better notation now, with "
I think the cutest way to get what you want here is to define a new
operator as follows:
(.<) = (.) . (.)
(the choice of symbol is supposed to suggest this new form of
composition with "two prongs" on the right). Then you can use it as
follows, for example:
f x = x * x
g a b = a + b
Hi,
you may use (f .) . g.
Wolfgang
On Thursday, 2003-07-17, 02:27, CEST, Dr Mark H Phillips wrote:
> Hi,
>
> Hopefully this is a simple question. I am wanting to know good ways
> of using ".", the function composition operator, when dealing with
> currying functions.
>
> Suppose I have the fo
Hi,
Hopefully this is a simple question. I am wanting to know good ways
of using ".", the function composition operator, when dealing with
currying functions.
Suppose I have the following functions defined:
f :: Int -> Int
f x = x*x
g :: Int -> Int -> Int
g a b = a + b
If I wish to ad
17 matches
Mail list logo