title: Overriding fromInteger in Haskell
body: <p>So I like Haskell, but am dissatisfied with the Num class.
  So I want to make my own typeclass hierarchic for algebraic types.<br>
  The problem is, even if I import Prelude hiding Num and everything associated with it, still the only way to make the literal 1 have type t is to make t instance Num.<br>
  I would love to make my own fromInteger class and leave Num out of the picture entirely, like this</p>
  
  <pre><code>import Prelude hiding (everything having to do with Num)
  import qualified Prelude (everything having to do with Num)
  
  class (Eq fi) =&gt; FromInteger fi where
    fromInteger :: Integral -&gt; fi
  
  foo :: (FromInteger fi) =&gt; fi -&gt; String
  foo 1 = "that was a one"
  foo 0 = "that was a zero"
  foo n = "that was neither zero nor one"
  </code></pre>
  
  <p>and then I would implement fromInteger appropriately for brand new types and never have to say anything about Num.  </p>
  
  <p>Is there a way to tell the parser to use a different fromInteger method?</p>
  
  <p>Thanks!</p>