hugs-users-admin | 2 Mar 2003 02:07
Favicon

Your message to Hugs-Users awaits moderator approval

Your mail to 'Hugs-Users' with the subject

    Sos!

Is being held until the list moderator can review it for approval.

The reason it is being held:

    Message body is too big: 131572 bytes but there's a limit of 40 KB

Either the message will get posted to the list, or you will receive
notification of the moderator's decision.
Daniel McNeill | 3 Mar 2003 01:35
Picon
Favicon

Concurrent Haskell bug?

{-
Hi,

Possible Concurrent Haskell bug

Here is an attempt at concurrent, data-driven assertions for Haskell.
The code has been simplified to just work for type Char:
-}

import Concurrent
import IOExts(unsafePerformIO)

assert :: (Char -> Bool) -> Char -> Char
assert p x    = unsafePerformIO $ do
            mv <- newEmptyMVar
            forkIO $ check p (listen mv)
            return (demand mv x)

check :: (a -> Bool) -> a -> IO ()
check p x
  | p x        = return ()
  | otherwise    = putStrLn "Assertion failed!"

demand :: MVar Char -> Char -> Char
demand mv c = unsafePerformIO $ do putMVar mv c; yield; return c

listen :: MVar Char -> Char
listen mv = unsafePerformIO $ takeMVar mv

main :: IO ()
(Continue reading)

Mark Tullsen | 6 Mar 2003 02:00
Picon

type inference bug

Here's a (serious) bug in the type-inferencer of the November 2002 Hugs (tested
using hugs98-Nov2002-rh7.3-1.i386.rpm):

   data T a b = T {f1 :: a, f2 :: b}
   updateF1 x t = t{f1 = x}

   the type inferred for updateF1:
     observed behavior:
       updateF1 :: a -> T b c -> T a d
     expected behavior:
       updateF1 :: a -> T b c -> T a c

FYI, this bug didn't exist in the Dec 2001 version.

- Mark
Jeffrey R Lewis | 6 Mar 2003 02:08
Favicon

Re: type inference bug


On Wednesday, March 5, 2003, at 05:00 PM, Mark Tullsen wrote:

> Here's a (serious) bug in the type-inferencer of the November 2002 
> Hugs (tested
> using hugs98-Nov2002-rh7.3-1.i386.rpm):
>
>   data T a b = T {f1 :: a, f2 :: b}
>   updateF1 x t = t{f1 = x}
>
>   the type inferred for updateF1:
>     observed behavior:
>       updateF1 :: a -> T b c -> T a d
>     expected behavior:
>       updateF1 :: a -> T b c -> T a c
>
> FYI, this bug didn't exist in the Dec 2001 version.
>

Mark:

     Slurp in a fresh version from CVS.  I suspect that's the bug I 
introduced, and was kindly spotted and fixed by Ross Patterson.

--Jeff
Henk-Jan.van.Tuyl | 6 Mar 2003 15:58

Hugs documentation update


L.S.,

The web page http://cvs.haskell.org/Hugs/pages/hugsman/libs.html states:
  The libraries Directory, Time, and CPUTime, are not currently supported.
As there are files Directory.hs, Time.hs, and CPUTime.hs in the {Hugs}\lib 
directory, I suppose this is not true anymore.

Greetings,
Henk-Jan van Tuyl

--

-- 
Mike Gunter | 14 Mar 2003 08:06

Direct use of if-then-else with function type cause "Program error"


With the following code

> run f = f 7 (-3)

> programError wd initVal = (if initVal < 0 then showAsUnsiged else const show) wd initVal
> noProblem wd initVal	  = f wd initVal  where f = if initVal < 0 then showAsUnsiged else const show

> showAsUnsiged width nIn	= show n  where n | nIn < 0	= 2^width + nIn
>                                                 | otherwise	= nIn

I get:

    $ hugs HugsIfFuncBug.lhs 
    __   __ __  __  ____   ___      _________________________________________
    ||   || ||  || ||  || ||__      Hugs 98: Based on the Haskell 98 standard
    ||___|| ||__|| ||__||  __||     Copyright (c) 1994-2002
    ||---||         ___||           World Wide Web: http://haskell.org/hugs
    ||   ||                         Report bugs to: hugs-bugs <at> haskell.org
    ||   || Version: November 2002  _________________________________________

    Haskell 98 mode: Restart with command line option -98 to enable extensions

    Reading file "/usr/lib/hugs/libraries/Hugs/Prelude.hs":
    Reading file "/usr/lib/hugs/libraries/Prelude.hs":
    Reading file "HugsIfFuncBug.lhs":

    Hugs session for:
    /usr/lib/hugs/libraries/Hugs/Prelude.hs
    /usr/lib/hugs/libraries/Prelude.hs
(Continue reading)

Scott Turner | 17 Mar 2003 13:05
Picon
Favicon

Hugs internal error, parsing

I'm using  :version
-- Hugs Version November 2002

If I make a .hs file with the two lines:
import Maybe
Need.

And do a :load IE.hs, the output is
Reading file "IE.hs":
Reading file "/usr/local/lib/hugs/lib/Maybe.hs":
Reading file "IE.hs":
INTERNAL ERROR: parseInput
Dennis Sidharta | 18 Mar 2003 02:13

MarshalUtils.hs

I tried to run a program that imports SOEGraphics, and I got this error message when hugs tried to read MarshalUtils.hs:

"Reading file ...
 ...
 Reading file "C:\Program Files\Hugs98\lib\exts\MarshalUtils.hs":
 Parsing
 ERROR "C:\Program Files\Hugs98\lib\exts\MarshalUtils.hs":2 - 
 Syntax error in module definition (unexpected keyword "with";
 possible cause: -W option not used.) "

FYI, I am using WinXP.
--

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
hugs-users-admin | 18 Mar 2003 17:45
Favicon

Your message to Hugs-Users awaits moderator approval

Your mail to 'Hugs-Users' with the subject

    A very  new website

Is being held until the list moderator can review it for approval.

The reason it is being held:

    Message body is too big: 143966 bytes but there's a limit of 40 KB

Either the message will get posted to the list, or you will receive
notification of the moderator's decision.
Christian Maeder | 20 Mar 2003 19:40
Picon
Favicon

existential types and functional dependencies

The following module is accepted by ghc (with -fglasgow-exts) but 
rejected by hugs:

module ParseAny where

class Syntax tag as | tag -> as where
     parse :: tag -> String -> as

data AnyAs = forall tag as. Syntax tag as =>
	     MkAs tag as

data AnyTag = forall tag as. Syntax tag as =>
	      MkTag tag

parseAny :: AnyTag -> String -> AnyAs
parseAny (MkTag tag) str = MkAs tag $ parse tag str

-- -------------------------------------------------------

Hugs mode: Restart with command line option +98 for Haskell 98 mode

Reading file "/home/linux-bkb/hugs/lib/hugs/libraries/Hugs/Prelude.hs":
Reading file "/home/linux-bkb/hugs/lib/hugs/libraries/Prelude.hs":
Reading file "ParseAny.hs":
Type checking
ERROR "ParseAny.hs":13 - Cannot justify constraints in explicitly typed 
binding
*** Expression    : parseAny
*** Type          : AnyTag -> String -> AnyAs
*** Given context : ()
(Continue reading)


Gmane