This is really a comment on @Aaron Roth's answer, which is good (and way more efficient than the accepted answer).
I think you can improve this, the fmap seems unnecessary. Also Knuth's presentation of H5/H6 (your 'go' step) obscures that it is just a sum & replicate. Here's a version that sticks close to Knuth's naming, while trying to make the algorithm clearer:
import Data.List (unfoldr)
partitions m n
| n < m || n < 1 || m < 1 = []
| otherwise = unfoldr nextPartition ((n - m + 1) : (replicate (m - 1) 1))
nextPartition [] = Nothing
nextPartition [a] = Just ([a], [])
nextPartition a@(a1 : a2 : rest)
| a2 < a1 - 1 = Just (a, (a1 - 1):(a2 + 1):rest)
| otherwise = Just (a, h5 (span (>= a1 - 1) rest))
where
h5 (_, []) = []
h5 (xs, aj:ys) =
let j = length xs + 3 in
let tweaked = replicate (j - 1) (aj + 1) in
let a1' = sum (take j a) - sum tweaked in
a1' : tweaked ++ drop j a
Or recognizing that Knuth's H3 is just unrolling the loop once, we can write nextPartition compactly as:
nextPartition [] = Nothing
nextPartition a@(a1 : rest) =
Just (a, -- H2
case (span (>= a1 - 1) rest) of -- H4
(_, []) -> [] -- H5, termination
(xs, aj:ys) ->
a1 + sum (xs) + aj - (length xs + 1) * (aj + 1) -- H6 "Finally..."
: replicate (length xs + 1) (aj + 1) ++ ys) -- H5/H6
Edited to add: Came back to this by accident a year later, and looking at the above, I don't know why I didn't just suggest this simpler recursive solution:
part m n = part2 (n-m+1) m n
where
part2 t m n
| m == 1 && t == n = [[t]]
| n < m || n < 1 || m < 1 || t < 1 = []
| otherwise = [t:r|r <- part2 t (m-1) (n-t)] ++ (part2 (t-1) m n)