Error: "Cannot open file '...'"

Nick Kallen phantom@earthlink.net
Mon, 12 Jan 1998 12:56:26 -0800


I'm writing a second version of my Clean CGI app, basing it on Erik Meijer's
rather elegent Haskell CGI library.
    Erik makes extensive use of monads in his application. I have decided to
do something similar. Since (thankfully) Clean doesn't have the
(anti-orthogonal) "do" construct, I decided to build my own monad-related
operators extending beyond `bind` and return's functionality. I thus defined
>>| and >>+. Their definitions are provided in the appended application.

Now, the reason I'm writing this letter is because I *think* I've found a
bug in the compiler(?). When I tried to 'Run' the appended program, I get
the error (in the errors window): Cannot Open File '<filename.o>'" 'Syntax
Check' and 'Compile' work perfectly. But 'Run' produces this error. BTW, I'm
using 1.2.4 on Win95.

Here is the application. (This is a sort of prototype for the app, so
there's massive stubbing)

module CGI
import StdEnv

:: Request  :== Int
:: Response :== Int

wrapper :: (Request -> Response) -> (a -> a)
wrapper worker =
     getRequest >>+
     worker  >>|
     putResponse

(>>|) infixl 0 :: (St s a) (a -> (s -> s)) -> (s -> s)
(>>|) f_sta a_stb = stb
 where
     stb st = a_stb a st`
     where
         (a, st`) = f_sta st

(>>+) infix 0 :: (St s a) (a -> b) -> St s b
(>>+) f_sta a_b = stb
 where
    stb st = (a_b a, st`)
    where
        (a, st`) = f_sta st

getRequest = return 5
putResponse = flip K

Start = wrapper ((-) 1) "world"

// I was hoping to get Start = 4....

-Nick