Name: Anonymous 2013-07-15 3:49
I need to write the function that has the P -> P type where the type P means prime numbers. There is the question: how to define P in haskell?
isPrime :: Num a => a -> Bool
...
function :: Num a => a -> a
function n
| not $ isPrime n = error "not a prime"
| otherwise = ...
(defun (fun x)
(assert (primep x))
(let ((ret ...))
(assert (primep ret))
ret))