Description Usage Arguments Details
Access, set, and print function types
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
f |
any function |
x |
type string |
role |
['well', 'pipe', 'sink'] |
value |
character string |
Functional types are based on Haskell types. For example, a function that sums two integers, might have the type, 'Int -> Int -> Int'. The first 2 'Int's are the input integers, that last is the output. Every hnode has a type attribute, which contains $n+1$ elements in a character vector, where $n$ is the number of inputs.
*htype* prints the type character vector, *ip* prints the input types (all but the last elements), and *op* prints the output type (the last element of the type vector). *nhtypes* counts the number of inputs. *type_str* converts from a character vector to a Haskell syntax function definition.
*parse_type* attempts to extract a type (as a character vector) from whatever input it is given. Legal input is 1) Haskell style type (e.g. 'a -> b') or 2) a character vector or 3) an object with a non-NULL htype attribute. Anything else will result in an error.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.