Difference between revisions of "Strictness without ordering, or confusion"

From HaskellWiki
Jump to navigation Jump to search
(Created page with "Category:Proposals As the Haskell 2010 Report does not specify any order of evaluation with respect to its parameters, the name of the primitive <code>seq :: a -> b -> b...")
 
m (Reference added)
 
(One intermediate revision by the same user not shown)
Line 20: Line 20:
   
 
If needed, "amidst" is one alternate basename for the ''deepseq'' library and its definitions.
 
If needed, "amidst" is one alternate basename for the ''deepseq'' library and its definitions.
  +
  +
References:
  +
  +
* [https://mail.haskell.org/pipermail/glasgow-haskell-users/2006-November/011480.html Thread: seq vs. pseq], Haskell mail archive.
  +
  +
* [https://gitlab.haskell.org/ghc/ghc/-/issues/5129 Ticket# 5129: "evaluate" optimized away]; GHC bug tracker.
  +
   
 
[[User:Atravers|Atravers]] 01:17, 7 January 2019 (UTC)
 
[[User:Atravers|Atravers]] 01:17, 7 January 2019 (UTC)

Latest revision as of 00:16, 8 September 2020


As the Haskell 2010 Report does not specify any order of evaluation with respect to its parameters, the name of the primitive seq :: a -> b -> b is a misnomer.

Introduce the primitive amid, with the same (Haskell 2010 Report) requirements:

         infixr 0 `amid`
         primtive amid :: a -> b -> b

         infixr 0 $!
         ($!) :: (a -> b) -> a -> b
         f $! x =  x `amid` f x


This frees the name "seq" for use with a new primitive, analogous to the GHC primitive pseq, but not restricted to parallel programming.

If needed, "amidst" is one alternate basename for the deepseq library and its definitions.

References:


Atravers 01:17, 7 January 2019 (UTC)