Jump to content

Sparkline in unicode: Difference between revisions

m
→‎{{header|Python}}: (Simplified main to single print of assembled string)
m (→‎{{header|AppleScript}}: Eliminated one map (by functor law) at top level)
m (→‎{{header|Python}}: (Simplified main to single print of assembled string))
Line 1,848:
# main :: IO ()
def main():
for x in mapprint(
lambda s: sparkLineunlines(readFloatsmap(s)),
compose(compose(unlines)(sparkLine))(readFloats),
[
"0, 1, 19, 20",[
"0, 999, 4000 "0, 49991, 700019, 799920",
"1 2 3 4 5 6 7 8 7 6"0, 5999, 44000, 34999, 27000, 17999",
"1.5, 0.52 3.5, 2.54 5.5, 4.56 7 8 7.5, 6. 5 4 3 2 1",
"1.5, 0.5 3.5, 2.5 5.5, 4.5 7.5, 6.5"
]
): ]
print ('\n'.join(x))
[)
 
 
Line 1,871 ⟶ 1,872:
def Nothing():
return {'type': 'Maybe', 'Nothing': True}
 
 
# compose (<<<) :: (b -> c) -> (a -> b) -> a -> c
def compose(g):
return lambda f: lambda x: g(f(x))
 
 
Line 1,908 ⟶ 1,914:
re.split('[\s,]+', s)
))
 
 
# unlines :: [String] -> String
def unlines(xs):
return '\n'.join(xs)
 
 
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.