Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/tests/conformance98/IOExtras/IOArray/Main.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


import NHC.IOExtras

main = do
    a <- newIOArray (0,5) 4
    showIOArray a
    writeIOArray a 3 3
    showIOArray a
    
showIOArray a = do
    putStr "["
    mapM_ (\i-> do
                v <- readIOArray a i
                putStr (show v++",")) [0..5]
    putStrLn "]"

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.