RE: cvs commit: fptools/ghc/compiler/hsSyn HsUtils.lhs fptools/ghc/compiler/typecheck TcRnDriver.lhs TcRnMonad.lhs TcUnify.lhs

2005-05-23 Thread Simon Marlow
On 22 May 2005 14:17, Jim Apple wrote:

 Simon Peyton Jones wrote:
 
   - For command-line 'let' and 'x-e' forms, if exactly one variable
 is bound, we print its value if it is Showable and not ()  
  prompt let x = 4 4
  prompt x - return 5
  5
 
 prompt let ones = [1:x]
 
 What am I to do if I want ones set, but not printed?

I think you mean

  let ones = 1:ones

but it's a good point.  At the moment you can hack around it with

  let ones = 1:ones; x=x

(for example).

Simon: I think let bindings should be exempt from the new auto-show
behaviour.  The docs currently say that let doesn't evaluate its rhs:

  An important difference between the two types of binding is that the
  monadic bind (p - e) is strict (it evaluates e), whereas with the let
  form, the expression isn't evaluated immediately:

and the example that follows that paragraph is currently wrong (the let
binding will yield an exception).

Cheers,
Simon
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: cvs commit: fptools/ghc/compiler/hsSyn HsUtils.lhs fptools/ghc/compiler/typecheck TcRnDriver.lhs TcRnMonad.lhs TcUnify.lhs

2005-05-22 Thread Jim Apple

Simon Peyton Jones wrote:


  - For command-line 'let' and 'x-e' forms, if exactly one variable
is bound, we print its value if it is Showable and not ()
prompt let x = 4
4
prompt x - return 5
5


prompt let ones = [1:x]

What am I to do if I want ones set, but not printed?

Jim

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users