Re: import List(..) ?

2000-05-15 Thread Marcin 'Qrczak' Kowalczyk
Mon, 15 May 2000 17:23:29 -0700, Sigbjorn Finne <[EMAIL PROTECTED]> pisze: > Really, it terminates? My copy (ghc-4.05) blows the stack, which is > sort of what I'd expect here ( Eq.(==) is defined in terms of Eq.(/=), > and vice versa, Ah, I see: in ghc-4.07 the default implementation of (==) al

Re: importing List constructor

2000-05-15 Thread Marcin 'Qrczak' Kowalczyk
Tue, 16 May 2000 09:28:15 +0400 (MSD), S.D.Mechveliani <[EMAIL PROTECTED]> pisze: > (+) = Prelude.Num.(+) reports wrong syntax. (+) = Prelude.+ -- __("$ P+++ L++

correction to previous letter

2000-05-15 Thread S.D.Mechveliani
I my last letter, the program contained g (x:xs) = xs Correct it to g (x:xs) = x:x:xs. -- Sergey Mechveliani [EMAIL PROTECTED]

importing List constructor

2000-05-15 Thread S.D.Mechveliani
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 c

RE: import List(..) ?

2000-05-15 Thread Sigbjorn Finne
[EMAIL PROTECTED] <[EMAIL PROTECTED]> writes: > > GHC has strange behavior on perverse numeric instances. Given this: > > newtype T = T Integer deriving (Show) > instance Eq T > instance Num T > main = putStrLn $ case T 2 of > 4 -> "4" > _ -> "_" > > it outputs 4, even though (==) and

Re: import List(..) ?

2000-05-15 Thread Marcin 'Qrczak' Kowalczyk
Tue, 16 May 2000 00:37:04 +1000, Fergus Henderson <[EMAIL PROTECTED]> pisze: > import Prelude () > nil :: [a] > nil = [] > or > import Prelude () > cons :: a -> [a] > cons h t = h : t > ghc rejects them both, But does not reject if "import Prelude ()" is chan

RE: import List(..) ?

2000-05-15 Thread Simon Marlow
> the grammar for import and export lists use `tycon' > and `qtycon' (respectively) rather than `gtycon'. > > Is there any particular reason for this, or is this > just a defect in the Haskell 98 report? > Would changing `qtycon' to `gtycon' in the > grammar production for `export' cause any prob

Re: import List(..) ?

2000-05-15 Thread Malcolm Wallace
> The good news is that ghc (4.04) does not follow the Haskell 98 > report -- it accepts the following code, apparently as an > extension to Haskell 98 (even without `-fglasgow-exts'): > > module Example(Prelude.[](..)) where > import Prelude([](..)) > > Similarly, it also accepts >

Re: import List(..) ?

2000-05-15 Thread Fergus Henderson
On 15-May-2000, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote: > On Mon, 15 May 2000, S.D.Mechveliani wrote: > > >import Prelude ( tail, (.) ) -- List(..) ? > > [](..) or []([],(:)) > And also: ()(..) or ()(()) > > AFAIR the report says that : is a special syntax that always refers

Re: import List(..) ?

2000-05-15 Thread Fergus Henderson
On 15-May-2000, S.D.Mechveliani <[EMAIL PROTECTED]> wrote: > I am again stuck. Who could help, please? > >module T >where >import Prelude ( tail, (.) ) -- List(..) ? At first glance, I didn't see what the problem was. But having tried it myself, I see why you're having difficult

Re: import List(..) ?

2000-05-15 Thread Marcin 'Qrczak' Kowalczyk
On Mon, 15 May 2000, S.D.Mechveliani wrote: >import Prelude ( tail, (.) ) -- List(..) ? [](..) or []([],(:)) And also: ()(..) or ()(()) AFAIR the report says that : is a special syntax that always refers to the Prelude thing, for consistency with the rest of the list syntax. But in GHC (:

import List(..) ?

2000-05-15 Thread S.D.Mechveliani
I am again stuck. Who could help, please? module T where import Prelude ( tail, (.) ) -- List(..) ? f = tail . tail g (x:xs) = xs T wants to import explicitly tail, (.), . --- tail, (.) work, and (:) does not, it require