Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
3 user(s) are online (3 user(s) are browsing encyclopedia)

Members: 0
Guests: 3

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Recursive type

In computer programming languages, a recursive type is a data type for values that may contain other values of the same type.

An example is the list type, in Haskell programming language:

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

This indicates that 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 programming language or Haskell synonym types, so the following Haskell types are illegal:

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

Conversely, the seemingly equivalent algebraic data types are acceptable:

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

= See also =

  • Recursion
  • Algebraic data type