Hilbert curve: Difference between revisions
m
→Functional Python: (Used one flip in lieu of a bare lambda)
m (→Functional Python: (Used one flip in lieu of a bare lambda)) |
|||
Line 1,008:
return Node(c)(
map(go, xs) if xs else map(
rule[c]
)
Line 1,071:
'type': 'Node', 'root': v, 'nest': xs
}
# flip :: (a -> b -> c) -> b -> a -> c
def flip(f):
return lambda a: lambda b: f(b)(a)
|