hugs / ghc difference over '(..)' imports

2002-02-17 Thread Duncan Coutts
There is a difference between hugs and ghc in how they treat imports with the '(..)' notation. Here's my example: module CTree( --other stuff Const(..) ) where import ATree (Const) --const has constructors CInt, CChar, CStr under hugs this module exports CInt, CChar, CStr

'Pretty' does not export ($+$)

2002-02-17 Thread Duncan Coutts
The pretty printing module 'Pretty' in the text package does not export the ($+$) operator. The documentation says it does (and it certianly should). I'm using ghc 5.02.1 Duncan ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED]

Re: 'Pretty' does not export ($+$)

2002-02-17 Thread Sigbjorn Finne
Strange, the following compiles just fine with 5.02.1 on a Win2k box: module Foo where { import Pretty ; x y = y Pretty.$+$ y } --sigbjorn - Original Message - From: Duncan Coutts [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 17, 2002 16:13 Subject: 'Pretty' does not

Strictness information?

2002-02-17 Thread Till Dörges
Hi folks, during the struggle for speed of my program, I've tried to check the strictness of my functions, where most of the time is consumed. Unluckily the ghc documentation doesn't mention the strictness-types I found for the most part. :-( For the particular function in question it reads

Re: The size of things

2002-02-17 Thread Ketil Z. Malde
Simon Marlow [EMAIL PROTECTED] writes: data STuple = STuple !Int Foo is slightly less efficient than using a normal tuple (Int,Foo) Just checking... with -funbox-strict-fields, right? Yep. It's possible that the boxed Int is being reconstructed for some reason.

haskell sparse matrices

2002-02-17 Thread Hal Daume III
Are there any Haskell libs for dealing with sparse matrices (or even just libraries for writing to and reading from a standard format, say, harwell boeing? - Hal -- Hal Daume III Computer science is no more about computers| [EMAIL PROTECTED] than astronomy is about telescopes.

Re: ideas for compiler project

2002-02-17 Thread Jay Cox
On Sat, 16 Feb 2002, Dylan Thurston wrote: On Thu, Jan 24, 2002 at 03:38:59PM +0100, Bjorn Lisper wrote: I think MATLAB's matrix language provides about the right level of abstraction for a high-level matrix language. You can for instance write things like Y = inv(A)*B to assign

Composition Monad

2002-02-17 Thread Andre W B Furtado
Roughly speaking, I'm in need of a monad (say MyIO) that interprets the following code f :: MyIO () f = do action1 action2 action3 ... return () as applying action1 to g, then action2 to the SAME g (not the result of action1) and so on... Of course,

Re: Composition Monad

2002-02-17 Thread Hal Daume III
I'm not sure exactly what you mean. Say I have something like that, then what's the difference between saying: f = do { action1; action2; action3 } and simply f = do action3 ? If the result of each of the actions is ignored for the following ones, why do we need to do this

Composition Monad

2002-02-17 Thread Tom Pledger
Andre W B Furtado writes: | Roughly speaking, I'm in need of a monad (say MyIO) that interprets the | following code | | f :: MyIO () | f = do | action1 | action2 | action3 | ... | return () | | | as applying action1 to g, then action2 to

Re: Composition Monad

2002-02-17 Thread Ashley Yakeley
At 2002-02-17 18:52, Tom Pledger wrote: I think it's called a reader monad or an environment monad. Here's a fairly simple version: I made one here: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/jvm-bridge/sourc e/Haskell/ContextMonad.hs?rev=HEADcontent-type=text/plain --

add something to a list

2002-02-17 Thread christophe certain
Hi, I'm a poor lonesome newbie in Haskell world, and I would like to add a string typed on the prompt to a list of strings which is already defined. It would look like something like : type Path = [String] currentPath::Path currentPath = [] getpiece ::IO String getpiece = do c -getLine

Re: add something to a list

2002-02-17 Thread Adrian Hey
On Sunday 17 February 2002 08:20, christophe certain wrote: Hi, I'm a poor lonesome newbie in Haskell world, and I would like to add a string typed on the prompt to a list of strings which is already defined. It would look like something like : type Path = [String] currentPath::Path

Re: add something to a list

2002-02-17 Thread Cagdas Ozgenc
You seem to expect currentPath to be updated by putpiece? This won't happen in Haskell. Once you've declared currentPath=[] it will always be []. Values never change. If you want the functional equivalent of accumulator variables they have to be an argument of a recursive

Re: add something to a list

2002-02-17 Thread Jay Cox
On Sun, 17 Feb 2002, Cagdas Ozgenc wrote: Hi Adrian, How can I add a function that sorts this list that I read from the user and accumulate using the function that you described? I am not asking for a sort algorithm of course, I am just wondering how to feed the IO Path as an input to a

Re: add something to a list

2002-02-17 Thread Mark Carroll
On Sun, 17 Feb 2002, Jay Cox wrote: (snip) PS: Anybody got any other suggestions for IO monad entry-level docs? (snip) Simon's Tackling the Awkward Squad paper was a revelation for me. -- Mark ___ Haskell-Cafe mailing list [EMAIL PROTECTED]

Re: syntax...(strings/interpolation/here docs)

2002-02-17 Thread Carl R. Witty
Claus Reinke [EMAIL PROTECTED] writes: Haskell definitely supports abstraction and composition, so we can factor out application aspects (not just text) that need localisation, and link them (dynamically?) with the main parts of our applications. Some systematic approach would be useful,

order of evaluation ?

2002-02-17 Thread Konst Sushenko
Title: Message hello, below is the code that i wrote as an excercise for myself (I am still learning haskell). it implements a straighforward way to simplify boolean expressions, and should be self-explanatory. my question is, if i have an expression such as ((Const False) :: subexp),

re: order of evaluation ?

2002-02-17 Thread Bernard James POPE
konst writes: my question is, if i have an expression such as ((Const False) :: subexp), will subexp be reduced first (according to the definition 'simplify (x :: y) = simplify' ((simplify x) :: (simplify y))') or will laziness do the right thing, and emit (Const False) without looking into