Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/Array/Show_Array.hs

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


module Array(Show(..)) where

import Ix
import DArray
import Assocs
import Bounds
import Elems
import ArrPrec

instance  (Ix a, Show a, Show b) => Show (Array a b)  where
    showsPrec p a = showParen (p > arrPrec)
                      ( showString "array "
                      . showsPrec (arrPrec+1) (bounds a) . showChar ' '
                      . showsPrec (arrPrec+1) (assocs a)
                      )

    showsType a = showString " (Array " .  (showsType . fst . bounds) a
                  . showChar ' ' . (showsType . head . elems) a . showChar ')'

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.