Friday 29 April 2016

Haskell: GHCi: unset: Unset options

:unset command is used to unset the options set by :set command.

Following are the various options used by both ‘:set’ ‘:unset’ commands.
Option
Description
+m
Allow multiline commands
+r
Revert top-level expressions after each evaluation
+s
Print timing/memory stats after each evaluation
+t
Print type after evaluation
-<flags>     
Most GHC command line flags can also be set here. (eg. -v2, -XFlexibleInstances, etc.)


Prelude> let str1 = "Hello world"
Prelude> str1
"Hello world"
Prelude> 


I used the command ':set +t +s' to get type, time and memory stats after every evaluation.
Prelude> str1
"Hello world"
it :: [Char]
(0.00 secs, 516,992 bytes)
Prelude> 


I used the command ':unset +s' to unset time and memory stats.

Prelude> :unset +s
Prelude> str1
"Hello world"
it :: [Char]






Previous                                                 Next                                                 Home

No comments:

Post a Comment