C +Algebra.Ring -package

keyword case
keyword
A case expression has the general form > case e of { p1 match1 ; ... ; pn matchn } where each matchi is of the general form > | g1 -> e1 > ... > | gm -> em > where decls Each alternative consists of patterns pi and their matches, matchi. Eachmatchi in turn consists of a sequence of pairs of guards gij and bodies eij (expressions), followed by optional bindings (declsi) that scope over all of the guards and expressions of the alternative. An alternative of the form > pat -> exp where decls is treated as shorthand for: > pat | True -> exp > where decls A case expression must have at least one alternative and each alternative must have at least one body. Each body must have the same type, and the type of the whole expression is that type. A case expression is evaluated by pattern matching the expression e against the individual alternatives. The alternatives are tried sequentially, from top to bottom. If e matches the pattern in the alternative, the guards for that alternative are tried sequentially from top to bottom, in the environment of the case expression extended first by the bindings created during the matching of the pattern, and then by the declsi in the where clause associated with that alternative. If one of the guards evaluates to True, the corresponding right-hand side is evaluated in the same environment as the guard. If all the guards evaluate to False, matching continues with the next alternative. If no match succeeds, the result is _|_.
keyword class
keyword
A class declaration introduces a new type class and the overloaded operations that must be supported by any type that is an instance of that class. > class Num a  where > (+)    :: a -> a -> a > negate :: a -> a
keyword data instance
keyword
Declares a datatype family instance (see type families). GHC language extension.
keyword deriving instance
keyword
Standalone deriving (GHC language extension). > {-# LANGUAGE StandaloneDeriving #-} > data A = A > > deriving instance Show A
keyword instance
keyword
An instance declaration declares that a type is an instance of a class and includes the definitions of the overloaded operations - called class methods - instantiated on the named type. > instance Num Int  where > x + y       =  addInt x y > negate x    =  negateInt x
keyword proc
keyword
proc (arrow abstraction) is a kind of lambda, except that it constructs an arrow instead of a function. Arrow notation
keyword rec
keyword
The rec keyword can be used when the -XDoRec flag is given; it allows recursive bindings in a do-block. > {-# LANGUAGE DoRec #-} > justOnes = do { rec { xs
keyword type instance
keyword
Declares a type synonym family instance (see type families). GHC language extension.