Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix B: Operators and Symbols

This appendix contains a glossary of Halcyon's syntax, including operators and other symbols.

Operators

SymbolDescription
(unary) - -.arithmetic negation
(unary) notlogical negation
* *.multiplication
/ /.division
%modulus
+ +.addition
- -.subtraction
(function call)
>> <<function composition
xorlogical XOR
orlogical OR
|>function pipe
== != <= >= < >comparison
andlogical AND
;

Non-operator Symbols

The following list contains all symbols that don’t function as operators; that is, they don’t behave like a function.

SymbolDescription
ident : typeType constraint
()Unit literal/Empty tuple
ident : ()Alias for std::unit
(expr,)Single element tuple
(expr, ...)Tuple expression
(type,...)Tuple type
[type]Array type
[expr, ...]Array literal
ident::identModule path
ident = exprAssignment
{ident,...}Struct type
{expr,...}Struct literal
ident.identStruct field access
pat | patPattern alternatives
type | typeSum type alternatives
pat => exprPart of match arm syntax
signature => exprPart of function syntax
_Wildcard pattern match
_“Ignored” pattern binding
--Line comment
(*...*)Block Comment