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

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


-- FIXED.

{-
Should not give an internal error on compilation.

nhc13 reports:
-------------------------------------------------------------------------------
/grp/haskell/mw-nhc13/lib/IRIX/nhc13comp: Error: Internal: CtxsSimplify expanded the type synonym (187 39) to (187 39)
Internal: expected a type constructor
-------------------------------------------------------------------------------
whereas hbc reports:
-------------------------------------------------------------------------------
Errors:
"nhc13test6.hs", line 11, [102] No instance Prelude.Num (a2979 Int) in  Prelude.fromInteger 0I
 in newNode in eg

Compilation aborted
-------------------------------------------------------------------------------
and hugs1.4 reports:
-------------------------------------------------------------------------------
Reading file "nhc13test6.hs":
Type checking      
ERROR "nhc13test6.hs" (line 9): a Int is not an instance of class "Num"
-------------------------------------------------------------------------------
-}

class Queue t where
   emptyQ :: t Int
newtype StrictNull a = StrictNull ()
instance Queue StrictNull where
   emptyQ = StrictNull ()

data Queue t => Test t = Test (t Int)

eg = newNode `seq` True
   where newNode = Test 0

main = print eg

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