George:
I know what the problem is now. Thanks for the report.
It's a little wierd. We're getting a binding
x :: forall a. Word#
x = /\ a -> int2Word( 0 )
floated up to the top level. But you can't have a top-level
binding of unlifted type.
The predicate that spots such things is called
isUnLiftedType
in Type.lhs. I've changed it to read as below.
But I don't have time to test this change properly, and I don't want
to check it in till I have.
I'm about to go away for a week, so I'm just emailing this
fix to you. Try it in your copy!
thanks for the report.
Simon
=====================================================
isUnLiftedType :: Type -> Bool
-- isUnLiftedType returns True for forall'd unlifted types:
-- x :: forall a. Int#
-- I found bindings like these were getting floated to the top
level.
-- They are pretty bogus types, mind you. It would be better never
to
-- construct them
isUnLiftedType (ForAllTy tv ty) = isUnLiftedType ty
isUnLiftedType (NoteTy _ ty) = isUnLiftedType ty
isUnLiftedType (TyConApp tc _) = isUnLiftedTyCon tc
isUnLiftedType other = False
====================================================
> -----Original Message-----
> From: George Russell
> Sent: Friday, July 16, 1999 3:17 PM
> To: Simon Peyton-Jones
> Subject: Re: Panic!
>
>
> Simon Peyton-Jones wrote:
> >
> > George
> >
> > If this still happens with an up-to-date checkout (we have
> > fixed things *like* this recently) pls do send us your source code.
> Yes, it does still occur. Attached are the three files
> HPCTEIntrinsics.hs, HPcteMem.hs, HPcteBitSet.hs, which cause
> the problem,
> to be compiled in that order. By hacking around with the last file,
> which causes the problem, I've narrowed the error down to the
> following
> code (I think). So it looks as if you are having trouble with
> making [] an instance of something. If you can't fix this right away
> and could suggest a workaround I'd be grateful, as it's
> holding everything
> up. Many thanks
>
> George Russell
>
> class (Show bse) => PcteBitSetElementClass bse where
> toPcteBitSetElement :: bse -> Int
> fromPcteBitSetElement :: Int -> bse
>
>
> class PcteBitSetClass bs where
> toPcteBitSet :: (PcteBitSetElementClass bse) => (bs
> bse) -> PcteBitSet bse
> fromPcteBitSet :: (PcteBitSetElementClass bse) =>
> PcteBitSet bse -> (bs bse)
>
>
> instance PcteBitSetClass PcteBitSet where
> toPcteBitSet = id
> fromPcteBitSet = id
>
>
> instance PcteBitSetClass [] where
> toPcteBitSet l = mkBS (map toPcteBitSetElement l)
> fromPcteBitSet bs = map fromPcteBitSetElement (listBS bs)
>