Commit bf0eb3c9 authored by Camil Staps's avatar Camil Staps

Fix pattern for binumap addition (#213); copy edited text

parent 6f44fac1
......@@ -332,9 +332,13 @@ bs_guard =
bs_generic =
{ syntax_title = "generic function definition"
, syntax_patterns = map exact ["generic", "derive", "of", "with", "\\{\\|.*\\|\\}", "*!"]
, syntax_patterns = map exact ["generic", "derive", "of", "with", "\\{\\|.*\\|\\}", "\\*!"]
, syntax_code = ["generic ... ... [| ...] [*!] :: ... ", "derive ... ... [of ...] [with ...]"]
, syntax_description = "With generics, a kind indexed function can be defined once and derived for (almost) all possible types, to avoid very similar code snippets."
, syntax_description = join " "
[ "With generics, a function can be defined once and derived for (almost) all possible types."
, "This avoids very similar code snippets."
, "Generic functions are said to be kind-indexed, i.e., a generic is actually a group of functions with different types depending on the kind of the deriving type."
]
, syntax_doc_locations = [CLR 9 "7.2" "_Toc311798069"]
, syntax_examples = map EX
[ "generic gEq a :: !a !a -> Bool // The type of a generic function"
......@@ -346,7 +350,7 @@ bs_generic =
, "generic gFun a :: a -> Int | gDefault a // A generic function with a generic context. The context will become an argument.\n" +
"derive gFun CONS of {gcd_arity} with f _ // A derivation that does not use all arguments. The compiler can optimize even more.\n" +
"gFun{|CONS of {gcd_arity}|} f _ = // A derivation that does not use the context and only one field of the generic type descriptor, the compiler can optimize for this."
, "generic gShared a *! :: ... // Derive a generic function using a shared bimap (very experimental, see https://gitlab.science.ru.nl/clean-and-itasks/clean-language-report/blob/master/experimental/binumap.md).\n"
, "generic gShared a *! :: ... // A generic function that will use a bimap without uniqueness attributes (very experimental, see https://gitlab.science.ru.nl/clean-and-itasks/clean-language-report/blob/master/experimental/binumap.md).\n"
]
}
......
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