Package hydra.lib.lists
Class Cons
java.lang.Object
hydra.tools.PrimitiveFunction
hydra.lib.lists.Cons
Prepends an element to a list.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class hydra.tools.PrimitiveFunction
term, toNative
-
Field Details
-
NAME
-
-
Constructor Details
-
Cons
public Cons()
-
-
Method Details
-
name
Description copied from class:PrimitiveFunctionThe unique name of the primitive function.- Specified by:
namein classPrimitiveFunction- Returns:
- the name of this primitive function
-
type
Description copied from class:PrimitiveFunctionThe datatype of the primitive function.- Specified by:
typein classPrimitiveFunction- Returns:
- the type scheme of this primitive function
-
implementation
Description copied from class:PrimitiveFunctionA dynamic/interpreted implementation of the function.- Specified by:
implementationin classPrimitiveFunction- Returns:
- the function implementation
-
apply
Apply the function to both arguments.- Type Parameters:
X- the element type- Parameters:
el- the element to prependl- the list to prepend to- Returns:
- the list with the element prepended
-