Whenever an expression is evaluated at
GHCi prompt, GHCi implicitly binds the value to the variable 'it'.
Prelude> 1 + 2 * 3 7 Prelude> it 7 Prelude> Prelude> "Hello" ++ "World" "HelloWorld" Prelude> it "HelloWorld" Prelude>
If the evaluation of expression fails,
then GHCi don't change the value of the variable 'it'.
Prelude> 1+ 2*3 7 Prelude> it 7 Prelude> Prelude> 10/-0 <interactive>:36:3: Not in scope: ‘/-’ Perhaps you meant one of these: ‘-’ (imported from Prelude), ‘/’ (imported from Prelude), ‘/=’ (imported from Prelude) Prelude> Prelude> it 7
No comments:
Post a Comment