Use infinite coefficient lazy lists:
zero, one :: Num a => [a]
zero = 0 : zero
one = 1 : zeroFor ordinary numeric coefficients such as
Rational, zero == zero does not terminate, while zero == one is False. The former comparison never finds a differing coefficient or reaches two empty lists; the latter rejects the unequal first coefficients immediately. Equality of denoted formal power series is mathematical equality of all coefficients, whereas this executable list comparison is a potentially nonterminating procedure. Articles by others on the same topic
There are currently no matching articles.