[Haskell-cafe] Re: Math questions

Maciej Piechotka uzytkownik2 at gmail.com
Fri May 28 15:27:04 EDT 2010


On Tue, 2010-05-25 at 22:47 +0100, Mujtaba Boori wrote:
> Hello 
> I am try to solve this equation
> 
> 
> Define a higher order function  that tests whether two functions ,
> both defined on integers , coincide for all integers between 1 and 100
> 
> 
>  how can I solve this ?
> is there any thing in Haskell library to solve this kind ?    


Not so beginner answer (but not advanced I guess):

import Control.Applicative

check f g = all (liftA2 (==) f g) [1..100]

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100528/fa289eba/attachment.bin


More information about the Haskell-Cafe mailing list