(redirected from refute)
Also found in: Dictionary, Thesaurus, Legal, Wikipedia.


In lazy functional languages, a refutable pattern is one which may fail to match. An expression being matched against a refutable pattern is first evaluated to head normal form (which may fail to terminate) and then the top-level constructor of the result is compared with that of the pattern. If they are the same then any arguments are matched against the pattern's arguments otherwise the match fails.

An irrefutable pattern is one which always matches. An attempt to evaluate any variable in the pattern forces the pattern to be matched as though it were refutable which may fail to match (resulting in an error) or fail to terminate.

Patterns in Haskell are normally refutable but may be made irrefutable by prefixing them with a tilde (~). For example,

(\ (x,y) -> 1) undefined ==> undefined (\ ~(x,y) -> 1) undefined ==> 1

Patterns in Miranda are refutable, except for tuples which are irrefutable. Thus

g [x] = 2 g undefined ==> undefined

f (x,y) = 1 f undefined ==> 1

Pattern bindings in local definitions are irrefutable in both languages:

h = 1 where [x] = undefined ==> 1 Irrefutable patterns can be used to simulate unlifted products because they effectively ignore the top-level constructor of the expression being matched and consider only its components.
References in periodicals archive ?
Zubeida Ibrahim Younis and husband Sayed Abdel Azim speak with TV host Amr Adib to refute BBC claims over the young woman being tortured or abducted.
The Arabic-language Al Bayan newspaper and the television channel Dubai One reported the arrests on Monday but Dubai Police said on Twitter: "#DubaiPolice refute allegations in faulty news article.
Two powerful personalities clash: one determined to keep her charge safe; the other determined to refute any idea of danger.
He said he wants the chance to refute the special rapporteur in public.
It seems to refute, in just three words, the accusation that has been brought against the Jews again and again in the history of the Exilethe idea that Jews are loyal only to themselves, not to the governments they live under.
25 (SUNA)- The deputies of the National Assembly have agreed on the need to consolidate the media address, pointing to the importance of the spokesman to express their vision of the state, agreeing that the media attack shall be faced with a si,ilar counter attack to refute it.
Summary: The head of an association representing Lebanese prisoners in Syria urged the government Wednesday to refute the Syrian ambassador's claims that there are no Lebanese prisoners in Syria.
Most classes of medications that are used to treat painful diabetic neuropathy include drugs that have at best a moderate level of evidence to support their effectiveness or have insufficient evidence to support or refute their use, according to a new guideline.
The False Promise of Green Energy considers the claims green energy proponents make about its potentials, from economic changes to environmental impact, and refute many common beliefs.
Giving evidence in his own defence yesterday, Lewis said: "I absolutely refute that.
One horn of the dilemma is the putative norm of refute-or-accept: if you cannot refute an argument, you ought to accept its conclusion.
Paul parallels baptism and the Lord's Supper with the experience of Exodus and then lifts up the stiff-necked ways that Israel responded in a way that allows the story to refute their behavior.