[Hugs] #80: A curious stack overflow problem

Hugs trac at galois.com
Tue Nov 13 12:56:46 EST 2007


#80: A curious stack overflow problem
--------------------+-------------------------------------------------------
 Reporter:  guest   |       Owner:  nobody
     Type:  defect  |      Status:  new   
 Priority:  major   |   Milestone:        
Component:  hugs    |     Version:  200609
 Keywords:          |  
--------------------+-------------------------------------------------------
 Suppose I define

 > natmin :: [Int] -> Int
 > natmin = foldr1 min
 >  where min x y = if x==0 || x<=y then x else y

 I would expect the same behaviour from

   natmin ([1..10000] ++ [0..])

 as from

   or ([False | i <- [1..10000]] ++ [True | i <- [1..]])

 But the first gives stack overflow, and the second doesn't.

 The problem does not exist with GHCi.

 Richard Bird
 bird at comlab.ox.ac.uk

-- 
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/80>
Hugs <http://www.haskell.org/hugs/>
Hugs 98, an interpreter for Haskell


More information about the Hugs-Bugs mailing list