Hello,
Does python have andmap and ormap:
andmap((lambda t: boolean(t)),L)
gives True if boolean(t) is True for all t in L and False otherwise?
And
ormap((lambda t: boolean(t)),L)
gives True if boolean(t) is True for some t in L and False otherwise?
One can use a list comprehension like
[x fo
The following works perfectly:
import operator
def andmap(b,L):
return reduce(operator.and_, [b(x) for x in L])
def ormap(b,L):
return reduce(operator.or_, [b(x) for x in L])
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
When I run this I get through ghc I get
C:\Documents and Settings\User\My Documents\wildcard>ghc
"./wc-zielonka.hs"
compilation IS NOT required
C:/Languages/ghc/ghc-6.4.1/libHSrts.a(Main.o)(.text+0x1d):Main.c:
undefined refe
rence to `__stginit_ZCMain'
C:/Languages/ghc/ghc-6.4.1/libHSrts.a(Main.o)