Computer Dictionary Online

Medical Dictionary   Law Dictionary   Legal Dictionary   Website Design

0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 


head-strict

<theory> A head-strict function will not necessarily evaluate every cons cell of its (list) argument, but whenever it does evaluate a cons cell it will also evaluate the element in the head of that cell. An example of a head-strict function is

		beforeZero :: [Int] -> [Int]
		beforeZero []     = []
		beforeZero (0:xs) = []
		beforeZero (x:xs) = x : beforeZero xs


which returns a list up to the first zero.

This pattern of evaluation is important because it is common in functions which operate on a list of inputs.

See also tail-strict, hyperstrict.

(1995-05-11)


Contact the Computer Dictionary Online  ::  Link to the Computer Dictionary Online  ::  Disclaimer for Computer Dictionary Online

Computer Dictionary Online
Copyright © 2017