home > 比較編 > F#, Scala, Haskell > data types >

ForNext

Only Do What Only You Can Do

080. recursive type

VBScript

JScript

Perl

PHP

Python

Ruby

PowerShell

Scala

abstract class BinaryTree
case class Tree(left: BinaryTree, right: BinaryTree) extends BinaryTree
case class Leaf(x: Int) extends BinaryTree

F#

OCaml

type binary_tree = Leaf of int | Tree of binary_tree * binary_tree;;


Haskell

data BinaryTree = Leaf Integer | Tree BinaryTree BinaryTree


C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

inserted by FC2 system