Variable-length quantity: Difference between revisions

m
→‎{{header|Haskell}}: Simplified one function
(→‎{{header|Haskell}}: Used intercalate in lieu of multiple (++))
m (→‎{{header|Haskell}}: Simplified one function)
Line 681:
 
from :: [Int] -> Int
from = foldl1 (\x(+) y. -> x(base * base + y))
 
main :: IO ()
Line 689:
intercalate " <-> " .
(((:) . concatMap show . to) <*> (return . show . from . to)))
[2097152, 2097151]</lang>
</lang>
{{out}}
<pre>10000000 <-> 2097152
9,655

edits