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

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


{- This should strictly speaking cause a complaint as `head' is being
redefined after being defined in the Prelude.  Personally I prefer
nhc's behaviour, but it should be noted that this is not standard
Haskell behaviour. -}

head :: [a] -> Maybe a
head [] = Nothing
head (x:xs) = Just x

main :: IO ()
main = print (head [True])

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].