There have been many studies of people with insomnia to try to nail down what the consistent, cognitive effects of this sleep disorder are; unfortunately most of the studies—or maybe, fortunately—most of the studies that have looked at people with insomnia have not been able to identify consistent problems with thought process that people with insomnia seem to have.
Certainly, people with insomnia feel as if they are not thinking well–this is a prominent complaint we doctors hear–but when you put them in a setting where they take psychological tests they seem to do pretty well. Maybe this is because they’re very motivated for that short period of time and, under conditions when they’re not as motivated they do not perform as well, but there’s no evidence that memory consolidation is impaired in people with insomnia.
Some people with insomnia may have difficulties with attention, in particular shifting from one task to another task, or seeing the larger patterns within certain problems, but again these are relatively subtle effects that we see in people with insomnia and are not consistently found. But, if attention is affected, then memory is going to be affected as well, because we don’t remember things that we don’t attend to. All that said: in general, permanent, long-term memory is not affected by insomnia.