I'm having trouble understanding how to use the assert function (Control.Exception.Assert)
I did read the documentation (http://hackage.haskell.org/package/assert-0.0.1.2/docs/Control-Exception-Assert.html) but I still don't seem to understand how it's used. The currying really doesn't help in this case because of how unexplicit it is. Examples and explanation of what it's for would be lovely.
(For context, I am trying to figure out how to use assert in this code to make sure n is always non-negative) [No answers please, I'd like to figure it out on my own]
power :: Int -> Int -> Int
power x n =
if n == 0 then
1
else
x * power x (n - 1)