Hyper Dictionary

English Dictionary Computer Dictionary Video Dictionary Thesaurus Dream Dictionary Medical Dictionary


Search Dictionary:  

Meaning of RECURSIVE TYPE

 
Computing Dictionary
 
 Definition: 

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)

 

 

COPYRIGHT © 2000-2013 HYPERDICTIONARY.COM HOME | ABOUT HYPERDICTIONARY