Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/docs/bugs/nhc13test4.hs

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


{- Unexpected behaviour from nhc though debatable as to the "correct"
behaviour.  nhc treats "xs" as a function, not a caf, because it
requires a context.  As a result, it runs in constant space whereas
hugs and hbc run in linear space. -}

default (Int)

walk :: [a] -> ()
walk [] = ()
walk (x:xs) = walk xs

main = print (seq (walk xs) (seq x True))
   where xs = [1..10000]
         x = last xs

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].