I thank people who explained the question of importing the List
constructor.
There remains a very practical question of how to improve the 
program
  -----------------------------------------------------------
  import qualified Prelude
  import Prelude   ( [](..), Integer )
  g (x:xs) = xs   
  class    A a       where (+) :: a -> a -> a
  instance A Integer where (+) = primPlusInteger
  
  main = Prelude.putStr (Prelude.shows (1+1 :: Integer) "\n")
  -----------------------------------------------------------

Trying various implementations, we see, for example:

Hugs      says `[' is a wrong syntax in  import.
          Neither help  []([],(:)), ()(..), ()(()).
          So, it remains to program  g  as
                              cons = Prelude.:
                              g (x Prelude.: xs) = cons x $ cons x xs
          Right?
ghc-4.06  Allows [](..), but does not understand  primPlusInteger.
          (+) = Prelude.Num.(+)  reports wrong syntax.
          And the very aim is to replace  Num  with other classes.
          (+) = (+)  is of course not the point. Besides, it causes
          a strange `threads' and `deadlock' run-time report.

Thank you in advance for the advice.

------------------
Sergey Mechveliani
[EMAIL PROTECTED]








Reply via email to