Commit b4d7cb3f authored by Mart Lubbers's avatar Mart Lubbers

Add unique variables and dot notation

parent 1bd3179e
......@@ -496,13 +496,17 @@ bs_synonym_abstract =
bs_unique =
{ syntax_title = "uniqueness annotation"
, syntax_patterns = ["\\*"]
, syntax_code = ["*..."]
, syntax_description = "Annotates a type to be unique."
, syntax_patterns = ["\\*", "[", "]", "."]
, syntax_code =
["*..."
,". ..."
,"v ... | [v ..]"
, syntax_description = "Annotates a type with its uniqueness. A type can either be unique (`*`), not unique (not annotated), possibly unique (`.`) or relatively unique (identifier and `| [..]`). Note that when using unique types in a function or an ADT the container must also be unique. e.g. `T = T (Int, *File)` has to be `T = T *(Int, *File)`. Functions have to be split up into arity 1 and the sub functions need to be annotated as well. e.g. `T = T (Int *Int -> *Int)` has to be `T = T (Int -> *(*Int -> *Int))`."
, syntax_doc_locations = [CLR 11 "9.1" "_Toc311798093"]
, syntax_examples = map EX
[ "Start :: *World -> *World"
, "copyArray :: *(a e) -> *(*a e, *a e) | Array a e"
[ "Start :: *World -> *World //World is unique"
, "f :: .a -> .a //f works on unique and non-unique values"
, "f :: v:a u:b -> u:b | [v<=u] //f works when a is less unique than b"
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment