Fairshare between two and more: Difference between revisions

m
→‎Python :: Functional: updated primitives
m (fixed an HTML tag.)
m (→‎Python :: Functional: updated primitives)
Line 1,203:
 
 
# TEST -------------------------- TEST --------------------------
# main :: IO ()
def main():
Line 1,221:
 
 
# GENERIC ------------------------ GENERIC -------------------------
 
# Just :: a -> Maybe a
Line 1,244:
of a series of functions.
'''
returndef lambdago(f, xg): reduce(
lambdadef a, f: ffg(ax),:
fs[::-1], return f(g(x))
) return fg
return reduce(go, fs, identity)
 
 
Line 1,279 ⟶ 1,280:
xShow, fxShow, f, xs
)
 
# identity :: a -> a
def identity(x):
'''The identity function.'''
return x
 
 
9,655

edits