4

What does "s" mean in the name of the :sprint GHCi command? This is the description from the official documentation, to give you some context:

sprint : Prints a value without forcing its evaluation. :sprint is similar to :print, with the difference that unevaluated subterms are not bound to new variables, they are simply denoted by ‘_’.

duplode
  • 33,731
  • 7
  • 79
  • 150
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42

2 Answers2

7

As you have seen, the description of :sprint in the GHC User's Guide says nothing on the matter. According to the :sprint entry in Julie Moronuki and Chris Martin's typeclasses.com...

The s stands for “simple,” the idea being that :sprint is in some sense a simplified version of the :print command, since :sprint does less work.


could it be 's' for strictness ?

Presumably not, as much of the point of :sprint and :print is that they are, in a sense, lazier than the print function.

duplode
  • 33,731
  • 7
  • 79
  • 150
1
  1. type ghci

  2. type :?

  3. You will get: Commands available from the prompt:

  4. Look for the sprintf: documentation

    :sprint [<name> ...] simplified version of :print

Community
  • 1
  • 1
Sagi
  • 8,972
  • 3
  • 33
  • 41