def factorial( n ) | n >= 0 = product( 1..n ) | otherwise = error( 'factorial: n should be non-negative' )