I find the GADT syntax used in the article hard to follow... Normally this is what I see, straight out of Jannis Limperg's insanely helpful compilation of language extension examples[0]:
data RestrictedMaybe a where
JustInt :: Int -> RestrictedMaybe Int
JustString :: String -> RestrictedMaybe String
Nothing :: RestrictedMaybe a
Maybe the intention was more of a "from scratch" implementation (without using extensions) but the above syntax is a bit easier to follow in my opinion IMO.It might also be a good idea to make note of where the polymorphism is happening (the "a") and note how it's ok that the a is "resolved" in some of these constructors but not in the others.