FORTRAN and HASKELL

2001-11-29 Thread clusterpoli
Somebody works with together FORTRAN and Haskell. Exists some funcao to transform codigo FORTRAN into codigo HASKELL? Thanks, Allan Bruno __ AcessoBOL, só R$ 9,90! O menor preço do mercado! Assine já!

Re: FORTRAN and HASKELL

2001-11-29 Thread Christopher Milton
--- clusterpoli [EMAIL PROTECTED] wrote: Somebody works with together FORTRAN and Haskell. Exists some funcao to transform codigo FORTRAN into codigo HASKELL? TXL might help, but it's its own functional language. It can probably convert FORTRAN to Haskell given the EBNF for each language, but

RE: IO errors

2001-11-29 Thread Simon Marlow
A quick look at the source looks like both GHC and NHC will simply pass on errors from the OS, so for example with module Main where import IO import Directory main :: IO() main = do catch (createDirectory this/does/not/exist/foo) (\e -

RE: IO errors

2001-11-29 Thread Simon Peyton-Jones
| Two possibilities: either createDirectory should act like | 'mkdir -p' and make the whole path, or the library report | should document isDoesNotExistError as a possible error | thrown by createDirectory. I'd vote for the latter. I'm willing to do that for H98 unless anyone can think of a

RE: Possible bug/omission in Numeric library?

2001-11-29 Thread Simon Peyton-Jones
| However, I would guess that changing the type signature of | the current showInt function is unacceptable for Haskell'98. | Maybe we should consider adding the more general version | under a new name like showIntBase, together with | show{Dec,Oct,Hex}? This would break no existing code,

Global variables

2001-11-29 Thread Juan Ignacio García García
Hello, I am interested in using global variables (in GHC). I need a variable to store list of Integers to store temporary results. I have been reading the module MVar, but I wonder if there is an alternative way of doing it. I have already implemented my function using an auxiliar argument

Re: Possible bug/omission in Numeric library?

2001-11-29 Thread Malcolm Wallace
As you say, we can't change the type of showInt. I suppose we could add: showIntAtBase :: Integral a=20 =3D a-- base - (a - Char) -- digit to char - a-- number to show. - ShowS showOct, showHex :: Integral a =3D

Re: Global variables

2001-11-29 Thread Dmitry Astapov
JIGG alternative way of doing it. I have already implemented my function JIGG using an auxiliar argument where I put my lists of Integers. Will JIGG the use of a global variable improve my function? There is no such thing as mutable variable (as in imperative languages) in Haskell (and my

Confused about Random

2001-11-29 Thread Ian Lynagh
With the following module: module Main where import Random data Foo = Foo StdGen main :: IO() main = do let rs = randoms (Foo (mkStdGen 39)) :: [Int] rRs = randomRs (0,9) (Foo (mkStdGen 39)) :: [Int] putStrLn $ show $ take 100 rs

Re: Possible bug/omission in Numeric library?

2001-11-29 Thread Alastair David Reid
Also, GHC's NumExts has doubleToFloat :: Double - Float floatToDouble :: Float - Double Q2: If we are going to run round adding functions to Numeric, should we add those too? It's hard to know where to stop... but if that conversion is what you want to do, H98 doesn't give a good

Re: Global variables

2001-11-29 Thread Alastair David Reid
Hello, I am interested in using global variables (in GHC). I need a variable to store list of Integers to store temporary results. I have been reading the module MVar, but I wonder if there is an alternative way of doing it. I have already implemented my function using an auxiliar

Re: Where to ask questions regarding categories and datatypes

2001-11-29 Thread C.Reinke
Peter Douglass writes: Hi, I have a number of questions regarding categories and datatypes. I know that many of the folk in this mailing list could answer these question, but I wonder if there is a more appropriate forum. (i.e. the question are not Haskell specific).

Re: Global variables

2001-11-29 Thread C.Reinke
Hello, I am interested in using global variables (in GHC). I need a variable to store list of Integers to store temporary results. I have been reading the module MVar, but I wonder if there is an alternative way of doing it. I have already implemented my function using an auxiliar

Re: Global variables

2001-11-29 Thread Ashley Yakeley
At 2001-11-29 05:31, Juan Ignacio García García wrote: I am interested in using global variables (in GHC). In JVM-Bridge (nearly there!) I use lifted monads to store global constants, though variables are not hard either. This does mean an extra function needed to call IO functions, but in my

Re: Global variables

2001-11-29 Thread Ashley Yakeley
At 2001-11-29 11:13, Ashley Yakeley wrote: Lifted monads look something like this: data MyAction a = MkMyAction ((consts,vars) - (vars,a)); instance Monad MyAction where etc. Whoops, should be data MyAction a = MkMyAction ((consts,vars) - IO (vars,a)); -- Ashley Yakeley,

Strictness making it worst?

2001-11-29 Thread Jorge Adriano
Hi, I've just started messing around with strictness. My goal now is understanding when and how to use it. I began with simple examples like making a strict foldl. When trying to sum a list of 6 elements with lazy foldl I'd get a stack space overflow, with a strict foldl I was able to sum

Re: Strictness making it worst?

2001-11-29 Thread Jorge Adriano
Then I tried: sfibac :: IntPos - (IntPos,IntPos) - (IntPos,IntPos) sfibac n (a,b) | n == 0= (a,b) | otherwise = sfibac (n-1) (b, (+b) $! a) I'm sorry I meant: sfibac :: IntPos - (IntPos,IntPos) -