<s> from operator import __not__ <EOL> from functools import reduce <EOL> from . cross import map , imap <EOL> from . simple_funcs import * <EOL> from . simple_funcs import __all__ as all_simple <EOL> from . funcmakers import make_func <EOL> __all__ = all_simple + [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def compose ( * fs ) : <EOL> if fs : <EOL> pair = lambda f , g : lambda * a , ** kw : f ( g ( * a , ** kw ) ) <EOL> return reduce ( pair , imap ( make_func , fs ) ) <EOL> else : <EOL> return identity <EOL> def rcompose ( * fs ) : <EOL> return compose ( * reversed ( fs ) ) <EOL> def complement ( pred ) : <EOL> return compose ( __not__ , pred ) <EOL> def juxt ( * fs ) : <EOL> extended_fs = map ( make_func , fs ) <EOL> return lambda * a , ** kw : [ f ( * a , ** kw ) for f in extended_fs ] <EOL> def ijuxt ( * fs ) : <EOL> extended_fs = map ( make_func , fs ) <EOL> return lambda * a , ** kw : ( f ( * a , ** kw ) for f in extended_fs ) </s>
