Binary digits: Difference between revisions
Content added Content deleted
m (→Python :: Custom functions: Used divmod in lieu of two operators in boolsFromInt) |
(→Python :: Custom functions: Removed one unused primitive) |
||
Line 3,135: | Line 3,135: | ||
'''Integer enumeration from m to n.''' |
'''Integer enumeration from m to n.''' |
||
return lambda n: list(range(m, 1 + n)) |
return lambda n: list(range(m, 1 + n)) |
||
# fmapTuple (<$>) :: (a -> b) -> (a, a) -> (a, b) |
|||
def fmapTuple(f): |
|||
'''A pair in which f has been applied to |
|||
the second item.''' |
|||
return lambda tpl: (tpl[0], f(tpl[1])) |
|||