← Prev in month ← Prev in thread
Next in thread → Next in month →

[xacml] Equivalence of Functions

From
Polar Humenn <>
Date
2002-09-23T11:06:00+00:00
ID
Thread
[xacml] Equivalence of Functions
MHonArc v2.5.2 -->
















xacml message






[Date Prev]
 | [Thread Prev]
 | [Thread Next]
 | [Date Next]

--

[Date Index]
 | [Thread Index]
 | [Elist Home]








Subject: [xacml] Equivalence of Functions




From: Polar Humenn <>
To: XACML <>
Date: Mon, 23 Sep 2002 11:04:31 -0400 (EDT)










foldr f a [] = a
foldr f a (x:xs) = ( f a ( foldr f a (x:xs) ) )

You could write sum of a bag of arguments in two ways:

sum []     = 0
sum (x:xs) = plus x (sum xs)

or

sum xs = foldr plus 0 xs

however, you can write product like this:

product xs = foldr multiply 0 xs

You get the functionality of "foldr" without having to define "product" or
"sum".


-Polar
← Prev in month ← Prev in thread
Next in thread → Next in month →