Guards ( | )
Multi-branch function definition.
Syntax
f x\n | kosul1 = ...\n | otherwise = ...
Description
Guards define a function based on conditions. The first matching branch is chosen; otherwise means 'if none match'.
Example
Loading editor…
Expected output
Passed
When to use?
Grade/category determination, multi-conditional logic.