File: get_type_arity.doc

package info (click to toggle)
hol-light 20170109-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,568 kB
  • ctags: 8,549
  • sloc: ml: 540,018; cpp: 439; lisp: 286; java: 279; makefile: 262; sh: 229; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (31 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\DOC get_type_arity

\TYPE {get_type_arity : string -> int}

\SYNOPSIS
Returns the arity of a type constructor.

\DESCRIBE
When applied to the name of a type constructor, {arity} returns its arity, i.e. 
how many types it is supposed to be applied to. Base types like {:bool} are 
regarded as constructors with zero arity.
 
\FAILURE
Fails if there is no type constructor of that name.

\EXAMPLE
{
  # get_type_arity "bool";;
  val it : int = 0

  # get_type_arity "fun";;
  val it : int = 2

  # get_type_arity "nocon";;
  Exception: Failure "find".
}

\SEEALSO
new_type, new_type_definition, types.

\ENDDOC