Commit ce84b0fa authored by Mart Lubbers's avatar Mart Lubbers

Fix issue from pr #196

parent acd51e4a
......@@ -335,7 +335,7 @@ bs_guard =
bs_generic =
{ syntax_title = "generic function definition"
, syntax_patterns = map exact ["generic", "derive", "of", "with", "\\{\\|.*\\|\\}"]
, syntax_code = ["generic ... ... [| ...] :: ... ", "derive ... ... [of ... [with ...]]"]
, syntax_code = ["generic ... ... [| ...] :: ... ", "derive ... ... [of ...] [with ...]"]
, syntax_description = "With generics, a function can be defined once and derived for (almost) all possible types, to avoid very similar code snippets."
, syntax_doc_locations = [CLR 9 "7.2" "_Toc311798069"]
, syntax_examples =
......@@ -345,8 +345,10 @@ bs_generic =
, EX "derive gEq [] // Deriving the gEq generic for type []"
, EXs "macro" "gConsName{|CONS of d|} _ = d.gcd_name // Using type information"
, EX "gFun{|CONS of {gcd_arity}|} // Using a specific field of type information, the compiler will only provide this field which makes it a lot faster"
, EXs "macro" $ "generic gFun a :: a -> Int | gDefault a // A generic function with a generic context\n" +
"gFun{|CONS of {gcd_arity}|} with f _ // A derivation that does not use the context and only one field of the generic type descriptor, the compiler can optimize for this."
, EXs "macro" $
"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 ompiler 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."
]
}
......
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