Plan 9 from Bell Labs’s /sources/contrib/fernan/nhc98/src/libraries/fps/tests/linesort.hs

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


{-
Silly program to benchmark sort on smaller strings.  Splits the input
into lines, then sorts the lines.  Try this program on lines of varying
lengths.

Useful for benchmarking sort and lines.
-}

import qualified Data.ByteString.Char8 as P

main =
    print
    . sum
    . map (P.length . P.sort)
    . P.lines
    =<< P.getContents

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

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