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 

recursive type

A data type which contains itself. The commonest example is the list type, in Haskell:

		data List a = Nil | Cons a (List a)

which says a list of a's is either an empty list or a cons cell containing an 'a' (the "head" of the list) and another list (the "tail").

Recursion is not allowed in Miranda or Haskell synonym types, so the following Haskell types are illegal:

		type Bad = (Int, Bad)
		type Evil = Bool -> Evil

whereas the seeminly equivalent algebraic data types are acceptable:

		data Good = Pair Int Good
		data Fine = Fun (Bool->Fine)

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

Computer Dictionary Online
Copyright © 2017