You said "fun" is uncountable. Correct. In "what a great fun", "a" would belong to "fun", but then, would it not mean that "fun" can be premodified by "a", in which case "fun" would be a countable noun?
You said "fun" is uncountable. Correct. In "what a great fun", "a" would belong to "fun", but then, would it not mean that "fun" can be premodified by "a", in which case "fun" would be a countable noun?