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

Simon Marlow simonmar at
Mon May 23 06:43:10 EDT 2005

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).


More information about the Glasgow-haskell-users mailing list