Here is the reduced `panic' example: ghc-4 -c Bug.hs
ft does not look natural. But after `panic' is fixed, i hope the
original program will work.
By the way, has
class PolLike p where cPMul :: Eq a => a -> p a -> p a
----
sense? I thought, yes.
------------------
Sergey Mechveliani
[EMAIL PROTECTED]
-------------------------------------------------------------------
class PolLike p where cPMul :: Eq a => a -> p a -> p a
class Eq a => AddSemigroup a where add :: a -> a -> a
type UMon a = (a, Integer )
type Monomial a = (a, [Integer])
data UPol a = UPol [UMon a] a String [a]
instance Eq a => Eq (UPol a)
instance PolLike UPol where cPMul _ _ = error ""
instance Eq a => AddSemigroup (UPol a)
ft :: AddSemigroup k => UPol k -> [UPol k]
ft f@(UPol _ c v d) =
let
berl h = let b = [cPMul c h]
fr = map (const []) [cPMul c h]
in
case head fr
of
_:_ -> let es = map (add (UPol [] c v d)) [h]
in berl h
in
berl f