Safe Haskell  None 

Language  Haskell98 
Documentation
class (Ring r, DecidableZero r, DecidableUnits r, Domain r) => Euclidean r where Source
splitUnit :: r > (r, r) Source
splitUnit r
calculates its leading unit and normal form.
let (u, n) = splitUnit r in r == u * n && fst (splitUnit n) == one && isUnit u
degree :: r > Maybe Natural Source
Euclidean (degree) function on r
.
:: r  elements divided by 
> r  divisor 
> (r, r)  quotient and remin 
Division algorithm. a
calculates
quotient and reminder of divide
ba
divided by b
.
let (q, r) = divide a p in p*q + r == a && degree r < degree q
quot :: r > r > r infixl 7 Source
rem :: r > r > r infixl 7 Source
calculates greatest common divisor of gcd
a ba
and b
.
euclid :: r > r > [(r, r, r)] Source
Extended euclidean algorithm.
euclid f g == xs ==> all (\(r, s, t) > r == f * s + g * t) xs
leadingUnit :: Euclidean r => r > r Source
:: Euclidean r  
=> [(r, r)]  List of 
> r 
