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