Each time the type variable which appears in the return type of a function (e.g. b in foldr::(a->b->b)->b->[a]->b)
is expanded to a function type, the search priority of the current computation is lowered by this number.
It's default value is 1, which means there is nothing special, and the priority for each expression corresponds
to the number of function applications in the expression.
Example: when tvndelay = 1,
The priority of
\xs -> foldr (\x y -> x+y) 0 xs
is 5,
because there are five $'s in
\xs -> ((foldr $ (\x y -> ((+) $ x) $ y)) $ 0) xs
The priority of
\xs ys -> foldr (\x y zs -> x : y zs) (\ws->ws) xs ys
is 7,
because there are seven $'s in
\xs ys -> (((foldr $ (\x y zs -> (((:) $ x) $ y) $ zs)) $ (\ws->ws)) $ xs) $ ys
Example: when tvndelay = 2,
The priority of
\xs -> foldr (\x y -> x+y) 0 xs
is 5,
because there are five $'s in
\xs -> ((foldr $ (\x y -> ((+) $ x) $ y)) $ 0) xs
The priority of
\xs ys -> foldr (\x y zs -> x : y zs) (\ws->ws) xs ys
is 8,
because there are eight $'s in
\xs ys -> (((foldr $ (\x y zs -> (((:) $ x) $ y) $ zs)) $ (\ws->ws)) $ xs) $$ ys
where $$ denotes the function application caused by expanding a type variable into a function type.
|