Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "s" mean in the "sprint" GHCi command?

Tags:

haskell

ghci

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 ‘_’.

like image 893
Nicolas Henin Avatar asked Mar 06 '23 08:03

Nicolas Henin


1 Answers

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.

like image 59
duplode Avatar answered Mar 15 '23 04:03

duplode