Abbreviations, automatic: Difference between revisions
Content deleted Content added
→{{header|Python}}: Added a variant (functional composition) |
→Python Functional: (some tidying of main function) |
||
Line 1,587:
return next(
len(a[0]) for a in map(
transpose(map(inits, xs))
) if n == len(a)
Line 1,608:
def compose(g):
return lambda f: lambda x: g(f(x))
# concat :: [String] -> String
def concat(xs):
return ''.join(xs)
Line 1,620 ⟶ 1,625:
def lines(s):
return s.splitlines()
# map :: (a -> b) -> [a] -> [b]
def _map(f):
return lambda xs: list(map(f, xs))
|