According to the enlightenment above, I'd say (*) is a variable that holds some function/operator that is applied on (f x) and (f y), not the multiplication, right?-------- Original Message --------
Subject: Re: [Haskell-cafe] Comparing functions
From: Brandon Allbery <allbery.b@gmail.com>
To: Vlatko Bašić <vlatko.basic@gmail.com>
Cc: Haskell-Cafe <haskell-cafe@haskell.org>
Date: 11.07.2013 20:45
On Thu, Jul 11, 2013 at 2:11 PM, Vlatko Basic <vlatko.basic@gmail.com> wrote:
Hm, I thought it is a pattern match with constant, as in f ('a':xs) ==The problem here isn't quite what you think it is; (==) is not a constructor, therefore it is a *variable*. It's exactly the same problem as
a = 5-- ...foo a = 3 -- this does NOT compare with the previous value of "a"; it's identical to the next line!foo x = x
I wonder what you'd make of this definition, then?
(*) `on` f = \x y -> f x * f y
--
brandon s allbery kf8nh sine nomine associatesunix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net