Here is James McIntosh on Ahab (in an essay called "The Mariner's Multiple Quest"):
"He is not only a shaggy Nantucket captain whose brows congeal in a storm, not only a Quaker with a vengeance or a lonely and fierce Andrew Jackson on his war horse, but also a Jonah who doesn't come back; an unrepentant Job; a self-crucified Christ who wakes with his own bloody nails in his palms; a Faust who makes a pact with a familiar oriental devil; a Macbeth who hearkens to false assurances; a Lear whose madness is tempered by the ministrations of a mad boy who loves him; a Perseus with an ivory leg; and a Prometheus who creates his own vultures to peck at his own heart. [...] This typological approach to characterisation is of a piece with Melville's multiply adhesive approach to all knowledge and all earlier texts. It leads to some confusion or, perhaps, acrobatic mind stretching. Jonah, Macbeth, and Perseus hardly consort easily together. Yet Melville's intention seems to be to evoke Ahab as a gritty modern representative of all sufferers, aspirers, questers after monsters, and vengeance seekers."Because Ahab is so rich and complex a concept, whilst a character in a novel usually has a foil or 2, Ahab can be paired or contrasted with many other characters, perhaps almost everybody in the novel:
Ahab vs Steelkilt (of the Town-Ho): Both are proud. Both suffer an injustice (from their own point of view at least) and want a revenge, but Ahab loses whereas Steelkilt wins.
Ahab and Macey (of the Jeroboam): Both ignore warnings and show no fear of Moby Dick, and get killed.
Ahab vs captain Boomer (of the Samuel Enderby): Both have encountered Moby Dick, and lost a limb as a consequence- the former, a leg; the latter, an arm. Ahab has to take a revenge; Boomer feels grateful that his life is spared, and decides to hunt no more.
Ahab vs Dr Bunger: The former sees Moby Dick as the personification of all evil in the world; the latter says what he takes to be the whale's malice is only its awkwardness.
Ahab vs Bulkington: Bulkington's apparently hinted to be an alternative to Ahab- a better man, perhaps?
Ahab and Fedallah: Both are fire worshippers. The latter is the former's dark shadow.
Ahab vs Pip: Pip shows that Ahab still has a heart. Pip loses sanity after being abandoned at sea; Ahab isolates himself in his cabin. Both are mad. Both don't survive their woe. Pip is blessed with vision; Ahab becomes blinded by his obsession.
Ahab vs Stubb: Stubb has in him more joy than sorrow; Ahab succumbs to the woe that is madness.
Ahab vs Queequeg: Queequeg is at peace with the world; Ahab fights against nature by trying to take revenge on a dumb brute.
Ahab vs Starbuck: Starbuck is pious and good; Ahab is blasphemous and says he'd strike the sun if it insulted him. Starbuck is pragmatic; Ahab throws away reason. Starbuck's the only person that objects to Ahab's quest, but he doesn't actually do anything, whereas Ahab does everything to achieve his aim.
Most importantly, Ahab vs Ishmael: Ahab's associated with fire; Ishmael, with water. Ahab locks himself up in the cabin; Ishmael lives with the crew, and with the sea. Ahab quarrels with God; Ishmael's at one with nature. Ahab loses himself to the woe that is madness; Ishmael can dive down to the blackest gorges and soar out of them again. Ahab has a monomania and cares about nothing else; Ishmael embraces everything, he has an insatiable curiosity and an inexhaustible sense of wonder. Ahab, being vengeful, can no longer enjoy; Ishmael has a sense of humour and finds joy in life. Ahab's only concerned with himself (even when he analyses the doubloon, it's all about himself); Ishmael has a fluid consciousness and can participate in other people's imaginations. Ahab is the force of linearity; Ishmael is a force of digression. Ahab has a static world view; Ishmael is open-minded and full of self-contradictions, and can change. Ahab is a symbol of tyranny; Ishmael, democracy.
Or Ahab and Ishmael can be seen in categorical terms:
That contrast, in a sense, makes up the book.