September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,10 +1,15 @@
|
|||
import Numeric
|
||||
import Numeric (readOct, showOct)
|
||||
import Data.List (intercalate)
|
||||
|
||||
to :: Int -> String
|
||||
to = flip showOct ""
|
||||
|
||||
from :: String -> Int
|
||||
from = fst . head . readOct
|
||||
|
||||
main = do
|
||||
fancy 2097152
|
||||
fancy 2097151
|
||||
where fancy i = putStrLn $ to i ++ " <-> " ++ show (from $ to i)
|
||||
main :: IO ()
|
||||
main =
|
||||
mapM_
|
||||
(putStrLn .
|
||||
intercalate " <-> " . (pure (:) <*> to <*> (return . show . from . to)))
|
||||
[2097152, 2097151]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue