
16 Apr
2002
16 Apr
'02
10:15 p.m.
[1] Bug1? This declaration: > A = (,) Int Int is accepted by ghci. Is this behaveour correct, 1. It kind of shadows (,) is defined in PrelTup meaning that you can no longer use (,) prefix to refer to tuples - like (,) 1 2. 2. Seems to me like (,) is not correct syntax for a consym as defined in the H98 Report so we shouldn't be able to redefine it. Note: didn't check any other interpreter/compiler. [2] Bug2? - Step 1 Load this in ghci, ----------------------- module Test where data C = C ((,) Int Int) data A = (,) !Int !Int h :: A h = (,) 1 2 {- f :: C f = C ((,) 3 4) -} ------------------------ - Step 2 Uncomment the f function. (you'll get an error function) - Step 3 To get rid of the error comment out the 'data A' declaration and function 'h'. Now you should get this error message: ------------------------------------------------- Failed to find interface decl for `Teste.A' from module `Teste' ------------------------------------------------- [3] Strict Pairs question I really miss them :-) I know I can do something like data A a b= A !a !b But then you can't use zips fst etc etc... One possible solution would be to add some Class Pair, with default instances for these functions. Is this a bad idea for any particular reason? It would also be nice to be able to generalize the idea syntatic sugar for standar tuples and be able to define constructors like, say (:,:) and (#:, , :#) etc. Is this feasable? J.A.

17 Apr
17 Apr
1:17 p.m.
On Wednesday 17 April 2002 03:15, Jorge Adriano wrote:
[1] Bug1? This declaration:
A = (,) Int Int
Opsss cut and paste problems :)
data A = (,) Int Int is accepted by ghci. Is this behaveour correct,
This is what I meant. Anyway in Bug 2 I used the 'correct' declaration
[2] Bug2? - Step 1 Load this in ghci, ----------------------- module Test where data C = C ((,) Int Int)
data A = (,) !Int !Int -- <----------- There it is <snip>
J.A.
8434
Age (days ago)
8434
Last active (days ago)
1 comments
1 participants
participants (1)
-
Jorge Adriano