class MyNum a where
one :: a
Now one :: MyNum a => a
. Then you can write
instance MyNum Int where
one = 1
etc.
Not sure what you are actually trying to achieve or if this is just a toy experiment or something. But I think this answers the question asked literally.
source
to share