[Hugs-users] Pattern match failure leads to lots of output

Ross Paterson ross at soi.city.ac.uk
Fri Sep 1 12:51:37 EDT 2006


On Fri, Sep 01, 2006 at 05:41:44PM +0100, Neil Mitchell wrote:
> Here is a small failing example, with context and stuff its hard to
> know when I get it minimal:
> 
> >data Maybe1 a = Just1 a | Nothing1 deriving Eq
> >data Maybe2 a = Just2 (Maybe1 a) | Nothing2 deriving Eq
> >crash_me = g (Just2 (Just1 1))
> >g x = f Nothing2
> >    where f y | x == y && False = undefined
> 
> Run crash_me to see a lot of output.

OK, that gives:

	pattern match failure: g_v1624 (Num__sc0_Num instNum_v32) (Maybe2_Just2 (Maybe1_Just1 (Num_fromInt instNum_v32 1))) Maybe2_Nothing2

after my patch:

	pattern match failure: g (Just2 (Just1 (fromInt 1))) Nothing2

which is almost readable.  Maybe I should hide fromInt/fromDouble too.



More information about the Hugs-Users mailing list