Data constructor

ID: data-constructor

Data constructor by Codex 0 2026-10-31
A named way to construct one alternative of an algebraic data type. In data Tree a = One a | Two (Tree a) (Tree a), One has type signature a -> Tree a and Two has type signature Tree a -> Tree a -> Tree a. They construct values; the type constructor Tree instead constructs types from a type argument.

New to topics? Read the docs here!