From rowan@corben.fslife.co.uk Fri Mar 1 00:52:51 2002 From: rowan@corben.fslife.co.uk (Rowan Corben) Date: Fri, 1 Mar 2002 00:52:51 -0000 Subject: help a lost soul Message-ID: <000801c1c0bb$6b6fc930$b72387d9@youriruau5ak0q> This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C1C0BB.6A5D95E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable sir, i have been set an assignment by my university....we are so badly taught = that i have absolutley no idea how to do it! I would be more than happy = to post payment for however much you feel your time is worth... Please,please help: ex.1) Extend to the library database to include category of loan for = overnight + 4 week loans-you should use the following data types.The = TIME and DATE are the due time and date for books.You should provide = enough data to reasonably test your code. data LoanType =3D Overnight Date Time | FourWeek Date deriving (Show,Read) data Time =3DTime (Hours,Minutes) deriving (show,Read) data Date =3DDate (Year,Month,DayNum) deriving (Show,Read) type Hours =3D Integer type Minutes =3DInteger type Year =3D Integer type DayNum =3DInteger data Month =3D = January|Februrary|March|April|May|June|July|August|September|October|Nove= mber|December deriving (Eq,Ord,Enum,Show,Read) overdue books are fined at the following rates: OVERNIGHT the due time is 24 hours from the time borrowed to the nearest = hour above (for example,a book borrowed at 12.35 would be due back at = 13.00 the next day).Overdue books are fined at 0.1p per minute rounded = to the nearest penny. FOURWEEK the due date is four weeks from the borrowing date.Overdue = books are fined at 10p per day ex.2) To calculate fines you will need to impliment functions over = DATE and TIME.You will also need a data type to represent time periods: data TimePeriod =3D TimePeriod (Days,Hours,Minutes) deriving (Eq,Ord,Show,Read) type Days =3D Integer *afterTime which takes two times and returns True if the first is = after the second. *beforeTime which takes two times and returns True if the first is = before the 2nd = =20 *timeBetween which takes two times and returns the time between the = first and the 2nd *timeIncr which takes a time and a time period and returns a new time = (time should be represented as a 24 hour clock *timeTo24String which takes a tim eand displays it as a string in = 24hr format *timeTo12String which takes a time and displays it as a string = in 12 hour format ex.3) Make DATE and TIME instances of the type classes Eq and Ord ex.4) For overnight books most fines are on the same day-write a = function that takes a book and a time and calculates the fine on the = book (assuming it is returned on the due date but after the due time). If you could help i will be extreamly = gratefull!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! haskinsgreg@hotmail.com =20 ------=_NextPart_000_0005_01C1C0BB.6A5D95E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
sir,
i have been set an assignment by my=20 university....we are so badly taught that i have absolutley no idea how = to do=20 it! I would be more than happy to post payment for however much you feel = your=20 time is worth...
 
Please,please help:
 
ex.1)    Extend to the = library=20 database to include category of loan for overnight + 4 week loans-you = should use=20 the following data types.The TIME and DATE are the due time and date for = books.You should provide enough data to reasonably test your = code.
 
data LoanType   =3D Overnight = Date Time |=20 FourWeek Date
          &nbs= p;            = ;    =20 deriving (Show,Read)
data=20 Time         =3DTime=20 (Hours,Minutes)
          &nbs= p;            = ;       =20 deriving (show,Read)
data=20 Date           =3DDate = (Year,Month,DayNum)
          &nbs= p;            = ;        =20 deriving (Show,Read)
type=20 Hours        =3D Integer
type Minutes    =20 =3DInteger
type = Year      =20 =3D   Integer
type DayNum    = =3DInteger
data Month    =3D=20 January|Februrary|March|April|May|June|July|August|September|October|Nove= mber|December
           = deriving=20 (Eq,Ord,Enum,Show,Read)
 
overdue books are fined at the = following=20 rates:
 
OVERNIGHT the due time is 24 hours from = the time=20 borrowed to the nearest hour above (for example,a book borrowed at 12.35 = would=20 be due back at 13.00 the next day).Overdue books are fined at 0.1p per = minute=20 rounded to the nearest penny.
 
FOURWEEK the due date is four weeks = from the=20 borrowing date.Overdue books are fined at 10p per day
 
 
 
ex.2)   To calculate fines = you will need=20 to impliment functions over DATE and TIME.You will also need a data type = to=20 represent time periods:
 
      data=20 TimePeriod  =3D TimePeriod (Days,Hours,Minutes)
          &nbs= p;            = ;      =20      deriving (Eq,Ord,Show,Read)
      type=20 Days            = =3D=20 Integer
 
*afterTime      which=20 takes two times and returns True if the first is after the = second.
*beforeTime      which=20 takes two times and returns True if the first is before=20 the 2nd          &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =          
*timeBetween      which=20 takes two times and returns the time between the first and=20 the 2nd
*timeIncr    which takes = a time and=20 a time period and returns a new time (time should be represented as a 24 = hour=20 clock
*timeTo24String      =20 which takes a tim eand displays it as a string in 24hr = format
*timeTo12String         = which=20 takes a time and displays it as a string in 12 hour format
 
 
ex.3)    Make DATE and = TIME=20 instances of the type classes Eq and Ord
 
ex.4)    For overnight = books most=20 fines are on the same day-write a function that takes a book and a time = and=20 calculates the fine on the book (assuming it is returned on the due date = but=20 after the due time).
 
 
If you could help i will be extreamly=20 gratefull!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
haskinsgreg@hotmail.com       = ;            =             &= nbsp;      =20
------=_NextPart_000_0005_01C1C0BB.6A5D95E0-- From ashley@semantic.org Fri Mar 1 03:13:32 2002 From: ashley@semantic.org (Ashley Yakeley) Date: Thu, 28 Feb 2002 19:13:32 -0800 Subject: FW: Haskell 98 lexical syntax again Message-ID: <200203010313.TAA25478@mail4.halcyon.com> At 2002-02-28 07:18, Simon Peyton-Jones wrote: > whitechar -> newline | vertab | space | tab | uniWhite > newline -> return linefeed | return | linefeed | formfeed > return -> a carriage return > linefeed -> a line feed > >This means that CR, LF, or CRLF, are all valid 'newline' separators, >and the same sequence of characters should therefore work on any >Haskell implementation. Good. While you're fiddling with it, I recommend this: newline -> return linefeed | return | linefeed | formfeed | uniLineSep | uniParaSep uniLineSep -> any char of General Category Zl uniParaSep -> any char of General Category Zp Unicode defines two codepoints that unambiguously mean 'line separator' (\u2028) and 'paragraph separator' (\u2029). As it happens, they are the only codepoints in General Categories Zl and Zp. There are other paragraph separators (e.g. Georgian and Urdu), but they are actual marks rather than being whitespace and are not in GC Zp -- much like the pilcrow. uniWhite -> any UNIcode character defined as whitespace This is fine. But note that whitespace is an 'extended property', it can't be derived from General Category: -- Ashley Yakeley, Seattle WA From contact@weaver.com.cn Fri Mar 1 03:52:28 2002 From: contact@weaver.com.cn (contact@weaver.com.cn) Date: Fri, 1 Mar 2002 11:52:28 +0800 (CST) Subject: =?GBK?B?VG86aGFza2VsbCy3us6i0K3NrMnMzvHPtc2zvPK96Q==?= Message-ID: <443451.1014954748046.JavaMail.Administrator@liuyu> =B7=BA=CE=A2=D0=AD=CD=AC=C9=CC=CE=F1=CF=B5=CD=B3 =20 =20 =20 =20 =20
 
haskell=A3=AC=C4=FA=BA=C3=A3=A1
  =20 =20
=20

=B7=BA=CE=A2=D0=AD=CD=AC=C9=CC=CE=F1=CF=B5= =CD=B3=A3=A8E-Synergy=A3=A9=CE=AA=C4=FA=BD=E2=BE=F6=A3=BA

=A1=A4 =D0=C5=CF= =A2=B5=C4=C5=F2=D5=CD=A1=A4 =D0=C5=CF=A2=B5=C4=B9=C2=B5=BA=A1=A4 =D0=C5=CF= =A2=B5=C4=B7=C7=BD=E1=B9=B9=BB=AF=A1=A4=20 =D0=C5=CF=A2=B5=C4=B7=C7=B8=F6=D0=D4=BB=AF=A1=A4 = =20

=B7=BA=CE=A2=CD=F8=C2=E7=D3=D0=CF=DE=B9= =AB=CB=BE=CD=C6=B3=F6=BB=F9=D3=DAE-Synergy=B5=C4=D0=AD=CD=AC=C9=CC=CE=F1=BD=E2=BE=F6=B7=BD=B0=B8=A1= =A3e-Synergy=CA=C7=D2=BB=CC=D7=BC=E6=BE=DF=C6=F3=D2=B5=D0=C5=CF=A2=C3=C5=BB= =A7=A1=A2=D6=AA=CA=B6=B9=DC=C0=ED=A1=A2=B9=A4=D7=F7=C1=F7=B9=DC=C0=ED=A1=A2= =C8=CB=C1=A6=D7=CA=D4=B4=B9=DC=C0=ED=A1=A2=BF=CD=BB=A7=D3=EB=BA=CF=D7=F7=BB= =EF=B0=E9=B9=DC=C0=ED=A1=A2=CF=EE=C4=BF=B9=DC=C0=ED=A1=A2=B2=C6=CE=F1=B9=DC= =C0=ED=A1=A2=D7=CA=B2=FA=B9=DC=C0=ED=B9=A6=C4=DC=B5=C4=C7=B0=CC=A8=CF=B5=CD= =B3=A1=A3=CD=AC=CA=B1=A3=ACe-Synergy=BF=C9=D2=D4=D3=EB=BA=F3=CC=A8=B5=C4ERP= =C8=ED=BC=FE=BC=AF=B3=C9=D4=DA=D2=BB=C6=F0=A3=AC=BD=AB=CB=F9=D3=D0=C0=FB=D2= =E6=CF=E0=B9=D8=D5=DF=A1=A2=C6=F3=D2=B5=B2=BF=C3=C5=A1=A2=B2=BB=CD=AC=D3=A6= =D3=C3=CF=B5=CD=B3=B5=C4=D0=C5=CF=A2=D5=FB=BA=CF=B5=BD=CD=B3=D2=BB=B5=C4=C7= =FE=B5=C0=A3=AC=B2=A2=CC=E1=B9=A9=CD=B3=D2=BB=B5=C4=BD=E7=C3=E6=B8=F8=D3=C3= =BB=A7=B2=D9=D7=F7=BA=CD=BB=F1=C8=A1=D0=C5=CF=A2=A3=AC=B4=D3=B6=F8=CA=B5=CF= =D6=D2=B5=CE=F1=B4=A6=C0=ED=BA=CD=D0=C5=CF=A2=BB=F1=C8=A1=D3=EB=B9=B2=CF=ED= =B5=C4=D2=BB=CC=E5=BB=AF=A3=AC=B4=EF=B5=BD=C4=DA=B2=BF=D0=AD=CD=AC=D3=EB=CD= =E2=B2=BF=D0=AD=CD=AC=A1=A3


=CE=D2=C3=C7= =B3=C6=D5=E2=D1=F9=B5=C4=D2=BB=CC=D7=BC=AF=B3=C9=B5=C4=CF=B5=CD=B3=CE=AA=A1= =B0=D0=AD=CD=AC=C9=CC=CE=F1=A1=B1=A1=A3=BA=C1=CE=DE=D2=C9=CE=CA=A3=AC=D0=AD= =CD=AC=C9=CC=CE=F1=CA=C7=C6=F3=D2=B5=D0=C5=CF=A2=BB=AF=B7=A2=D5=B9=B5=C4=B7= =BD=CF=F2=A1=A3

=20
=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
=20
=B7=BA=CE=A2= =D0=AD=CD=AC=C9=CC=CE=F1=CF=B5=CD=B3=CE=AA=C4=FA=CC=E1=B9=A9=C8=E7=CF=C2=C4= =A3=BF=E9=A3=BA
=D6=AA= =CA=B6=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Documents=A3=A9=A3=BA
=D4=DA=D2=BB=B8=F6=CA=FD=BE=DD=BF= =E2=D6=D0=B4=E6=B4=A2=BA=CD=B9=DC=C0=ED=B8=F7=D6=D6=D0=C5=CF=A2=BA=CD=A3=A8= =CF=D6=D3=D0=A3=A9=D2=B5=CE=F1=A1=A3e-Documents=CA=C7=B4=E6=B4=A2=C6=F3=D2= =B5=B5=E7=D7=D3=CA=FD=BE=DD=B5=C4=BB=F9=B4=A1=A1=A3=CD=A8=B9=FDeDocuments,= =BF=C9=C9=E8=BC=C6=C1=E9=BB=EE=B6=E0=D1=F9=B5=C4=D4=B1=B9=A4=A1=A2=BF=CD=BB= =A7=A1=A2=B9=A9=D3=A6=C9=CC=BA=CD=B7=D6=CF=FA=C9=CC=C3=C5=BB=A7=A1=A3=A3=A8= =CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA= =CE=A2=CD=F8=D5=BE=A3=A9
=20
=BF=CD= =BB=A7=B9=D8=CF=B5=B9=DC=C0=ED=C4=A3=BF=E9=A3=A8e-CRM=A3=A9=A3=BA
=BC=AF=B3=C9=B5=C4=B7=C3=CE=CA=BF=CD=BB=A7=D0= =C5=CF=A2=A3=AC=D5=E2=B0=FC=BA=AC=C1=CB=B4=AB=CD=B3=B5=C4CRM=B2=FA=C6=B7=B5= =C4=C8=AB=B2=BF=B7=B6=CE=A7=A1=A3=BD=AB=BF=CD=BB=A7=BC=AF=B3=C9=B5=BD=B7=FE= =CE=F1=A1=A2=CF=FA=CA=DB=A1=A2=B2=FA=C6=B7=BA=CD=B2=C6=CE=F1=D7=E9=D6=AF=D6= =D0=A3=AC=D5=E6=D5=FD=BB=F1=B5=C3=B6=D4=BF=CD=BB=A7360=B6=C8=B5=C4=B9=DB=B2= =EC=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE=A3=A9
=20
=B2=FA= =C6=B7=A3=AC=D7=CA=B2=FA=B9=DC=C0=ED=C4=A3=BF=E9=A3=A8e-Logistics=A3=A9=A3=BA
=B9=D8=D7=A2=B2=FA=C6=B7=A1=A2=B7=FE=CE=F1=BA=CD=BC=DB=B8= =F1=B5=C4=B9=DC=C0=ED=A1=A3=B2=A2=CD=A8=B9=FDIntranet=BA=CDInternet=B9=B2= =CF=ED=D0=C5=CF=A2=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE= =A3=A9
=20
=CF=EE= =C4=BF=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Project=A3=A9=A3=BA
=B9=DC=C0=ED=D3=EB=CF=EE=C4=BF=CF=E0=B9=D8=B5=C4=BB=EE=B6= =AF=A3=AC=B2=A2=B4=D3=BE=D8=D5=F3=CA=D3=CD=BC=B9=DB=B2=EC=D7=E9=D6=AF=B5=C4= =D0=A7=C4=DC=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE=A3=A9<= /font>
=20
=C8=CB= =C1=A6=D7=CA=D4=B4=B9=DC=C0=ED=C4=A3=BF=E9=A3=A8e-HRM=A3=A9=A3=BA
=B3=FD=C1=CB=B4=AB=CD=B3=B5=C4HRM=B9=DC=C0=ED=B5= =C4=B9=A6=C4=DC=A3=ACe-HRM=BB=B9=BE=DF=D3=D0=B6=D4=D3=EB=BD=C7=C9=AB=BA=CD= =B0=B2=C8=AB=C8=A8=CF=DE=CF=E0=B9=D8=B5=C4=D4=B1=B9=A4=BA=CD=D0=C5=CF=A2=B5= =C4=CE=AC=BB=A4=B9=A6=C4=DC=A1=A3e-HRM=CA=C7=B5=E7=D7=D3=C9=CC=CE=F1=C1=F7= =B3=CC=B9=DC=C0=ED=B5=C4=BB=F9=B4=A1=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE= =A2=CD=F8=D5=BE=A3=A9
=20
=C1=F7= =B3=CC=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Procurement=A3=A9=A3=BA
e-Procurement=D3=EBeHRM=CF=E0=BD=E1=BA=CF=A3= =AC=BD=AB=BF=C9=D2=D4=B1=A3=D6=A4=C8=AB=B2=BF=B5=C4=C4=DA=B2=BF=BA=CD=CD=E2= =B2=BF=C9=CC=CE=F1=C1=F7=B3=CC=B5=C4=B5=E7=D7=D3=B9=DC=C0=ED=A1=A3=B0=FC=C0= =A8=D2=BB=B0=E3=B5=C4=B9=AB=CE=C4=C1=F7=D7=AA=BA=CD=B0=EC=B9=AB=C1=F7=B3=CC= =A1=A3=A3=A8= =CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE=A3=A9
=20
=B2=C6= =CE=F1=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Financials=A3=A9=A3=BA
=CD=A8=B9=FDIntranet =BA=CDInternet =D7=D4=B6=AF=BD=F8=D0= =D0=CA=FD=BE=DD=B5=C4=CA=D5=BC=AF=BA=CD=B4=A6=C0=ED=A1=A3=C4=DC=D4=DA=CF=DF= =B7=D6=CE=F6=D7=E9=D6=AF=B5=C4=D0=A7=C4=DC=A1=A3=A3= =A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7= =BA=CE=A2=CD=F8=D5=BE=A3=A9
=20

=D3=FB=C1=CB=BD=E2=CF=EA=CF=B8=B9=A6=C4=DC=BD=E9=C9=DC= =A3=AC=C7=EB=D6=C2=B5=E7=B7=BA=CE=A2=CD=F8=C2=E7=D3=D0=CF=DE=B9=AB=CB=BE=BB= =F2=D5=DF=BD=F8=C8=EB=B7=BA=CE=A2=CD=F8=D5=BE=A3=BAwww.weaver.com.cn

=20 =20
ERP=CF=B5=CD=B3 =B5=E7=D7=D3=C9=CC=CE=F1=BD=A8=C9=E8 =BB=F9=D3=DAWEB=B5=C4OA=B0=EC=B9=AB=CF=B5=CD= =B3
       
=20
=B5=E7=BB=B0=A3=BA021-63539330=A3=AC0= 21-63533667=A3=AC021-63177399
=B5=E7=D3=CA=A3=BA contact@weaver.com.cn= =20
=CD=F8=D5=BE=A3=BAwww.weaver.com.cn=20
=B5=D8=D6=B7=A3=BA=C9=CF=BA=A3= =CC=EC=C4=BF=CE=F7=C2=B7218=BA=C5=BC=CE=C0=EF=B2=BB=D2=B9=B3=C72=D7=F92902= =CA=D2

 

  <= a href=3D"http://www.weaver.com.cn" target=3D"_blank">
=
=
From liyang@nerv.cx Fri Mar 1 04:48:57 2002 From: liyang@nerv.cx (Liyang Hu) Date: Fri, 1 Mar 2002 04:48:57 +0000 Subject: help a lost soul In-Reply-To: <000801c1c0bb$6b6fc930$b72387d9@youriruau5ak0q> References: <000801c1c0bb$6b6fc930$b72387d9@youriruau5ak0q> Message-ID: <20020301044857.GE11808@cam.ac.uk> On Fri, Mar 01, 2002 at 12:52:51AM -0000, Rowan Corben wrote: > i have been set an assignment by my university....we are so badly > taught that i have absolutley no idea how to do it! I would be > more than happy to post payment for however much you feel your > time is worth... How about this: 1) I forward this email to your lecturers: Phil Molyneux Dan Russell 2) and you go and /learn/ how to do your own assignments? Programming is meant to be /fun/, dammit. Cheers, /Liyang -- .--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--. | Real computer scientists don't write in assembler. | | They don't write in anything less portable than a number two pencil. | From opielee1114@msn.com Fri Mar 1 08:54:01 2002 From: opielee1114@msn.com (RONALD HASKELL) Date: Fri, 1 Mar 2002 03:54:01 -0500 Subject: who's name my name Message-ID: ------=_NextPart_001_0000_01C1C0D4.B94CC360 Content-Type: text/plain; charset="iso-8859-1" ------=_NextPart_001_0000_01C1C0D4.B94CC360 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


= ------=_NextPart_001_0000_01C1C0D4.B94CC360-- From cwitty@newtonlabs.com Fri Mar 1 19:24:42 2002 From: cwitty@newtonlabs.com (Carl R. Witty) Date: 01 Mar 2002 11:24:42 -0800 Subject: H98 Report: expression syntax glitch In-Reply-To: "Simon Peyton-Jones"'s message of "Tue, 26 Feb 2002 08:23:03 -0800" References: <1113DDB24D4A2841951BFDF86665EE193749EE@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: "Simon Peyton-Jones" writes: > I didn't phrase it right. I meant that a let/lambda/if always > extends to the next relevant (not part of a smaller expression) > punctuation symbol; and if that phrase parses as an exp > that's fine, otherwise it's a parse error. So I should not really > speak in terms of 'ambiguity'. > > Perhaps we can simply say that > let .. in exp > is legal only if the phrase is followed by one of the punctuation > symbols. That's nice, because we don't need to talk of > "not part of a smaller expression". > > So (let x = 10 in x `div`) would be rejected because > x `div` > isn't a exp. If you're going to modify the syntax in the report to match what implementors actually implement, you may also want to change the "illegal lexeme" definition for closing implicit layout. I believe that do a == b == c is (according to the Standard) legal syntax that means (do {a == b}) == c but I'll bet that most if not all Haskell parsers would get it wrong. Carl Witty From igloo@earth.li Fri Mar 1 19:42:40 2002 From: igloo@earth.li (Ian Lynagh) Date: Fri, 1 Mar 2002 19:42:40 +0000 Subject: FW: Haskell 98 lexical syntax again In-Reply-To: <200203010313.TAA25478@mail4.halcyon.com> References: <200203010313.TAA25478@mail4.halcyon.com> Message-ID: <20020301194240.GA12774@stu163.keble.ox.ac.uk> On Thu, Feb 28, 2002 at 07:13:32PM -0800, Ashley Yakeley wrote: > At 2002-02-28 07:18, Simon Peyton-Jones wrote: > > > whitechar -> newline | vertab | space | tab | uniWhite > > newline -> return linefeed | return | linefeed | formfeed > > return -> a carriage return > > linefeed -> a line feed > > > >This means that CR, LF, or CRLF, are all valid 'newline' separators, > >and the same sequence of characters should therefore work on any > >Haskell implementation. > > Good. > > While you're fiddling with it, I recommend this: > > newline -> return linefeed | return | linefeed | formfeed | > uniLineSep | uniParaSep > uniLineSep -> any char of General Category Zl > uniParaSep -> any char of General Category Zp If this happens then * The characters newline, return, linefeed, and formfeed, all start a new line. in "B.3 Layout" should also be updated. In fact I think it should be changed to * The token newline starts a new line regardless, although that kind of reminds me the "May contain nuts" warning on nut packets. Ian From ashley@semantic.org Sat Mar 2 06:23:26 2002 From: ashley@semantic.org (Ashley Yakeley) Date: Fri, 1 Mar 2002 22:23:26 -0800 Subject: foralls in class assertions Message-ID: <200203020623.WAA10003@mail4.halcyon.com> At 2002-02-20 13:15, Simon Peyton-Jones wrote: >I have not implemented, yet. As always my implementation >priorities are strongly influenced by my perception of whether >some enhancement would be used. Maybe you can outline >why such a change would be useful to you? I only have the >example in our paper as motivation so far. I just came across one. I want to create a class for refs, such that they are in Eq: class (forall a. Eq (r a)) => Ref m r where { newRef :: a -> m (r a); ... etc. } -- Ashley Yakeley, Seattle WA From till@tzi.de Sat Mar 2 12:31:55 2002 From: till@tzi.de (Till Mossakowski) Date: Sat, 02 Mar 2002 13:31:55 +0100 Subject: multiparameter generic classes References: <20020301035600.9186F422378@www.haskell.org> Message-ID: <3C80C63B.2027BC59@tzi.de> We are using multiparameter classes with fundeps in the project MULTIPLE, which is about heterogeneous specification in multi-logic frameworks. See http://www.tzi.de/cofi/projects/multiple.html The interesting challenge is not only genericity (over an arbitray logic), but also heterogeneity (i.e. coexistence and communication of several logics, coded as instances of the multiparameter class). A paper describing the implementation is not available yet, but in preparation. Till Mossakowski > are there any papers/webpages/implementations/etc. of using multiparameter > classes in a generic framework, with or without dependencies? > > thanks! > > - hal > > -- > Hal Daume III -- Till Mossakowski Phone +49-421-218-4683 Dept. of Computer Science Fax +49-421-218-3054 University of Bremen till@tzi.de P.O.Box 330440, D-28334 Bremen http://www.tzi.de/~till From claus.reinke@talk21.com Sun Mar 3 01:14:01 2002 From: claus.reinke@talk21.com (Claus Reinke) Date: Sun, 3 Mar 2002 01:14:01 -0000 Subject: Research Opportunity: Refactoring Functional Programs (UKC) Message-ID: <007801c1c250$b5768460$ae1ffea9@Standard> Job opportunity for postdoc / graduate Research Associate in Refactoring Functional Programs at University of Kent. Please bring to the attention of suitable candidates / forward as appropriate. ----------------------------------------------- ad follows Research Associate in Refactoring Functional Programs Applications are invited for a three year Research Associate position at the University of Kent at Canterbury, to work under the direction of Professor Simon Thompson and Dr Claus Reinke on an EPSRC funded project entitled "Refactoring Functional Programs". Applications are welcomed from candidates with a doctorate or a very good first degree; in the latter case a successful candidate will have the opportunity of registering to study for a PhD. Refactoring is the process of redesigning existing code without changing its functionality. In our project we will explore refactoring for functional programs and in particular we will construct a catalogue of functional refactorings, and build a prototype tool in Haskell to support refactoring of Haskell programs. Applicants should be able to demonstrate strong experience of programming in a functional programming language, preferably Haskell, and have good communication skills. The appointment will be made within the salary ranges of £17,278-£26,229 p.a. on the Research IA scale. Please telephone the Personnel Office for further particulars on 01227 827837 (24 hours) or email: Personnel@ukc.ac.uk, quoting the reference number R02/24. Text phone users please telephone 01227 823674. The closing date is Friday 22 March 2002. Informal enquires can be directed to either Simon or Claus: {S.J.Thompson,C.Reinke}@ukc.ac.uk. More details of the project and further particulars for the position can be found at: http://www.cs.ukc.ac.uk/people/staff/sjt/Refactor/ Simon and Claus From dominic.j.steinitz@britishairways.com Sun Mar 3 07:15:50 2002 From: dominic.j.steinitz@britishairways.com (dominic.j.steinitz@britishairways.com) Date: Sun, 3 Mar 2002 07:15:50 +0000 Subject: getProtocolByName Message-ID: Here's my test program. TCP is a valid protocol. But I get the following when I run it. I'm running under W98 by the way. I have two questions: 1) Why do I get an error? 2) Even if this is a valid error why doesn't the function tell me so that I can handle it rather than terminating? Dominic. C:\Dom\haskell\ping>main Fail: does not exist Action: getProtocolByName Reason: no such protocol entry C:\Dom\haskell\ping>version C:\Dom\haskell\ping>"c:\program files\glasgow haskell compiler\ghc-5.02\bin\ghc" --version The Glorious Glasgow Haskell Compilation System, version 5.02 module Main(main) where import BSD main = do protocolEntry <- getProtocolByName "TCP" {- The documentation gives no clue as to what constitutes an error condition. Looking at the C equivalent in http://www.opengroup.org/onlinepubs/7908799/xns/endprotoent.html, this gives a null pointer to the data structure. Assume for now that the Haskell equivalent returns a null protocol name. -} if protoName protocolEntry == "" then putStrLn "Error" else putStrLn ("Protocol name: " ++ (protoName protocolEntry)) From finnw@iname.com Sun Mar 3 09:30:31 2002 From: finnw@iname.com (Finn Wilcox) Date: Sun, 3 Mar 2002 09:30:31 +0000 (GMT) Subject: getProtocolByName In-Reply-To: Message-ID: On Sun, 3 Mar 2002 dominic.j.steinitz@britishairways.com wrote: > Here's my test program. TCP is a valid protocol. But I get the following > when I run it. I'm running under W98 by the way. I have two questions: > > 1) Why do I get an error? You want: > module Main(main) where > > import BSD import Socket (withSocketsDo) > > main = withSocketsDo $ > do protocolEntry <- getProtocolByName "TCP" ... > See http://www.haskell.org/ghc/docs/latest/set/socket.html#AEN14601 > 2) Even if this is a valid error why doesn't the function tell me so that I > can handle it rather than terminating? > It is a valid error. It is raising an exception which you can catch if you want. e.g. import IO (catch, isDoesNotExistError) ... catch (do protocolEntry <- getProtocolByName "TCP" putStrLn ("Protocol name:" ++ (protoName protocolEntry))) (\e -> if isDoesNotExistError e then putStrLn "Error" else ioError e) Finn. From Ralf.Laemmel@cwi.nl Sun Mar 3 11:10:23 2002 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Sun, 03 Mar 2002 12:10:23 +0100 Subject: multiparameter generic classes References: Message-ID: <3C82049F.CA919B1F@cwi.nl> Hal Daume III wrote: > > are there any papers/webpages/implementations/etc. of using multiparameter > classes in a generic framework, with or without dependencies? Maybe this is something for you. It uses 7 parameters and many functional dependencies. But it is a kind of trivial :-) And yes, it is about a generic framework, that is, a framework for generic refactoring. http://www.cwi.nl/~ralf/tgr/ The multi-parameter class is used to encode a form of signature morphism, namely the interface for language abstractions I deal with in the refactoring framework. Ralf > thanks! > > - hal > > -- > Hal Daume III > > "Computer science is no more about computers | hdaume@isi.edu > than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell -- Dr.-Ing. Ralf Laemmel CWI & VU, Amsterdam, The Netherlands http://www.cwi.nl/~ralf/ http://www.cs.vu.nl/~ralf/ From dominic.j.steinitz@britishairways.com Sun Mar 3 17:42:56 2002 From: dominic.j.steinitz@britishairways.com (Dominic Steinitz) Date: Sun, 3 Mar 2002 17:42:56 +0000 Subject: getProtocolByName Message-ID:

 Finn,

 

Thanks for this.

I thought since I= wasn't actually using the socket module I wouldn't have to use withSockets= Do.

The documentation for BSD is a little spartan and a few explanato= ry words about how errors get handled wouldn't go amiss.

Anyway, it n= ow works so I'll move on to the next bit.

Dominic.

Finn Wilcox <finnw@sucs.org>
03/= 03/2002 09:30
Please respond to finnw
To: dominic.j.steinitz@britishairwa= ys.com
cc: haskell@haskell.= org
bcc:
Subject: Re: getProtocolByName


On Sun, 3 Mar 2002 dominic.j.steinitz@britishairway= s.com wrote:

> Here's my = test program. TCP is a valid protocol. But I get the following
> when= I run it. I'm running under W98 by the way. I have two questions:
><= BR>> 1) Why do I get an error?

You want:
> module Main(main) where
>
> import BSD<= BR>  import Socket (withSocketsDo)
>
> main =3D
 =   withSocketsDo $
>    do protocolEntry <- getProt= ocolByName "TCP"
    ...
>
See http://www.h= askell.org/ghc/docs/latest/set/socket.html#AEN14601

> 2) Even if this is a valid error why doesn= 't the function tell me so that I
> can handle it rather than termina= ting?
>
It is a valid error.  It is raising an exception whic= h you can catch if you
want. e.g.

import IO (catch, isDoesNotExistError)
...
  catch (do= protocolEntry <- getProtocolByName "TCP"
    &n= bsp;       putStrLn ("Protocol name:" ++ (protoNam= e protocolEntry)))
        (\e -> if isDoesNotEx= istError e then
               =   putStrLn "Error" else
        &nb= sp;         ioError e)

Finn.

= From isc80520@nus.edu.sg Mon Mar 4 01:55:06 2002 From: isc80520@nus.edu.sg (Nguyen Phan Dung) Date: Mon, 4 Mar 2002 09:55:06 +0800 Subject: Lazy Evaluation Message-ID: <000001c1c31f$9c204e90$947ba8c0@PhanDung> This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C1C362.AA438E90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, Sorry for asking such a silly question: Haskell is using lazy evaluation. So, it means we should be able to declare and use a list of billions elements without any trouble. So I declare my list as follow: mylist :: [Integer] mylist = [1..1000000000] In Hugs, I type mylist to print out all the elements inside. However, after printing about 22000 elements, the system crashs & outputs: "Garbage collection fails to reclaim sufficient memory" Would you please help me with this problem? Thank you very much, Phan Dung. ------=_NextPart_000_0001_01C1C362.AA438E90 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 =

Hello,=

 =

Sorry for = asking such a silly question: Haskell is using lazy evaluation. So, it means we = should be able to declare and use a list of billions elements without any trouble. = So I declare my list as follow:

 =

mylist :: = [Integer]

mylist =3D [1..1000000000]

 =

In Hugs, I = type mylist to print out all the elements inside. However, after printing about = 22000 elements, the system crashs & outputs: “Garbage collection = fails to reclaim sufficient memory”

 =

Would you = please help me with this problem?

Thank you = very much,

Phan = Dung.

------=_NextPart_000_0001_01C1C362.AA438E90-- From Tom.Pledger@peace.com Mon Mar 4 03:04:54 2002 From: Tom.Pledger@peace.com (Tom Pledger) Date: Mon, 4 Mar 2002 16:04:54 +1300 Subject: Lazy Evaluation In-Reply-To: <000001c1c31f$9c204e90$947ba8c0@PhanDung> References: <000001c1c31f$9c204e90$947ba8c0@PhanDung> Message-ID: <15490.58454.607261.361196@waytogo.peace.co.nz> Nguyen Phan Dung writes: : | mylist :: [Integer] | mylist = [1..1000000000] | | In Hugs, I type mylist to print out all the elements inside. However, | after printing about 22000 elements, the system crashs & outputs: | "Garbage collection fails to reclaim sufficient memory" The declaration of mylist is a pattern binding, not a function binding - see section 4.4.3 of the Haskell 98 report. What that means in this particular case is that the system saves the result in case you want to use it again, rather than freeing the part of the list it's already printed. Try typing [1..1000000000] at the Hugs prompt instead. Regards, Tom From aciego@ctima.uma.es Mon Mar 4 10:48:23 2002 From: aciego@ctima.uma.es (Manuel Ojeda Aciego) Date: Mon, 4 Mar 2002 11:48:23 +0100 Subject: 2nd CFP: Unification in non-classical logics Message-ID: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D We apologize if you receive this more than once =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Second call for papers Unification in Non-Classical Logics --co-located with ICALP 2002-- July, 12-13, 2002, M=E1laga, Spain http://www.satd.uma.es/aciego/icalp-ws.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The workshop on Unification in Non-Classical Logics will be held in M=E1laga, as a workshop of the 29-th International Colloquium on Automata, Languages, and Programming (ICALP 2002), which is a very convenient forum for an open discussion of the subject of non-canonical unification, roughly depicted below. Aims and scope -------------- Unification in non-classical logics, with various approaches to handling generalised terms, has drawn more and more attention in recent years. It turns out to be among the most promising areas of research on non-classical logics and its applications. So far, most popular lines of research include fuzzy unification of (conventional) databases and the use of fuzzy concepts in information retrieval. Some international events based on these topics have been held so far, for instance, the 2nd Intl Workshop on Logic Programming and Soft Computing (LPSC'98), or the special session on Advances in Possibilistic Logic and Related Issues at the IFSA Congress in Vancouver, Canada (2001), have non-classical unification among their topics. This workshop at ICALP is conceived as a forum for the exchange of ideas relevant for the concept of unification in non-classical logics, including, but not limited to, the following topics (practical implementations and experiences as well as theoretical advances): * Unification in multiple-valued and fuzzy logic programming. * Unification based on similarities and fuzzy equivalence relations. * Categorical unification. * Practical use of non-classical unification, e.g. in expert systems and information retrieval. We expect potential participants from the following areas: multiple-valued logic, fuzzy logic, uncertainty in logic programming, categorical applications to computer science. The workshop will have a limited number of presentations and the organizers will apply a refereeing procedure accordingly. The format will be as a set of presentations followed by a round table discussion. As the number of participants is estimated not to be very large, time enough will be allocated for each presentation (between 30 and 40 minutes), thus helping to have a relaxed workshop atmosphere in which discussions are encouraged. Submission ---------- Authors are invited to submit an extended abstract of their papers, presenting original contributions to the workshop themes. The workshop proceedings will be published as an issue in the ENTCS series (Electronic Notes on Theoretical Computer Science). Submissions should be written in English and not exceed 15 pages using the ENTCS style, and sent to the organizers in either PS or PDF form, together with a text-only message containig: title, abstract and keywords, the author's full names, and address and e-mail for correspondence. Simultaneous submission to other meetings with published proceedings is not allowed. Important dates --------------- * 20.03.2002 Workshop paper submission deadline * 21.04.2002 Workshop paper acceptance notification * 10.05.2002 Workshop paper camera-ready deadline Organizing Committee -------------------- Patrik Eklund Manuel Ojeda-Aciego Dept. Computing Science Dept. Matematica Aplicada Umea University Universidad de Malaga mailto:peklund@cs.umu.se mailto:aciego@ctima.uma.es ---------------------------------------------------------- From jmj@info.fundp.ac.be Mon Mar 4 13:36:48 2002 From: jmj@info.fundp.ac.be (Jean-Marie JACQUET) Date: Mon, 4 Mar 2002 14:36:48 +0100 (MET) Subject: Flocasa: 1st Call for Paper Message-ID: <200203041336.g24DamB04309@backus.info.fundp.ac.be> [ Our apologies for multiple copies. ] ====================================================================== 1st International Workshop on Foundations of Coordination Languages and Software Architectures (Foclasa 2002) August 24, 2002, Brno, Czech Republic Workshop affiliated to CONCUR'2002, 20 - 23 August 2002. http://www.fi.muni.cz/concur2002/Foclasa ====================================================================== SCOPE AND TOPICS Modern information systems rely more and more on combining concurrent, distributed, mobile and heterogenous components. This move from old systems, typically conceived in isolation, induces the need for new languages and software architectures. In particular, coordination languages have been proposed to cleanly separate computational aspects and communication. On the other hand, software architects face the problem of specifying and reasoning on non-functional requirements. All these issues are widely perceived as fundamental to improve software productivity, enhance maintainability, advocate modularity, promote reusability, and lead to systems more tractable and more amenable to verification and global analysis. The aim of the workshop is to bring together researchers working on the foundations of component-based computing, coordination, and software architectures. Topics of interest include (but are not limited to): o Theoretical models for coordination (component composition, concurrency, dynamic aspects of coordination, semantics, expressiveness); o Specification, refinement, and analysis of software archi- tectures (patterns and styles, verification of functional and non-functional properties); o Coordination, architectural, and interface definition languages (implementation, interoperability, heterogeneity); o Agent-oriented languages (formal models for interacting agents); o Dynamic software architectures (mobile agents, configuration, reconfiguration); o Modeling of information systems (groupware, internet and the web, workflow management, CSCW and multimedia applications) o Coordination patterns (mobile computing, internet computing); o Tools and environments for the development of coordinated applications SUBMISSION GUIDELINES Papers describing original work are solicited as contributions to Foclasa. Submitted papers should be limited to 6 000 words, preferrably formatted according to the Fundamenta Informaticae style (available at http://fi.mimuw.edu.pl/submissions.html). They should be emailed as PostScript (PS) or Portable Document Format (PDF) files to jmj@info.fundp.ac.be. PROCEEDINGS The proceedings will be published as a technical report of the Institute of Informatics at the University of Namur, and will be available at the workshop. Selected papers will be published in a special issue of the Funda- menta Informaticae journal, with February 2003 as expected publi- cation time. IMPORTANT DATES: o May 25, 2002: Submission deadline. o June 30, 2002: Notification of acceptance. o August 1, 2002: Final version. o August 24, 2002: Meeting Date. LOCATION The workshop will be held in Brno in August 2002. It is a satellite workshop of CONCUR 2002. For venue and registration see the CONCUR web page at http://www.fi.muni.cz/concur2002/ WORKSHOP ORGANIZERS o Antonio Brogi (University of Pisa, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) PROGRAMME COMITTEE: o Antonio Brogi (University of Pisa, Italy) - Co-chair o Rocco De Nicola (University of Firenze, Italy) o Jos Luiz Fiadeiro (University of Lisbon, Portugal) o Roberto Gorrieri (Univerity of Bologna, Italy) o Paola Inverardi (Univerity L'Aquila, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) - Co-chair o Joost Kok (University of Leiden, The Netherlands) o Antonio Porto (New University of Lisbon, Portugal) From jmj@info.fundp.ac.be Mon Mar 4 13:39:27 2002 From: jmj@info.fundp.ac.be (Jean-Marie JACQUET) Date: Mon, 4 Mar 2002 14:39:27 +0100 (MET) Subject: Flocasa: 1st Call for Paper Message-ID: <200203041339.g24DdRv07236@backus.info.fundp.ac.be> [ Our apologies for multiple copies. ] ====================================================================== 1st International Workshop on Foundations of Coordination Languages and Software Architectures (Foclasa 2002) August 24, 2002, Brno, Czech Republic Workshop affiliated to CONCUR'2002, 20 - 23 August 2002. http://www.fi.muni.cz/concur2002/Foclasa ====================================================================== SCOPE AND TOPICS Modern information systems rely more and more on combining concurrent, distributed, mobile and heterogenous components. This move from old systems, typically conceived in isolation, induces the need for new languages and software architectures. In particular, coordination languages have been proposed to cleanly separate computational aspects and communication. On the other hand, software architects face the problem of specifying and reasoning on non-functional requirements. All these issues are widely perceived as fundamental to improve software productivity, enhance maintainability, advocate modularity, promote reusability, and lead to systems more tractable and more amenable to verification and global analysis. The aim of the workshop is to bring together researchers working on the foundations of component-based computing, coordination, and software architectures. Topics of interest include (but are not limited to): o Theoretical models for coordination (component composition, concurrency, dynamic aspects of coordination, semantics, expressiveness); o Specification, refinement, and analysis of software archi- tectures (patterns and styles, verification of functional and non-functional properties); o Coordination, architectural, and interface definition languages (implementation, interoperability, heterogeneity); o Agent-oriented languages (formal models for interacting agents); o Dynamic software architectures (mobile agents, configuration, reconfiguration); o Modeling of information systems (groupware, internet and the web, workflow management, CSCW and multimedia applications) o Coordination patterns (mobile computing, internet computing); o Tools and environments for the development of coordinated applications SUBMISSION GUIDELINES Papers describing original work are solicited as contributions to Foclasa. Submitted papers should be limited to 6 000 words, preferrably formatted according to the Fundamenta Informaticae style (available at http://fi.mimuw.edu.pl/submissions.html). They should be emailed as PostScript (PS) or Portable Document Format (PDF) files to jmj@info.fundp.ac.be. PROCEEDINGS The proceedings will be published as a technical report of the Institute of Informatics at the University of Namur, and will be available at the workshop. Selected papers will be published in a special issue of the Funda- menta Informaticae journal, with February 2003 as expected publi- cation time. IMPORTANT DATES: o May 25, 2002: Submission deadline. o June 30, 2002: Notification of acceptance. o August 1, 2002: Final version. o August 24, 2002: Meeting Date. LOCATION The workshop will be held in Brno in August 2002. It is a satellite workshop of CONCUR 2002. For venue and registration see the CONCUR web page at http://www.fi.muni.cz/concur2002/ WORKSHOP ORGANIZERS o Antonio Brogi (University of Pisa, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) PROGRAMME COMITTEE: o Antonio Brogi (University of Pisa, Italy) - Co-chair o Rocco De Nicola (University of Firenze, Italy) o Jos Luiz Fiadeiro (University of Lisbon, Portugal) o Roberto Gorrieri (Univerity of Bologna, Italy) o Paola Inverardi (Univerity L'Aquila, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) - Co-chair o Joost Kok (University of Leiden, The Netherlands) o Antonio Porto (New University of Lisbon, Portugal) From antony@apocalypse.org Mon Mar 4 14:04:13 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 04 Mar 2002 09:04:13 -0500 Subject: ANNOUNCE: GCJNI, a Java Native Interface forHaskell Message-ID: <3C837EDD.2010200@apocalypse.org> I am pleased to announce release 1.1 of GCJNI. GCJNI is a library that allows Haskell to invoke Java code via the Java Native Interface (JNI). The implementation uses GreenCard to make the JNI (a C language interface) available to Haskell. GCJNI includes a few convenient features, such as: - Integration of the Haskell and Java garbage collectors, so that Java objects are garbage collected when they are no longer accessible from Haskell. - Type class based overloading, which makes it easy to pass common types (like Int, Float and String) to or from Java code. - A tool (GenBindings) which uses Java reflection on a set of compiled Java classes to generate a Haskell module with a simple, high-level, type-safe interface to the underlying Java code. GCJNI has been succesfully tested using both hugs98 and ghc under both Linux and Windows. The distribution includes a unified Makefile system and detailed release notes that makes it very easy to configure, compile and install for any supported combination of Haskell implementation and platform. More information (including pointers to the relevant distributions) is available from the GCJNI web page at: http://www.haskell.org/gcjni Bug reports and feedback should be sent to antony@apocalypse.org. Enjoy! -------- News: Release 1.1 (03-March-2002): * Substantial improvements to configuration and build process. Unified Makefile structure for Linux and Windows using Cygwin and GNU make. -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From antony@apocalypse.org Mon Mar 4 14:07:42 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 04 Mar 2002 09:07:42 -0500 Subject: ANNOUNCE: Haven - A Functional Vector Graphics Library Message-ID: <3C837FAE.6030702@apocalypse.org> I am pleased to announce an experimental release of Haven, a library for scalable vector graphics in Haskell. Haven provides a wealth of features, including: - Data types for common geometric shapes such as rectangles, ellipses and Bezier curves. - Composition of arbitrary shapes from sequences of straight and curved segments. - Intersection tests and bounds calculations on shapes. - Cropping of any image by any shape. - Affine transformations on images and paths. - Calculation of precise rectangular bounds of shapes and images. - High quality, anti-aliased rendering. - Scalable outline fonts. - Smooth blending of colors (gradients) - Alpha blending (transparency). - Fine-grained control of stroke width, join rules and end caps. - Constructive Area Geometry (CAG) for composing shapes using simple set-theoretic operations. Haven presents a purely functional API, but is implemented using the Java2D renderer. For more information on Haven, including examples and download instructions, please visit the haven web page at: http://www.haskell.org/haven Please send suggestions and bug reports to: antony@apocalypse.org Enjoy! -------- News: Release 1.1 (03-March-2002): * Substantial improvements to configuration and build process. Unified Makefile structure for Linux and Windows using Cygwin and GNU make. -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From rjchaaft@cs.uu.nl Mon Mar 4 14:09:03 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Mon, 04 Mar 2002 15:09:03 +0100 Subject: Why is this function type-correct Message-ID: <4.3.0.20020304144448.00b43af0@pop.students.cs.uu.nl> Hello, Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a -> b x = x 42 is equally well accepted, though I can't see why this type would be correct. (I'd expect it to be too general.) From rjchaaft@cs.uu.nl Mon Mar 4 14:11:15 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Mon, 04 Mar 2002 15:11:15 +0100 Subject: Why is this function type-correct Message-ID: <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> Hello, Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a -> b x = x 42 is equally well accepted, though I can't see why this type would be correct. (I'd expect it to be too general.) For what reasons are these types considered correct? Thanks, Rijk-Jan From webmaster@repositorio.com.br Mon Mar 4 14:03:55 2002 From: webmaster@repositorio.com.br (Fernando Henrique de Oliveira) Date: 4 Mar 2002 11:03:55 -0300 Subject: Convite Especial Message-ID: <019201c1c1a5$68f2ed00$0e03140a@netsinai.com> CONVITE ESPECIAL.=20 http://www.repositorio.com.br=20 Convidamos voc=EA a visitar o maior e mais completo site de = Inform=E1tica atualmente na Internet Brasileira.=20 S=E3o milhares de configura=E7=F5es, scripts, strings de modem, Linux, = Windows, Mac, Imac e outros ACESSO TOTALMENTE GRATUITO.=20 S=E3o mais de 150 categorias de busca com acesso a m=FAltiplas bases de = conhecimento.=20 Temos mais de 100Mb de perguntas e respostas em nosso banco de dados.=20 Fa=E7a como quase 2.000.000 de internautas, visite-nos.=20 N=C3O DEIXE DE NOS VISITAR.=20 Lembre-se, o acesso =E9 gratuito.=20 http://www.repositorio.com.br=20 Atenciosamente=20 Webmaster=20 De acordo com as diretivas aprovadas no 105o Congresso de Base = Normativas Internacionais sobre SPAM, Se=E7=E3o 301, Par=E1grafo (a) (2) = (c) Decreto S. 1618, T=EDtulo Terceiro, um E-mail n=E3o poder=E1 ser = considerado SPAM, enquanto inclua uma forma de ser removido.=20 Por isso se deseja ser exclu=EDdo da nossa lista responda esta mensagem = para remover@repositorio.com.br com o t=EDtulo "Remova". From simonmar@microsoft.com Mon Mar 4 14:23:17 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 4 Mar 2002 14:23:17 -0000 Subject: Why is this function type-correct Message-ID: <9584A4A864BD8548932F2F88EB30D1C60886F05A@TVP-MSG-01.europe.corp.microsoft.com> > Recently, I wrote a function similar to >=20 > x :: a > x =3D x 42 >=20 > which is type-correct (Hugs, Ghc, THIH). > Still, from the expression it is clear > that the type shoud have a function type. > The definition >=20 > x :: a -> b > x =3D x 42 >=20 > is equally well accepted, though I can't > see why this type would be correct. (I'd > expect it to be too general.) In two words: polymorphic recursion. You'll find that the compiler won't be able to derive a type for 'x' in either of the two examples you gave, but x has several types the most general of which is 'forall a. a' (ie. your first example). The fact that x has type 'forall a. a' is also a useful hint as to its behaviour - the only value that has such a type is bottom. Cheers, Simon From Jon.Fairbairn@cl.cam.ac.uk Mon Mar 4 14:25:00 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Mon, 04 Mar 2002 14:25:00 +0000 Subject: Why is this function type-correct In-Reply-To: Your message of "Mon, 04 Mar 2002 15:11:15 +0100." <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> Message-ID: <16162.1015251900@cl.cam.ac.uk> "Rijk J. C. van Haaften" wrote: > Recently, I wrote a function similar to > = > x :: a > x =3D x 42 > = > which is type-correct (Hugs, Ghc, THIH). > Still, from the expression it is clear > that the type shoud have a function type. > The definition > = > x :: a -> b > x =3D x 42 > = > is equally well accepted, though I can't > see why this type would be correct. (I'd > expect it to be too general.) > = > For what reasons are these types considered > correct? When you say x :: a you are asking that the compiler check that everything you say about x is consistent with x being acceptable where /any/ type is required. In the application x 42, it requires that x be a function, which is fine, because x has any type, and this includes functions. When you say x =3D x 42, this requires that the type returned from x 42 is the same as the type of x, again fine because if x::a, then x:: Integer -> a also, so x 42:: a. It works out in practise because x =3D x 42 gives x the value bottom, and bottom::a for all a. = J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From d95mback@dtek.chalmers.se Mon Mar 4 15:05:04 2002 From: d95mback@dtek.chalmers.se (Martin =?ISO-8859-1?Q?Norb=E4ck?=) Date: 04 Mar 2002 16:05:04 +0100 Subject: Why is this function type-correct In-Reply-To: <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> References: <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> Message-ID: <1015254305.27556.3.camel@caesar.safelogic.se> m=E5n 2002-03-04 klockan 15.11 skrev Rijk J. C. van Haaften: > Hello, >=20 > Recently, I wrote a function similar to >=20 > x :: a > x =3D x 42 >=20 > which is type-correct (Hugs, Ghc, THIH). > Still, from the expression it is clear > that the type shoud have a function type. It might interest you to know that this function is also type correct: x :: x x =3D x x x x x x I would like to see a compiler derive that type though... Regards, Martin --=20 [ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ] Opinions expressed above are mine, and not those of my future employees. SIGBORE: Signature boring error, core dumped From MarkoSchuetz@web.de Mon Mar 4 18:57:02 2002 From: MarkoSchuetz@web.de (Marko Schuetz) Date: Mon, 04 Mar 2002 19:57:02 +0100 Subject: ANNOUNCE: GCJNI, a Java Native Interface forHaskell In-Reply-To: <3C837EDD.2010200@apocalypse.org> References: <3C837EDD.2010200@apocalypse.org> Message-ID: <20020304195702E.marko@kinetic.ki.informatik.uni-frankfurt.de> Antony, at the given URI it says JDK 1.4 is required, do you know that there will be problems with 1.3 or is it expected to work with 1.3 also and just not tested? Thanks for your help Marko From Jon.Fairbairn@cl.cam.ac.uk Mon Mar 4 20:06:32 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Mon, 04 Mar 2002 20:06:32 +0000 Subject: Standard Library report: List union Message-ID: <17114.1015272392@cl.cam.ac.uk> The current library report defines unionBy like this: unionBy eq xs ys =3D xs ++ deleteFirstsBy eq (nubBy eq ys) xs why does it take the nub of ys, but not xs? I'd have expected unionBy eq xs ys =3D (nubBy eq xs) ++ deleteFirstsBy eq (nubBy eq ys) = xs J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From sqrtofone@yahoo.com Tue Mar 5 01:51:13 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Mon, 4 Mar 2002 19:51:13 -0600 (CST) Subject: Standard Library report: List union In-Reply-To: <17114.1015272392@cl.cam.ac.uk> Message-ID: On Mon, 4 Mar 2002, Jon Fairbairn wrote: > The current library report defines unionBy like this: > > unionBy eq xs ys = xs ++ deleteFirstsBy eq (nubBy eq ys) xs > > why does it take the nub of ys, but not xs? I'd have expected > > unionBy eq xs ys = (nubBy eq xs) ++ deleteFirstsBy eq (nubBy eq ys) xs > > Jón Pure guess, but... (no really!) For the sake of argument, lets define a ulist as a list where for all elements x in list l, there is no element n with index not equal to that of x (index being position of the element in the list) such that eq n x == True. In other words every element in a ulist appears only once. Suppose you (unionBy eq x y) to get a result. Suppose also that x is a ulist A. x is a ulist by argument. B. the result of (nubBy eq ys), lets call it z, is a ulist. C. the result of (deleteFirstsBye eq z xs) is a list which has no elements in common with xs). because (deleteFirstsBy eq) "deletes" elements and doesnt add,the result is a ulist. D. Adding new, unique, elements (elements not equal to a element in the ulist in question) to a ulist results in a ulist. E. Therefore (unionBy eq x y) is a ulist. Why should this be important? what if you wanted to fold the function (unionBy eq) over a list of lists to get a ulist? Assuming you start with an initial ulist, by your suggestion you'd be applying (nubBy eq) to a ulist (generated by the the repeated application (unionByeq), which would be the same as applying the identity function to a ulist. (meaning you have essentially one big nasty no-op)! However, in taking a look at unionBy, one might wonder why it isnt defined like so (assuming xs would be the accumulated ulist in the fold. unionBy eq xs ys = (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs or maybe better (to mirror (++)) unionBy' eq ys xs = (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs in using this definition, the number of conses with (:) should be linear (or less) with with the number of elements to be added to the first_ulist in the following folds. foldl (unionBy eq) first_ulist list_of_lists foldr (unionBy' eq) first_ulist list_of_lists So, is there aother reason I cannot think of? I'm sure I haven't covered all bases here. Thanks, Jay Cox From sqrtofone@yahoo.com Tue Mar 5 02:35:01 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Mon, 4 Mar 2002 20:35:01 -0600 (CST) Subject: Lazy Evaluation In-Reply-To: <15490.58454.607261.361196@waytogo.peace.co.nz> Message-ID: On Mon, 4 Mar 2002, Tom Pledger wrote: > Nguyen Phan Dung writes: > : > | mylist :: [Integer] > | mylist = [1..1000000000] > | > | In Hugs, I type mylist to print out all the elements inside. However, > | after printing about 22000 elements, the system crashs & outputs: > | "Garbage collection fails to reclaim sufficient memory" > > The declaration of mylist is a pattern binding, not a function binding > - see section 4.4.3 of the Haskell 98 report. > > What that means in this particular case is that the system saves the > result in case you want to use it again, rather than freeing the part > of the list it's already printed. > > Try typing [1..1000000000] at the Hugs prompt instead. So would wrapping such possibly fiendish entities as [1..] with the "const" function and replacing all references to the toplevel binding with "(binding ())" make sure that the first part of the list could be thrown away and re-computed if needed? Or does one need to NOINLINE it as well? Example to make myself clear: mylist = const [1..1000000000] main = print (mylist ()) It seems like we had a discussion about something very similar to this a few months ago on some haskell.org list. Thanks, Jay Cox From chak@cse.unsw.edu.au Tue Mar 5 07:50:09 2002 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Tue, 05 Mar 2002 18:50:09 +1100 Subject: CFP: 2002 Haskell Workshop Message-ID: <20020305185009O.chak@cse.unsw.edu.au> [My apologies if you receive multiple copies of this message] ------------------------------- C A L L F O R P A P E R S ------------------------------- ACM SIGPLAN 2002 Haskell Workshop Pittsburgh, PA, USA 3rd October 2002 (as part of PLI'02) =================================== The purpose of the Haskell Workshop is to discuss experience with Haskell, and possible future development of the language. The scope of the workshop includes all aspects of the design, semantics, theory, application, implementation, and teaching of Haskell. Previous Haskell Workshops have been held in La Jolla (1995), Amsterdam (1997), Paris (1999), Montreal (2000), and Firenze (2001). For detailed information please consult http://www.cse.unsw.edu.au/~chak/hw2002/ Submission deadline: *** 24th May 2002 *** ** P L E A S E N O T E ** * If there is sufficient demand, we will try to organise facilities for system demonstrations. If you are generally interested in demonstrating an application or tool written in Haskell, please contact the PC chair at your earliest convenience, so that we can judge demand. * Submission and publication information changed with respect to the provisional CFP published earlier. From fuzhezheng@hotmail.com Tue Mar 5 22:43:47 2002 From: fuzhezheng@hotmail.com (Zhe Fu) Date: Tue, 5 Mar 2002 14:43:47 -0800 Subject: how to read a file's content to a string? References: <20020305170102.A936D42239E@www.haskell.org> Message-ID: I want to read a file's content into a string. content :: FilePath -> String content f = readFile f But when there is a type error: Type error in explicitly typed binding *** Term : content *** Type : FilePath -> IO String *** Does not match : FilePath -> String How can I solve it? Thanks. Zhe From sqrtofone@yahoo.com Wed Mar 6 00:36:01 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Tue, 5 Mar 2002 18:36:01 -0600 (CST) Subject: how to read a file's content to a string? In-Reply-To: Message-ID: On Tue, 5 Mar 2002, Zhe Fu wrote: > I want to read a file's content into a string. > > content :: FilePath -> String > content f = readFile f > > But when there is a type error: > > Type error in explicitly typed binding > *** Term : content > *** Type : FilePath -> IO String > *** Does not match : FilePath -> String > > How can I solve it? > > Thanks. > > Zhe > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell Essentially, what you are trying to do is invalid. you have to write some function that results in a IO String. I haven't read these but they might help. (cut and paste from haskell wiki front page) ThatAnnoyingIoType: I have an IO String but I need a String - what do I do now? http://haskell.org/wiki/wiki?ThatAnnoyingIoType UsingIo: What's that IO type anyway? How do I do I/O in Haskell? http://haskell.org/wiki/wiki?UsingIo Jay Cox From afelty@site.uottawa.ca Wed Mar 6 03:02:57 2002 From: afelty@site.uottawa.ca (Amy Felty) Date: Tue, 5 Mar 2002 22:02:57 -0500 (EST) Subject: New Deadline: Special Journal Issue on Proof-Carrying Code Message-ID: * * * * New Deadline: April 12, 2002 Call for Papers JOURNAL OF AUTOMATED REASONING Special issue on PROOF-CARRYING CODE Proof-carrying code is a technology that allows a host, or code consumer, to safely run code delivered by an untrusted code producer. The code producer delivers both a program and a formal proof that verifies that the code meets the desired safety policies. Safety policies generally express properties that prohibit the code from harmful behavior such as accessing private data, overwriting important data, accessing unauthorized resources, or consuming too many resources. Ideally, a proof is constructed automatically, and proof search may be directed using information that is passed on from the code producer's compiler. Proofs provided semi-automatically or interactively using a proof assistant are possible as well. Upon receiving the code and proof, the code consumer uses a mechanical proof checker to check the proof before executing the code. This special issue will be devoted to the topic of proof-carrying code and related approaches which use formal reasoning to enhance safety and reliability of software. Manuscripts emphasizing original results and study of tools and methods for proof generation, proof checking, and their integration with code generation/compilation are of particular interest. Manuscripts should be unpublished works and not submitted elsewhere. Revised and enhanced versions of papers published in conference proceedings that have not appeared in archival journals are eligible for submission. All submissions will be reviewed according to the usual standards of scholarship and originality. Information on JAR submissions can be found at URL http://www-unix.mcs.anl.gov/JAR/. Please format your submissions using JAR macros (available at http://www.wkap.nl/kaphtml.htm/STYLEFILES). Submissions should be sent to the guest editor in postscript format, preferably gzipped and uuencoded. In addition, please send as plain text, the title, authors, abstract, and contact information for the paper. The submission deadline is April 12, 2002. Guest Editor: Amy Felty, University of Ottawa, afelty@site.uottawa.ca This information is available on the web at: http://www.site.uottawa.ca/~afelty/jar-pcc/ From icsm2002.info@unisannio.it Wed Mar 6 12:49:21 2002 From: icsm2002.info@unisannio.it (icsm2002.info@unisannio.it) Date: Wed, 6 Mar 2002 13:49:21 +0100 (CET) Subject: Icsm 2002 Call for Papers: deadline is approaching Message-ID: <200203061249.g26CnLm07282@unisannio.it> Dear Colleague I would like to remind you that the ICSM full paper submission deadline is approaching. ICSM (IEEE International Conference on Software Maintenance), 2002, and associated workshops: SCAM, WSE, and WESS will be held next October 2002 in Montreal, Canada. Outstanding Keynotes such as Jon Pincus, Microsoft, Industrial and experience papers, research papers, tutorials, tool expositions, dissertation forum, workshops, panels, and other exciting activities have been planned. Papers are due by 18 March 2002 You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt we hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. If you would like to be removed from our list please send an email to icsm2002.info@unisannio.it with REMOVE in the subject. ICSM2002 Giuliano Antoniol, Program CoChair Ira D. Baxter, Program CoChair ============================================================================ IEEE International Conference on Software Maintenance 2002 Sponsored by IEEE ICSM-2002, Montreal, Canada, 3-6 October 2002 http://www.icsm2002.org icsm2002.info@unisannio.it Call for Papers Theme: Maintaining distributed heterogeneous systems ICSM is the major international conference in the field of software and systems maintenance, evolution, and management. This year's theme elaborates on last year's theme of "systems and software evolution in the era of the internet". Standalone legacy applications of yesterday and novel applications using today's technologies are rapidly becoming integrated as part of enterprise-wide and industry-wide systems. The need for rapid integration has led to many distributed heterogeneous systems that are very challenging to maintain and evolve. ICSM 2002 will address these new scenarios and the major challenges of maintenance and evolution. The focus of the conference will be on the new challenges that heterogeneous systems pose for software maintenance, and the new opportunities for researchers and practitioners. A main goal of ICSM is to promote interaction between researchers and practitioners. ICSM 2002 will bring together researchers, practitioners, developers and users of tools, technology transfer experts, and project managers. Jon Pincus (Microsoft) will describe how Microsoft handles software enhancements. Other outstanding Keynote speakers are being arranged. Past conferences have had Parnas, Rombach, McCabe, and Jacobson. ICSM-2002 will offer technical presentations and demonstrations from academia and industry. We are particularly interested in exchanging concepts, prototypes, research ideas, and other results that could contribute to the academic arena and also benefit business and the industrial community. ICSM 2002 will be participatory, with working collaborative sessions and presentations of industry projects. The Conference will be held in conjunction with: WESS -- Workshop on Empirical Studies of Software Maintenance. SCAM -- Source Code Analysis and Manipulation WSE -- Workshop on WEBsite Evolution Topics of interest include but are not restricted to the following aspects of maintenance and evolution: - Methods and theories - Maintenance and/or productivity metrics - Organizational frameworks - Preventive maintenance - Design for maintenance - Tools and environments - Life cycle and process control - Models/methods for error prediction - User interface evolution - Commercial off-the-shelf (COTS) - Third party maintenance - Freeware and open source applications - Program comprehension - Software and system visualisation - Knowledge based systems - Measurement of software - Formal methods - Legal aspects and standards - Software reusability - Internet and distributed systems - Empirical studies - Testing and regression testing - Remote, tele-work - Version and configuration management - Processes and strategies - Management and organisation - Co-operative applications - Source code analysis and manipulation - Processes and strategies - Impact of new software practices - Programming languages - Reengineering and reverse engineering - Multimedia systems RESEARCH PAPERS: Research papers should describe original and significant work in the research and practice of software maintenance and evolution. Case studies, empirical research, and experiments are particularly welcome. We also welcome papers that present leading edge and novel ideas in maintenance. Papers must not exceed 5000 words (10 pages IEEE style) in length, in English. To encourage strong submissions a prize will be awarded for the "Best Paper as Submitted". This Prize is offered by John Wiley & Sons, the publishers of the Journal of Software Maintenance and Evolution. The Program Committee will select the winner and a formal presentation of the Prize will be made in Montreal at ICSM 2002. FAST TRACK PAPERS: Fast Track papers should describe on-going research activities, or summarize the experience in software maintenance and evolution. Papers must not exceed 4 pages, IEEE style, in length, in English. Accepted fast-track papers will be included in a dedicated section of the conference proceedings. DISSERTATION FORUM: We welcome submissions of young researchers that have delivered their dissertation (Masters or Ph.D.) in the last three years. An award will be issued for the best submission. Four page summaries of accepted dissertations will be included in the conference proceedings and a special forum section will be organised at the conference. INDUSTRIAL APPLICATIONS: Proposals for presentations of Industrial Applications are welcome. These can be state-of-the-art descriptions, experience reports and survey reports from real projects, industrial practices and models, or tool demonstrations. A dedicated sub-committee of the program committee will review Industrial Application proposals and a 1-page summary of accepted proposals will be included in the conference proceedings. TUTORIALS: Tutorials should present software maintenance and evolution topics of interest to practitioners. Tutorials may be full day or half-day in length. SUBMISSION STYLE: PDF and/or Postscript electronic submission only. Papers longer than 15 pages or 6000 words will be returned to the authors. Acceptance notification will occur July 1, 2002. IMPORTANT DATES You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt Research Papers deadline: 18 March 2002 mailto:icsm2002.full@unisannio.it Fast Track Papers deadline: 1 May 2002 mailto:icsm2002.short@unisannio.it Dissertation Forum deadline: 1 May 2002 mailto:icsm2002.thesis@unisannio.it Industrial Applications deadline: 1 May 2002 mailto:icsm2002.industry@unisannio.it Tutorials deadline: 18 March 2002 mailto:icsm2002.tutorial@unisannio.it From Ralf.Laemmel@cwi.nl Wed Mar 6 14:13:37 2002 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Wed, 06 Mar 2002 15:13:37 +0100 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <3C862411.EA847B63@cwi.nl> Suppose you want to define a combinator like this: combinator :: (forall y. Class y => y -> y) -> (forall x. Class x => x -> x) This is a function combinator which turns a polymorphic function into another polymorphic function. As you can see, there is Class constraint. So in fact we would like to define the combinator by class overloading on the x in the result type. So how do we get our hands on the x while it is explicitly quantified by forall. Well, we try with implicit quantification: class Class x where combinator' :: (forall y. Class y => y -> y) -> x -> x So far so, good: We still need to define combinator in terms of combinator'. What is the trick to do this? Sounds like a homework question? Well, I know how to do it for first-class polymorphism. So let's restart the example. We define a function type to capture the kind of functions from above: data Bar = Foo (forall x. Class x => x -> x) Hence, the rank-2 type of combinator looks a bit different: combinator :: Bar -> Bar The class looks as follows: class Class x where combinator' :: Bar -> x -> x And here is how to define combinator in terms of combinator'. combinator f = Foo (combinator' f) This works both with GHC and hugs. In the pure rank-2 setting above, one would like to define combinator accordingly: combinator f = combinator' f But GHC 5.02.2 tells me: rank2.hs:11: Could not deduce (Class x) from the context () Probable fix: Add (Class x) to the type signature(s) for combinator arising from use of `combinator'' at rank2.hs:11 In the definition of `combinator': combinator' f This is not a bug, I guess although the probable fix proposal sends you in the wrong direction I claim. I tried a few other tricks but I can't get it done although my first-class polymorphic experience makes me think that it should be possible. Anyway, can this problem be solved? Any hint appreciated. Ralf -- Dr.-Ing. Ralf Laemmel CWI & VU, Amsterdam, The Netherlands http://www.cwi.nl/~ralf/ http://www.cs.vu.nl/~ralf/ From haskell-cafe@haskell.org Wed Mar 6 20:37:52 2002 From: haskell-cafe@haskell.org (Joe English) Date: Wed, 06 Mar 2002 12:37:52 -0800 Subject: ANNOUNCE: HXML 0.2, XML parser for Haskell Message-ID: <200203062037.g26Kbqu17149@dragon.flightlab.com> Announcing HXML version 0.2, a non-validating XML parser written in Haskell. It is designed for space-efficiency, taking advantage of lazy evaluation to reduce memory requirements. HXML is available at: The current version is 0.2, and is pre-beta quality. HXML has been tested with GHC 5.02, NHC 1.10, and various recent versions of Hugs 98. Changes in version 0.2: + New Arrow-based combinator library + Added support for CDATA sections + New function parseDocument recognizes (and ignores) the document prolog (XML and DOCTYPE declarations) + Several data structures and public functions have been renamed + Space fault in comment parsing fixed Please contact Joe English with any questions, comments, or bug reports. --Joe English jenglish@flightlab.com From ashley@semantic.org Thu Mar 7 00:03:49 2002 From: ashley@semantic.org (Ashley Yakeley) Date: Wed, 6 Mar 2002 16:03:49 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <200203070003.QAA25030@mail4.halcyon.com> At 2002-03-06 06:13, Ralf Laemmel wrote: >This is not a bug, Isn't it? Consider: class Class x where combinator' :: (forall y. Class y => y -> y) -> x -> x This gives: combinator' :: forall x. Class x => (forall y. Class y => y -> y) -> x -> x What happens when you pass something of type (forall y. Class y => y -> y)? s :: forall x. Class x => x -> x s = combinator' id; So I would claim that these two types are the same: forall x. Class x => (forall y. Class y => y -> y) -> x -> x (forall y. Class y => y -> y) -> (forall x. Class x => x -> x) ...so you should be able to do this: combinator :: (forall y. Class y => y -> y) -> (forall x. Class x => x -> x) combinator f x = combinator' f x but for some reason GHC 5.02.2 complains. I think this is a bug. Apparently 5.03 has rank-N polymorphism so maybe this is fixed too. -- Ashley Yakeley, Seattle WA From libertyHGH@btamail.net.cn Thu Mar 7 02:55:45 2002 From: libertyHGH@btamail.net.cn (libertyHGH@btamail.net.cn) Date: Wed, 6 Mar 2002 18:55:45 -0800 Subject: == Feel & Look 10 Years Younger in 10 Weeks With HGH == 3919139765443333222222 Message-ID: One more bulk email --- aren't you the least bit curious to find out what it's about? Well, call us Toll Free at 1-888-248-4571. OR, read on ............................................... HAVE YOU HEARD OF HUMAN GROWTH HORMONE (HGH)??? (This product works best for people over 35) Released by your own pituitary gland, HGH starts declining in your 20s, even more in your 30s and 40s, eventually resulting in the shrinkage of major organs -- plus, all other symptoms related to old age. IN THOUSANDS OF CLINICAL STUDIES, HGH HAS BEEN SHOWN TO ACCOMPLISH THE FOLLOWING: * Reduce Body Fat and Build Lean Muscle WITHOUT EXERCISE! * Enhance Sexual Performance * Remove Wrinkles and Cellulite * Lower Blood Pressure and Improve Cholesterol Profile * Improve Sleep, Vision and Memory * Restore Hair Color and Growth * Strengthen the Immune System * Increase Energy and Cardiac Output * Turn back your body's Biological Time Clock 10 - 20 years * Live Longer AND Stronger All natural and organic plant based FEEL 10 YEARS YOUNGER WITH ORAL SPRAY HGH. GUARANTEED We are the manufacturer and we sell directly to Doctors, Chiropractors, and consumers world wide the highest grade HGH Oral Spray available. With internet marketing, we are able to save advertising cost and pass those savings along to you. But you must act now. To receive more information call us anytime (24hrs) TOLL FREE 1-888-248-4571 We must speak to you in person to qualify your usage. All of your questions will be addressed and answered in a friendly, no pressure manner. Our main purpose is to provide you with information so you can make an educated decision. For more information call 1-888-248-4571. If you are on line write down our phone number and call us when you can. Soon, you and your loved ones will be very glad you did. Read what people are saying: "The effects of 6 months of GH on lean body mass and fat were equivalent in magnitude to the changes incurred during 10-20 years of aging." Dr. Daniel Rudman, MD, New England Journal of Medicine. "Within four months, my body fat decreased form 30% down to 21%! I noticed my skin is more supple and my overall mental outlook improved significantly." D.W., New Jersey "We have been on the spray for just 3 weeks now, and besides the tremendous energy we both feel, my husbands allergies and spells of depression have lifted. I am healing extremely fast after an accident and have lost 7 lbs. without trying!" C.B., Flagstaff. AZ Thanks for reading our letter, The HGH Staff USA Division PS: The HGH Staff guarantees the highest quality and lowest price. We manufacture and ship directly to your door. Call us now 1-888-248-4571 Offer expires March 30, 2002 *********************************************************** ======= End of message ======== To Qualify for a Free HGH Consultation call the HGH Staff -- Today. *********************************************************** The following statement is provided to be in compliance with commercial email laws. If you do not wish to receive further mailings, please click reply and enter remove in the email subject line then click send. This message is in full compliance with U.S. Federal requirements for commercial email under bill S.1618 Title lll, Section 301, Paragraph (a)(2)(C) passed by the 105th U.S. Congress and is not considered SPAM since it includes a remove mechanism. *********************************************************** This message is not intended for residents in the states of CA, NC, NV, RI, TN, VA & WA. Screening of addresses has been done to the best of our technical ability. *********************************************************** -------------------------------------------------------------------------------- From Rijk J. C. van Haaften" Hello everybody, Although I didn't manage to reproduce the bug with a minimal example, I think it is still important enough to tell you (and especially the Hugs writers and maintainers)=2E Yesterday evening, I tried to add some correct (!) code (by-hand-verifyable; by GHC accepted; just using plain Haskell 98) to one of the projects I'm working on=2E Hugs however said this: Type checking ERROR "TypeInferDecls=2Ehs":102 - Type error in application *** Expression : checkedUnify (snd newTyEnv) inferredHpPtr explicitHpP= tr (\t1 t2 ue -> ([l],ExplicitError n t1 t2 ue)) *** Term : checkedUnify *** Type : NonGenerics -> HpPtr -> HpPtr -> ErrorFunction -> TI = Error () *** Does not match : a -> b -> c -> d -> e *** Because : types do not match I've read this ten times, checked my code looking whether I were doing strange things, but I can only conclude: This is, even without a minimal example, clearly a bug: the types do match=2E Moreover, the bug is reported about a completely different part of the file (relative to the location I edited), in code almost unrelated to the code I added (about line 300)=2E I have explicit types everywhere in that file, so if it were wrong, the error should be reported about line 300=2E So the reporting-place is wrong (but I don't expect Hugs to report good error-placement)=2E Though I didn't manage to write a minimal example, I hope our Hugs experts are able to find the bug soon=2E As a last point: the file is rather big: 726 lines of code, 27KB=2E Rijk-Jan van Haaften From Ralf.Laemmel@cwi.nl Thu Mar 7 09:27:20 2002 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Thu, 07 Mar 2002 10:27:20 +0100 Subject: class hierarchies inmature in hugs Message-ID: <3C873278.BF98B97A@cwi.nl> I just saw someone "misusing" haskell@haskell.org for bug reports. I am going to join especially - it is a funny one, - the bug hasn't been fixed since Sep. 2001, - it is not even put in the list of known bugs since then. --------------------------------------------------------------- The following code works with ghc but not with hugs (incl. Dec. 2001 release) import Monad class Monad m => C1 m x -- Monad m is implied by C1 but test diverges if constraint not present class (C1 m x) => C2 m x where c2 :: x -> m x instance Monad m => C1 m Bool instance C2 Maybe Bool where c2 = return test :: Maybe Bool test = c2 True --------------------------------------------------------------- So you see, C1 is a kind of derived from Monad. C2 is derived from C1 and hence implicitly from Monad. This is a kind of minimal example. Just attempt to evaluate "test". hugs will loop. There is a way to help hugs. Add Monad m as a further class constraint to C2. Then it will work. Please note both programs do type check, and this is in fact fine. More generally, I get these looping programs whenever I have non-trivial class hierarchies with three or more layers. I guess more people should have suffered from that? Ralf -- Dr.-Ing. Ralf Laemmel CWI & VU, Amsterdam, The Netherlands http://www.cwi.nl/~ralf/ http://www.cs.vu.nl/~ralf/ From Rijk J. C. van Haaften" Dear all, After intensive investication of several people here at Utrecht University, these are the results 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the current distribution, the problems disappeared Therefore, I suspect there have been one or more bug-fix updates after December 2001, fixing this problem. However, I couldn't find that documented on the Hugs site. Can anyone confirm such an update? Where can I find last- minute distribution information? Thanks, Rijk-Jan From Rijk J. C. van Haaften" Dear all, After intensive investication of several people at Utrecht University, these are the results: 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the current distribution, the problems disappeared. Therefore, I suspect there have been one or more bug-fix updates after December 2001, fixing this problem. However, I couldn't find that documented on the Hugs site. Can anyone confirm such an update? Where can I find last-minute distribution information? Thanks, Rijk-Jan From bernhard@cogs.susx.ac.uk Thu Mar 7 12:05:38 2002 From: bernhard@cogs.susx.ac.uk (Bernhard Reus) Date: Thu, 07 Mar 2002 12:05:38 +0000 Subject: type aliases in instances Message-ID: <3C875792.DEB308C3@cogs.susx.ac.uk> In Haskell type aliases are not allowed in instance definitions. Is there a particular reason for this? For example, is there a problem with type inference? I noticed that when composing monads (in the Moggi/Wadler style) one easily ends up with a cascade of coercions enforced by datatype declarations. Looks a bit tedious. This can be avoided by using type aliases but then the monads in use cannot be instances of the Monad class. Phil uses aliases in his "Essence of functional programming" paper too. But not declaring the monads to be in class Monad can hardly be good style, can it? Many thanks for your help in advance. Bernhard --- Bernhard Reus, COGS University of Sussex From doaitse@cs.uu.nl Thu Mar 7 15:54:17 2002 From: doaitse@cs.uu.nl (S. Doaitse Swierstra) Date: Thu, 7 Mar 2002 16:54:17 +0100 Subject: new version of Parser Combinators and Syntax Macros's (beta) Message-ID: --============_-1196606036==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" At: http://www.cs.uu.nl/groups/ST/Software/UU_Parsing you will find the latest/greatest version of our combinators, that are: - faster (faster than Parsec) - correct much faster - compute results lazily, and produce error messages online in the IO monad while parsing (using unsafeInterleavedIO) - are compatible with the syntax macro mechanism we have implemented (beta): http://www.cs.uu.nl/~arthurb/index.html Doaitse -- -- __________________________________________________________________________ S. Doaitse Swierstra, Department of Computer Science, Utrecht University P.O.Box 80.089, 3508 TB UTRECHT, the Netherlands Mail: mailto:doaitse@cs.uu.nl WWW: http://www.cs.uu.nl/ tel: +31 30 253 3962 fax: +31 30 251 3791 mobile: +31 6 2880 1680 __________________________________________________________________________ --============_-1196606036==_ma============ Content-Type: text/html; charset="us-ascii" new version of Parser Combinators and Syntax Macros's
At:

 http://www.cs.uu.nl/groups/ST/Software/UU_Parsing
you will find the latest/greatest version of our combinators, that are:

 - faster (faster than Parsec)
 - correct much faster
 - compute results lazily, and produce error messages online in the IO monad while parsing
   (using unsafeInterleavedIO)
 - are compatible with the syntax macro mechanism we have implemented (beta):
   http://www.cs.uu.nl/~arthurb/index.html
Doaitse
--

-- 
__________________________________________________________________________
S. Doaitse Swierstra, Department of Computer Science, Utrecht University
                      P.O.Box 80.089, 3508 TB UTRECHT,   the Netherlands
                      Mail:  mailto:doaitse@cs.uu.nl          
                      WWW:   http://www.cs.uu.nl/

                      tel:    +31 30 253 3962
                      fax:    +31 30 251 3791
                      mobile: +31 6 2880 1680
__________________________________________________________________________
--============_-1196606036==_ma============-- From alimarin@cs.kun.nl Thu Mar 7 16:26:59 2002 From: alimarin@cs.kun.nl (Artem S Alimarine) Date: Thu, 07 Mar 2002 17:26:59 +0100 Subject: rank-n polymorphism Message-ID: <3C8794D3.5D713D23@cs.kun.nl> Dear all, GHC 5.0.3 supports rank-n polymorphism. Could anyone please point me to a paper that describes type inference algorithm used. Thanks in advance Artem Alimarine From moran@galois.com Thu Mar 7 17:03:38 2002 From: moran@galois.com (Andy Moran) Date: Thu, 7 Mar 2002 09:03:38 -0800 Subject: rank-n polymorphism In-Reply-To: <3C8794D3.5D713D23@cs.kun.nl> References: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: <200203071703.g27H3dp02321@galois.com> On Thursday 07 March 2002 08:26 am, you wrote: > Dear all, > > GHC 5.0.3 supports rank-n polymorphism. > Could anyone please point me to a paper that describes type inference > algorithm used. The main paper is "Putting Type Annotations to Work" by Odersky and L"aufer: @InProceedings{Odersky-Laufer96, author = "Martin Odersky and Konstantin L{\"a}ufer", title = "Putting Type Annotations to Work", key = "Odersky \& Laufer", pages = "54--67", booktitle = "Conference Record of POPL '96: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, St. Petersberg Beach, Florida", year = "1996", organization = "ACM", address = "New York, NY", month = jan, annote = "31 references.", } Cheers, Andy -- Andy Moran Ph. (503) 526 3472 Galois Connections Inc. Fax. (503) 350 0833 3875 SW Hall Blvd. http://www.galois.com Beaverton, OR 97005 moran@galois.com From hdaume@ISI.EDU Thu Mar 7 17:11:08 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Thu, 7 Mar 2002 09:11:08 -0800 (PST) Subject: rank-n polymorphism In-Reply-To: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: Someone already sent you the Odersky paper, but in brief, there is no type inference (as it is undecidable). Rank-n polymorphism can only happen via explicit type signatures. My understanding is that if these type signatures are not there, GHC will automatically lift all the foralls to the front in type inference. - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On Thu, 7 Mar 2002, Artem S Alimarine wrote: > Dear all, > > GHC 5.0.3 supports rank-n polymorphism. > Could anyone please point me to a paper that describes type inference > algorithm used. > > Thanks in advance > Artem Alimarine > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From mbs@cse.ogi.edu Thu Mar 7 17:26:39 2002 From: mbs@cse.ogi.edu (Mark B Shields) Date: Thu, 7 Mar 2002 17:26:39 +0000 Subject: rank-n polymorphism In-Reply-To: Msg of Thursday 7-March-2002 09:11:08 -0800 References: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: <15495.41679.150665.300221@mbs.cse.ogi.edu> > > GHC 5.0.3 supports rank-n polymorphism. > > Could anyone please point me to a paper that describes type inference > > algorithm used. > Rank-n polymorphism can only happen via explicit type signatures. SPJ and I are working on a formal description of how all of this works, and should have a manuscript ready in few weeks. Yes: the inference is based on Odersky & Laufer, and yes: the trick is to exploit type annotations. The full system, however, has required quite a few innovations beyond this. Our manuscript also describes how to extend Haskell with first-class existentials, in the style described in our FOOL 9 paper "First-class modules for Haskell." Fun for all the family. Regards, Mark From dianne_yang@yahoo.com Thu Mar 7 22:54:01 2002 From: dianne_yang@yahoo.com (yang dianne) Date: Thu, 7 Mar 2002 14:54:01 -0800 (PST) Subject: Question: Database access in Haskell Message-ID: <20020307225401.82817.qmail@web11702.mail.yahoo.com> Dear Sir/Madam, I am considering implement a system using Haskell. I need to use database to manage data there. How can I access the data records in database from Haskell? Thanks for your advice! Best Regards, Dianne __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ From awfurtado@uol.com.br Fri Mar 8 01:49:00 2002 From: awfurtado@uol.com.br (Andre W B Furtado) Date: Thu, 7 Mar 2002 22:49:00 -0300 Subject: pattern-matching with labelled types Message-ID: <004f01c1c643$77f15e20$d632e3c8@windows9> If I have: > data MyType = MT { > x :: Int, > y :: Char > } How do I update the Int value of MyType leaving the Char value unaffected? I tryied something like: > MT {x = newValue} but GHC gave me a warning about the Char value and it indeed caused strange effects. Of course, it is possible to do something like > update :: MyType -> Int -> MyType > update mt newValue = MT {x = newValue, y = oldValue} > where oldValue = y mt but this really annoys me when MyType has too many fields. Suggestions? Thanks a lot, -- Andre From Tom.Pledger@peace.com Fri Mar 8 01:52:52 2002 From: Tom.Pledger@peace.com (Tom Pledger) Date: Fri, 8 Mar 2002 14:52:52 +1300 Subject: pattern-matching with labelled types In-Reply-To: <004f01c1c643$77f15e20$d632e3c8@windows9> References: <004f01c1c643$77f15e20$d632e3c8@windows9> Message-ID: <15496.6516.434722.555847@waytogo.peace.co.nz> Andre W B Furtado writes: : | Of course, it is possible to do something like | | > update :: MyType -> Int -> MyType | > update mt newValue = MT {x = newValue, y = oldValue} | > where oldValue = y mt | | but this really annoys me when MyType has too many fields. Suggestions? update mt newValue = mt {x = newValue} HTH. Tom From awfurtado@uol.com.br Fri Mar 8 03:52:58 2002 From: awfurtado@uol.com.br (Andre W B Furtado) Date: Fri, 8 Mar 2002 00:52:58 -0300 Subject: labelled types efficiency Message-ID: <000001c1c655$765e5ce0$e733e3c8@windows9> Another question about labelled types, this time concerning about efficiency: is there any efficiency differences between functions f and g below? > data RType = R Int Char > data Stype = S {x :: Int, y :: Char} > > f :: RType -> Int > f (R x _) = x > > g :: SType -> Int > g s = x s Thanks again, -- Andre From uk1o@rz.uni-karlsruhe.de Fri Mar 8 07:14:43 2002 From: uk1o@rz.uni-karlsruhe.de (Hannah Schroeter) Date: Fri, 8 Mar 2002 08:14:43 +0100 Subject: labelled types efficiency In-Reply-To: <000001c1c655$765e5ce0$e733e3c8@windows9> References: <000001c1c655$765e5ce0$e733e3c8@windows9> Message-ID: <20020308071442.GA22049@rz.uni-karlsruhe.de> Hello! On Fri, Mar 08, 2002 at 12:52:58AM -0300, Andre W B Furtado wrote: > Another question about labelled types, this time concerning about > efficiency: is there any efficiency differences between functions f and g > below? > > data RType = R Int Char > > data Stype = S {x :: Int, y :: Char} > > f :: RType -> Int > > f (R x _) = x > > g :: SType -> Int > > g s = x s > Thanks again, > -- Andre In principle, the representation of RType and Stype is the same. The only difference of Stype over RType is the implicit definition of the functions (accessors) x and y, as well as the syntactic sugar for constructing values, pattern matching and functional update using field names. But as said, that's just functional sugar and should be just exactly as efficient as using the manual translation of those constructs on RType. Now, that said, g *looks* a bit more lazy than f, as in f, you don't evaluate the right side if the parameter isn't R _|_ _|_ or more. However, I said *looks*, but if one checkes, it's thus, desugared: f (R x _) = x g s = x s where x (S xElem _yElem) = xElem And if you just evaluate both at _|_, the result is _|_ for both f and g. So in fact, there equally strict. Finally, the code for f and g should, save for renaming, be just the same. Kind regards, Hannah. From ronny@cs.kun.nl Fri Mar 8 09:49:10 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 08 Mar 2002 10:49:10 +0100 Subject: rank-n polymorphism In-Reply-To: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: <5.1.0.14.0.20020308104447.02e19680@localhost> Artem Alimarine asks: >GHC 5.0.3 supports rank-n polymorphism. >Could anyone please point me to a paper that describes type inference >algorithm used. "Putting Type Annotations To Work", Martin Odersky and Konstantin Läufer. In Proceedings, 23rd ACM Symposium on Principles of Programming Languages, St. Petersburg, Florida, January 1996. Available from . Cheers, Ronny Wichers Schreur From simonpj@microsoft.com Fri Mar 8 12:40:41 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 8 Mar 2002 04:40:41 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE19374A47@RED-MSG-10.redmond.corp.microsoft.com> | So I would claim that these two types are the same: |=20 | forall x. Class x =3D> (forall y. Class y =3D> y -> y) -> x -> x | (forall y. Class y =3D> y -> y) -> (forall x. Class x =3D> x -> x) |=20 | ...so you should be able to do this: |=20 | combinator :: (forall y. Class y =3D> y -> y) -> (forall x.=20 | Class x =3D> x -> x) | combinator f x =3D combinator' f x |=20 | but for some reason GHC 5.02.2 complains. I think this is a bug.=20 Indeed the two types are the same. In fact GHC does "forall-lifting" on type signatures to bring the foralls to the front. But there's a bug in 5.02's forall-lifting... it doesn't bring the constraints to the front too. I fixed this in 5.03 a while ago, but didn't back-propagate the fix to=20 5.02. And indeed, 5.03 is happy with the pure rank-2 program. class Class x where combinator' :: (forall y. Class y =3D> y -> y) -> x -> x combinator :: (forall y. Class y =3D> y -> y) -> (forall x. Class x =3D> x -> x) combinator f =3D combinator' f It's quite a bit of extra work propagating fixes into the 5.02 branch, so I probably won't do so for this one, since only a small minority of people will trip over it. Perhaps you can try the 5.03 snapshot release? Simon From simonpj@microsoft.com Fri Mar 8 12:40:43 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 8 Mar 2002 04:40:43 -0800 Subject: rank-n polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE19374A4C@RED-MSG-10.redmond.corp.microsoft.com> This is a multi-part message in MIME format. ------_=_NextPart_001_01C1C69E.767EA3BC Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Mark Shields and I are writing a paper. The technical basis is in "Putting type annotations to work" Odersky/Laufer, POPL'96. Simon | -----Original Message----- | From: Artem S Alimarine [mailto:alimarin@cs.kun.nl]=20 | Sent: 07 March 2002 16:27 | To: haskell@haskell.org | Subject: rank-n polymorphism |=20 |=20 | Dear all, |=20 | GHC 5.0.3 supports rank-n polymorphism. | Could anyone please point me to a paper that describes type=20 | inference algorithm used. |=20 | Thanks in advance | Artem Alimarine |=20 | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |=20 ------_=_NextPart_001_01C1C69E.767EA3BC Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 eJ8+IiwMAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEEgAEAGAAAAFJFOiByYW5rLW4gcG9seW1v cnBoaXNtAIsIAQWAAwAOAAAA0gcDAAgABAAoACsABQBAAQEggAMADgAAANIHAwAIAAQAKAArAAUA QAEBCYABACEAAAA5M0MwREI3NUFFNjEzOTRCODE1NEQ0Qjc3NTM0RDRBOAAnBwEDkAYAEAgAADMA AAALAAIAAQAAAAMAJgAAAAAAAwAuAAAAAAADADYAAAAAAEAAOQC8o352nsbBAR4APQABAAAABQAA AFJFOiAAAAAAAgFHAAEAAAAyAAAAYz1VUzthPU1DSTtwPW1zZnQ7bD1SRUQtTVNHLTEwLTAyMDMw ODEyNDA0M1otNzYyNQAAAB4AcAABAAAAFAAAAHJhbmstbiBwb2x5bW9ycGhpc20AAgFxAAEAAAAb AAAAAcHF9NEdYPgncoQKT0OGj10Tp+eXIgACiozAAB4AGgwBAAAAEwAAAFNpbW9uIFBleXRvbi1K b25lcwAAHgAdDgEAAAAUAAAAcmFuay1uIHBvbHltb3JwaGlzbQACAQkQAQAAAH8CAAB7AgAADAQA AExaRnWdSqbVAwAKAHJjcGcxMjXiMgNDdGV4BUEBAwH3/wqAAqQD5AcTAoAP8wBQBFY/CFUHshEl DlEDAQIAY2jhCsBzZXQyBgAGwxEl9jMERhO3MBIsETMI7wn3tjsYHw4wNREiDGBjAFDzCwkBZDM2 FlALpgXQCsDKawYAaAiQbGQEIABwmGQgSR2wGCAgdwUQqnQLgGcdsCAKsHAEkOAuICBUaB5ADrAT 0J0DAGMHQAqiCoBiYQCQxwQgIOIDoCJQdQJAHqLMdHkfIB2xbm8BkB6QMwIgBCB0bx5QBbBrIgQg TwSBc2t5L0woYXVmBJAsIFRQT8BQTCc5Ni4gVCBUjlMHcAIgJXp8IC0nYnpPBRBnC4AHQAXQB5Bz WGFnZSdjJuZGA2E62xDBDrBtBgAQwGwHcArAuwuAHkBbAMADECMQOgdAASqEQGNzLmt1bvAubmxd CuMnIgZgAjBZKcAwNxziE9AgAdAwQRRAMTY6Mjcm5lSdK2AgE+Aj4B1wbEAvlYouBbBnLMd1YmoF kKUtcXIAcGstA6BwBvDLBsAFsHAdUHNtJuYzDmxEZQrBB0BsJIUzaEcASEMgNS4wLjPwIHN1cDJA ACAEIDHPvzLRJWUnQAhRHYAdsXkCIP8eQAtQNJAUEDIxC4AFQAeAfyMCHuUfsBPgBUABAATyYr8H kSIDJuYLgCRRCfBjIjGsbGcFsB6AaCogdRQQPmQ4hy7XE+A3cCEjYWR+dgBwPcAm5inkKmczDl/v Q29Ef0VKJuZIL6Q6oCsh8x6iKnBzdEZdMAovgAJAoHA6Ly93SkAuMBk2LysSA4EvR9I9UW8vCy+V Mwx9TbAAHgA1EAEAAABPAAAAPDExMTNEREIyNEQ0QTI4NDE5NTFCRkRGODY2NjVFRTE5Mzc0QTRD QFJFRC1NU0ctMTAucmVkbW9uZC5jb3JwLm1pY3Jvc29mdC5jb20+AAAeAEIQAQAAAB4AAAA8M0M4 Nzk0RDMuNUQ3MTNEMjNAY3Mua3VuLm5sPgAAAAMAgBD/////AwCSEAEAAAAfAPMQAQAAADwAAABS AEUAJQAzAEEAIAByAGEAbgBrAC0AbgAgAHAAbwBsAHkAbQBvAHIAcABoAGkAcwBtAC4ARQBNAEwA AAALAPYQAAAAAEAABzDYB2J2nsbBAUAACDBiaIN2nsbBAQMA3j+fTgAAAwDxPwkEAAAeAPg/AQAA ABMAAABTaW1vbiBQZXl0b24tSm9uZXMAAAIB+T8BAAAAUQAAAAAAAADcp0DIwEIQGrS5CAArL+GC AQAAAAAAAAAvTz1NSUNST1NPRlQvT1U9Tk9SVEhBTUVSSUNBL0NOPVJFQ0lQSUVOVFMvQ049NDI4 NTkyAAAAAB4A+j8BAAAAFQAAAFN5c3RlbSBBZG1pbmlzdHJhdG9yAAAAAAIB+z8BAAAAHgAAAAAA AADcp0DIwEIQGrS5CAArL+GCAQAAAAAAAAAuAAAAAwD9P+QEAAADABlAAAAAAAMAGkAAAAAAHgAw QAEAAAAHAAAANDI4NTkyAAAeADFAAQAAAAcAAAA0Mjg1OTIAAB4AOEABAAAABwAAADQyODU5MgAA HgA5QAEAAAACAAAALgAAAAMACVkBAAAACwBYgQggBgAAAAAAwAAAAAAAAEYAAAAADoUAAAAAAAAD AHCBCCAGAAAAAADAAAAAAAAARgAAAABShQAAEpIBAB4AcYEIIAYAAAAAAMAAAAAAAABGAAAAAFSF AAABAAAABQAAADEwLjAAAAAAAwC4gQggBgAAAAAAwAAAAAAAAEYAAAAAAYUAAAAAAAALAL2BCCAG AAAAAADAAAAAAAAARgAAAAADhQAAAAAAAAMAx4EIIAYAAAAAAMAAAAAAAABGAAAAABCFAAAAAAAA AwDOgQggBgAAAAAAwAAAAAAAAEYAAAAAGIUAAAAAAAALAOOBCCAGAAAAAADAAAAAAAAARgAAAAAG hQAAAAAAAAsA5IEIIAYAAAAAAMAAAAAAAABGAAAAAIKFAAAAAAAACwApAAAAAAALACMAAAAAAAMA BhAAH1CPAwAHENEBAAADABAQAAAAAAMAERABAAAAHgAIEAEAAABlAAAATUFSS1NISUVMRFNBTkRJ QVJFV1JJVElOR0FQQVBFUlRIRVRFQ0hOSUNBTEJBU0lTSVNJTiJQVVRUSU5HVFlQRUFOTk9UQVRJ T05TVE9XT1JLIk9ERVJTS1kvTEFVRkVSLFBPUAAAAAACAX8AAQAAAE8AAAA8MTExM0REQjI0RDRB Mjg0MTk1MUJGREY4NjY2NUVFMTkzNzRBNENAUkVELU1TRy0xMC5yZWRtb25kLmNvcnAubWljcm9z b2Z0LmNvbT4AAPPI ------_=_NextPart_001_01C1C69E.767EA3BC-- From jadrian@mat.uc.pt Fri Mar 8 14:38:29 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Fri, 8 Mar 2002 14:38:29 +0000 Subject: pattern-matching with labelled types In-Reply-To: <15496.6516.434722.555847@waytogo.peace.co.nz> References: <004f01c1c643$77f15e20$d632e3c8@windows9> <15496.6516.434722.555847@waytogo.peace.co.nz> Message-ID: <20020308143940.5C707422233@www.haskell.org> On Friday 08 March 2002 01:52, you wrote: > Andre W B Furtado writes: > | Of course, it is possible to do something like > | > | > update :: MyType -> Int -> MyType > | > update mt newValue = MT {x = newValue, y = oldValue} > | > where oldValue = y mt > | > | but this really annoys me when MyType has too many fields. Suggestions? > > update mt newValue = mt {x = newValue} Since we are on the subject, I have some questions about labeled datatypes updates. You can in deed update like that "mt {x = newValue}", but whenever I use labeled datatypes I always end up with Andres problem, having to define not only an 'update' function but also an 'apply' function for every field. I need them becouse I want to pass them as arguments to other funtions. This happens to me all the time, but one very good example IMO is having a STRef to a labeled data type. Now you want to update some field and you want to to be able to use, modifySTRef (updField1 3) or modifySTRef (appField1 (+1)) It would be extremely usefull IMO to have not only field projection funtions, but also apply and update funtions. That, and not beeing possible to specify contexts partialy, makes it particulary complicated for me to follow John Hughes strategy to simulate global variables in haskell (http://www.cs.chalmers.se/~rjmh/Globals.ps) J.A. From marco.comini@inwind.it Fri Mar 8 15:18:53 2002 From: marco.comini@inwind.it (Marco Comini) Date: Fri, 8 Mar 2002 16:18:53 +0100 Subject: [E-CFP] WFLP2002 - deadline is approaching Message-ID: --============_-1196521757==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Dear Colleague I would like to remind you that the WFLP 2002 paper submission deadline is approaching. WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming. WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration. For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/ Papers are due by March 20, 2002 You can sumbit papers following the electronic sumbission process at: http://www.dimi.uniud.it/~wflp2002/submit/ We hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. -- Marco. --============_-1196521757==_ma============ Content-Type: text/html; charset="us-ascii" [E-CFP] WFLP2002 - deadline is approaching
Dear Colleague
I would like to remind you that the WFLP 2002 paper submission deadline is
approaching.  WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming.  WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration.  For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/

Papers are due by March 20, 2002

You can sumbit papers following the electronic sumbission process at:
http://www.dimi.uniud.it/~wflp2002/submit/

We hope  that this  "Call For  Papers" will be  useful for  your work.
Please  forward  the  following  to  anybody  who  you  think  may  be
interested.  Our apologies if you received multiple copy of this.
-- 
Marco.
--============_-1196521757==_ma============-- From Ralf.Laemmel@cwi.nl Fri Mar 8 19:23:07 2002 From: Ralf.Laemmel@cwi.nl (Ralf.Laemmel@cwi.nl) Date: Fri, 8 Mar 2002 20:23:07 +0100 (MET) Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: Simon Peyton-Jones wrote: > In fact GHC does "forall-lifting" on type signatures to bring the > foralls to the front. But there's a bug in 5.02's forall-lifting... > ... > Perhaps you can try the 5.03 snapshot release? Certain things work there. In fact, it is fascinating. But now I did a new experiment ... It seems that forall-lifting does not work as expected for type synonyms in 5.03. Here is an example from my upcoming ICFP submission :-) Here is an innocent type synonym for generic functions with three parameters of kind * -> *: type Generic i o m = forall x. i x -> m (o x) This is a good candidate for all the parameters: type Id x = x Now I tried to define sequential composition. In fact, the following type deals with a very restricted case for simplicity: sequ :: forall t. (Generic t t Id) -> (Generic t t Id) -> (Generic t t Id) sequ f g = undefined Looking at the type of sequ, the foralls for t end up at the top. Hence, I have no chance to define sequential composition. Main> :t sequ forall t x1 x11 x. (t x1 -> Id (t x1)) -> (t x11 -> Id (t x11)) -> t x -> Id (t x) Main> Please let me know if this is a bug. Please don't fix it too soon :-) because otherwise I had to rewrite some material which is now based on first-class polymorphism and datatypes for i, o, and m. Such code will probably look better in proper rank-2 style with type synonyms for type constructor parameters. I just realized that type synonyms in GHC seem to be valid arguments even when not completely instantiated? This is wonderful. It is not supported in hugs. How difficult is it to cope with this? Does it make a real difference for the type system? Ralf From hdaume@ISI.EDU Fri Mar 8 20:26:20 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Fri, 8 Mar 2002 12:26:20 -0800 (PST) Subject: HGL ang GHC on Win32 Message-ID: When I compile a program using GHC 5.02.2 on Windows 200 using HGL, using the following command line: > ghc --make HelloWorld.hs -o HelloWorld.exe -package concurrent -package win32 -ic:\GraphicsLibrary\lib\win32 it compiles fine, but then when I run the exe, the window starts out initially as wide as my screen and only as tall as the title bar, regardless of what is passed as the dimensions to openWindow. What gives? If I resize the window everything works fine, but in my own application resizing the window causes it to report some error about arithmetic being bigger than 32 bits... Any ideas? - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume From mlsl99@yahoo.com Sat Mar 9 05:11:19 2002 From: mlsl99@yahoo.com (mary lee) Date: Fri, 8 Mar 2002 21:11:19 -0800 (PST) Subject: College Student Message-ID: <20020309051119.86835.qmail@web14708.mail.yahoo.com> To : Mr. Frank A. Chrishtoph I am recently doing my assignment on Haskell at my college. I am just new on Haskell programming. I would like to request if you can teach me for just few programming rules on Haskell. It is my most appreciation to learn from you. My assignment title is INTERNATIONAL AIRLINES SYSTEM. May i know how to open file, put record entry and just read it from its database. How to do a simple input and output for acquire user options using functional programming. It is very important for me to learn Haskell in a proper way. It will lead me to write a good documentation. A good understanding on programming is good. I am good in Visual Basic, Pascal, Cobol, C++ and also JAVA. But facing functional programming is a real problem for me. Now i have doing a simple Haskell programming on the way. I just know how to import file, declare types and display output. Your help and guidelines is most appreciated. From, Lee Ling Ling __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ From antony.blakey@ihug.com.au Sat Mar 9 13:14:22 2002 From: antony.blakey@ihug.com.au (Antony Blakey) Date: Sat, 09 Mar 2002 23:44:22 +1030 Subject: Concurrent Haskell (GHC) and Win32 Applications ? Message-ID: <3C8A0AAE.90606@ihug.com.au> Hi, I'm experimenting with GHC as a platform for writing a Win32 GUI application, and I've hit what I think is a brick wall. The problem I think is with the lightweight thread implementation - Win32 calls can (and will) block the OS thread that makes the call, which blocks the entire system. Given that I'm wanting to write a network server with a Win32 GUI, this is obviously a Bad Thing. So, does any know if I missing some vital piece of information? I am using the following reduced test case, which I don't think is clueless. import Win32 import Concurrent endless:: Char -> IO () endless c = do { putChar c; endless c } main = do { task1; task2; endless 'b' } where task1 = forkIO ( do { messageBox nullHANDLE "Hey" "Yeah" mB_OK; return () } ) task2 = forkIO ( endless 'a' ) It does intersperse the 'a' and 'b' output nicely, but stops while the message box is on the screen. I'm not keen on writing a seperate GUI management thread in C++ and linking - the point is to do all of this in Haskell and write an application indistinguishable from a C++ GUI app e.g. imagine Simon Peyton Jones' sample webserver with a realtime GUI monitor. Thanks in advance for any pointers! From d99josve@dtek.chalmers.se Sat Mar 9 14:50:38 2002 From: d99josve@dtek.chalmers.se (Jonas Svensson) Date: Sat, 9 Mar 2002 15:50:38 +0100 Subject: Concurrent Haskell (GHC) and Win32 Applications ? In-Reply-To: <3C8A0AAE.90606@ihug.com.au> References: <3C8A0AAE.90606@ihug.com.au> Message-ID: <20020309145037.GA22195@korillov.dtek.chalmers.se> Sat, Mar 09, 2002 at 11:44:22PM +1030, Antony Blakey -> > Hi, > I'm experimenting with GHC as a platform for writing a Win32 GUI > application, and I've hit what I think is a brick wall. > > The problem I think is with the lightweight thread implementation - > Win32 calls can (and will) block the OS thread that makes the call, > which blocks the entire system. Given that I'm wanting to write a > network server with a Win32 GUI, this is obviously a Bad Thing. While I haven't used GHC with the Win32 GUI I've had a similar problem with the gtk+hs bindings. See the ``concurrent haskell'' thread in: http://haskell.org/pipermail/gtkhs/2002-February/thread.html Basically, make sure that a Haskell function is called once in a while (for example add it as a timer callback) and make this function call yeild. I'm not sure the Win32 API works the same way but it might be worth a try. /jonas -- %http://www.dtek.chalmers.se/~d99josve/ - d99josve@dtek.chalmers.se From jerry@gime.com Sat Mar 9 15:01:21 2002 From: jerry@gime.com (Jerry, JiJie) Date: Sat, 9 Mar 2002 23:01:21 +0800 Subject: Debugging Haskell Message-ID: <20020309230121.A6070@ghost.gime.com> --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Good day everyone, I was fiddling around with this tiny echo client/server haskell program from 'The Great Language Shootout' site (http://www.bagley.org/~doug/shootout/) and got stuck. The code (attached) has been reformatted with minimal API tweak (mkPortNumber, writeSocket, readSocket) to please my ghc-5.02.2, and all what I get is something stuck forever after the first iteration: $ ./echo 3 Client wrote: Hello there sailor Server recv: Hello there sailor Server read: Hello there sailor Server wrote: Hello there sailor After adding all these print statement, I still don't have a clue what's jammed there. Hope someone here can shred some light. BTW, I'd also like to take this chance to ask how to debug a haskell program in general? Regards, Jerry --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="echo.hs" -- $Id: echo.ghc,v 1.2 2001/05/01 20:19:52 doug Exp $ -- http://www.bagley.org/~doug/shootout/ -- Haskell echo/client server -- written by Brian Gregor -- compile with: -- ghc -O -o echo -package net -package concurrent -package lang echo.hs module Main where import SocketPrim import Concurrent import System (getArgs,exitFailure) import Exception(finally) import MVar server_sock :: IO (Socket) server_sock = do s <- socket AF_INET Stream 6 setSocketOption s ReuseAddr 1 -- bindSocket s (SockAddrInet (mkPortNumber portnum) iNADDR_ANY) bindSocket s (SockAddrInet (PortNum portnum) iNADDR_ANY) listen s 2 return s echo_server s = do (s', clientAddr) <- accept s proc <- read_data s' 0 putStrLn ("server processed "++(show proc)++" bytes") sClose s' where read_data sock totalbytes = do -- (str,i) <- readSocket sock 19 str <- recv sock 19 -- if (i >= 19) putStr ("Server recv: " ++ str) if ((length str) >= 19) then do putStr ("Server read: " ++ str) -- writ <- writeSocket sock str writ <- send sock str putStr ("Server wrote: " ++ str) -- read_data sock $! (totalbytes+(length $! str)) -- read_data sock (totalbytes+(length str)) else do putStr ("server read: " ++ str) return totalbytes local = "127.0.0.1" message = "Hello there sailor\n" portnum = 7001 client_sock = do s <- socket AF_INET Stream 6 ia <- inet_addr local -- connect s (SockAddrInet (mkPortNumber portnum) ia) connect s (SockAddrInet (PortNum portnum) ia) return s echo_client n = do s <- client_sock drop <- server_echo s n sClose s where server_echo sock n = if n > 0 then do -- writeSocket sock message send sock message putStr ("Client wrote: " ++ message) -- -- (str,i) <- readSocket sock 19 str <- recv sock 19 if (str /= message) then do putStr ("Client read error: " ++ str ++ "\n") exitFailure else do putStr ("Client read success") server_echo sock (n-1) else do putStr "Client read nil\n" return [] main = do ~[n] <- getArgs -- server & client semaphores -- get the server socket ssock <- server_sock -- fork off the server s <- myForkIO (echo_server ssock) -- fork off the client c <- myForkIO (echo_client (read n::Int)) -- let 'em run until they've signaled they're done join s putStr("join s") join c putStr("join c") -- these are used to make the main thread wait until -- the child threads have exited myForkIO :: IO () -> IO (MVar ()) myForkIO io = do mvar <- newEmptyMVar forkIO (io `finally` putMVar mvar ()) return mvar join :: MVar () -> IO () join mvar = readMVar mvar --wRRV7LY7NUeQGEoC-- From gramlich@logic.at Sat Mar 9 18:43:08 2002 From: gramlich@logic.at (Bernhard Gramlich) Date: Sat, 9 Mar 2002 19:43:08 +0100 Subject: 2nd CfP: WRS'02 - 2nd WS on Reduction Strategies in Rewriting and Programming Message-ID: <200203091843.g29Ih8l19182@church.logic.tuwien.ac.at> [Apologies for multiple copies of this announcement] ************************************************************************** **************** 2nd call for papers and participation ***************** ************************************************************************** Second International Workshop on Reduction Strategies in Rewriting and Programming (WRS 2002) http://www.dsic.upv.es/users/elp/WRS2002 affiliated with RTA 2002, held as part of FLoC 2002 Copenhagen, Denmark, July 21, 2002 -------------------------------------------------------------------------- BACKGROUND AND AIMS Reduction strategies in rewriting and programming have attracted an increasing attention within the last years. New types of reduction strategies have been invented and investigated, and new results on rewriting / computation under particular strategies have been obtained. Research in this field ranges from primarily theoretical questions about reduction strategies to very practical application and implementation issues. The need for a deeper understanding of reduction strategies in rewriting and programming, both in theory and practice, is obvious, since they bridge the gap between unrestricted general rewriting (computation) and (more deterministic) rewriting with particular strategies (programming). Moreover, reduction strategies provide a natural way to go from operational principles (e.g., graph and term rewriting, narrowing, lambda-calculus) and semantics (e.g., normalization, computation of values, infinitary normalization, head-normalization) to implementations of programming languages. Therefore any progress in this area is likely to be of interest not only to the rewriting community, but also to neighbouring fields like functional programming, functional-logic programming, and termination proofs of algorithms. The workshop wants to provide a forum for the presentation and discussion of new ideas and results, recent developments, new research directions, as well as of surveys on existing knowledge in this area. Furthermore we aim at fostering interaction and exchange between researchers and students actively working on such topics. The workshop will be held in conjunction with RTA 2002 in Copenhagen (Denmark) on July 21, 2002. The workshop is (co-)organized by TU Valencia and TU Wien. TOPICS OF INTEREST Topics of interest include, but are not restricted to: - theoretical foundations for the definition and semantic description of reduction strategies - strategies in different frameworks (term rewriting, graph rewriting, infinitary rewriting, lambda calculi, higher order rewriting and explicit substitutions, conditional rewriting, rewriting with built-ins, narrowing, constraint solving, etc.) and their application in (equational, functional, functional-logic) programming (languages) - properties of reduction strategies / computations under strategies (e.g., completeness, computability, decidability, complexity, optimality, (hyper-)normalization, cofinality, fairness, perpetuality, context-freeness, neededness, laziness, eagerness, strictness) - interrelations, combinations and applications of reduction under different strategies (e.g., equivalence conditions for fundamental properties like termination and confluence, applications in modularity analysis, connections between strategies of different frameworks, etc.) - program analysis and other semantics-based optimization techniques dealing with reduction strategies - rewrite systems / tools / implementations with flexible / programmable strategies as essential concept / ingredient - specification of reduction strategies in (real) languages - data structures and implementation techniques for reduction strategies. SUBMISSIONS We solicit papers on all aspects of reduction strategies in rewriting and programming. Submissions should describe unpublished work, except for survey papers which are explicitly welcome, too. Submissions should not exceed 10 pages (however, survey papers may be longer) and be sent in postscript format to the PC co-chairs at wrs02@dsic.upv.es before April 15, 2002. Submissions should include the title, authors' names, affiliations, addresses, and e-mail. Selection of papers by the PC will be based on originality, significance, and correctness. Final versions will be due by June 17, 2002. PUBLICATION The final workshop proceedings will be published in the Electronic Notes in Theoretical Computer Science (ENTCS) series of Elsevier. Preliminary hardcopy proceedings will be available at the workshop. A special issue of the Journal of Symbolic Computation (JSC) on Reduction Strategies in Rewriting and Programming will be designated for revised and extended versions of selected contributions from both WRS 2001 (Utrecht, May 2001) and WRS 2002. PROGRAM COMMITTEE Sergio Antoy Portland (USA) Roberto Di Cosmo Paris VII (France) Bernhard Gramlich (co-chair) Wien (Austria) Michael Hanus Kiel (Germany) Claude Kirchner Nancy (France) Paul Klint CWI Amsterdam (The Netherlands) Salvador Lucas (co-chair) Valencia (Spain) Manfred Schmidt-Schauss Frankfurt am Main (Germany) Yoshihito Toyama Tohoku (Japan) ORGANIZERS Bernhard Gramlich (co-chair) Technische Universitaet Wien Salvador Lucas (co-chair) Universidad Politecnica de Valencia INVITED TALKS (with tentative titles) Aart Middeldorp, Tsukuba (Japan): Strategies for Term Rewriting Vincent van Oostrom, Utrecht (The Netherlands): Optimal Strategies in Higher-Order Rewriting IMPORTANT DATES Deadline for submissions: April 15, 2002 Notification: May 27, 2002 Final versions due: June 17, 2002 Workshop: July 21, 2002 FURTHER INFORMATION WRS 2002 website: http://www.dsic.upv.es/users/elp/WRS2002 WRS 2002 e-mail address: wrs02@dsic.upv.es RTA 2002 website: http://www.ericsson.com/cslab/rta2002/ FLoC 2002 website: http://floc02.diku.dk WRS 2002 website at FLoC: http://floc02.diku.dk/WRS ************************************************************************** From ru@river.org Sat Mar 9 20:57:07 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sat, 09 Mar 2002 12:57:07 -0800 Subject: type aliases in instances In-Reply-To: <3C875792.DEB308C3@cogs.susx.ac.uk> References: <3C875792.DEB308C3@cogs.susx.ac.uk> Message-ID: I do not have experience commposing monads (maybe John Hughes can chime in?), but I'll address where Bernhard Reus writes: >This can be avoided by using type >aliases but then the monads in use cannot be instances of the Monad >class. >But not declaring the monads to be in class Monad can hardly >be good style, can it? GHC's source code defines many monads not in class Monad. I'll write some untested code to give an idea of the naming conventions used: type FooMd out = (a,b,c)->((a,b,c),out) returnFooMd out = \s0->out thenFooMd p k = \s0->let (s,out) = p s0 in k out s method1FooMd ... = ... method2FooMd ... = ... the biggest disadvantage is that you cannot use the do notation but rather have to write, eg, method1FooMd x y `thenFooMd` (\result1-> method2FooMd z result1 `thenFooMd` (\result2-> ... of course, you also cannot use liftM and other library functions with (Monad m)=> in their signature, but I do not mind that so much as loss of the do notation. -- Richard Uhtenwoldt From tccuong72@yahoo.com Sat Mar 9 15:49:53 2002 From: tccuong72@yahoo.com (To Chieu Cuong) Date: Sat, 9 Mar 2002 22:49:53 +0700 Subject: scholarship information Message-ID: <002e01c1c7c2$94728300$e18da2cb@vnn1269> Dear Sir or Madam, I'm working at Department of Engineering Mechanics, Ho Chi Minh city University of Technology, Viet Nam as a teaching assistant. I have a M.E. of Civil Engineering and a B.S. of Computer Science. I'm looking for a scholarship. Would you please send me scholarship information of your university? I look forward to hearing from you. With best regards, Cuong. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From doaks@thecottagemonitor.com Sun Mar 10 05:30:36 2002 From: doaks@thecottagemonitor.com (Doak Serrels) Date: Sun, 10 Mar 2002 00:30:36 -0500 Subject: Protect your vacation home against winter freeze for less than 30 cents a day! Message-ID: The

 

 The

 Cottage

 Monitor

 

 

 

 

CONTROL AND MONITOR THE

TEMPERATURE IN YOUR

VACATION HOME, 24 HOURS

A DAY VIA A TOLL FREE

TELEPHONE LINE!

 

 


Visit our web page in your location for further

information

 

CALIFORNIA  COLORADO  MICHIGAN 

MINNESOTA  NEW YORK 

  UTAH 

 

800.549.9276

info@thecottagemonitor.com

 

 

From igloo@earth.li Sun Mar 10 15:22:40 2002 From: igloo@earth.li (Ian Lynagh) Date: Sun, 10 Mar 2002 15:22:40 +0000 Subject: Layout indentation marking Message-ID: <20020310152240.GA11906@stu163.keble.ox.ac.uk> Given this module module Main where main :: IO() main = putStrLn $ show $ foo foo :: Int foo = x + y where x = 6 s = "foo\ \bar" y = 7 nhc98 and hugs correctly (as per the revised report) print 13. ghc gives q.lhs:11: parse error on input `=' I think ghc is in the right here and the report should be updated to read + Where the start of a lexeme does not follow the end of a lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) (it currently reads + Where the start of a lexeme does not follow a complete lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) where I have altered only the first line). Thanks Ian From post@volker-wysk.de Sun Mar 10 15:48:52 2002 From: post@volker-wysk.de (Volker Wysk) Date: Sun, 10 Mar 2002 16:48:52 +0100 (CET) Subject: Bug in IO libraries when sending data through a pipe? Message-ID: Hello There seems to be a bug in the IO libraries. I'm using the following procedure to call an external program and send it data through a pipe. pipeto :: String -> String -> [String] -> IO () pipeto txt prog par = do catch (do -- create pipe (zu, von) <- createPipe vonh <- fdToHandle von hSetBuffering vonh NoBuffering mpid <- forkProcess case mpid of Nothing -> do -- child -- connect pipe's read end to stdin -- and close its write end dupTo zu (intToFd 0) fdClose zu hClose vonh executeFile prog True par Nothing ... -- (print error message) Just pid -> do -- parent fdClose zu -- close pipe's read end -- ** here ** hPutStr vonh txt -- write text to forked process hClose vonh -- close pipe's write end -- wait for child process to finish (Just ps) <- getProcessStatus True True pid if ps == Exited ExitSuccess then return () else ...) -- (error message) (\err -> ...) -- print error message The problem is that the child process doesn't receive all the data which the parent sends. It's as if "hPutStr vonh txt" sends the data lazily somehow, and "hClose vonh" closes the pipe prematurely. It varies from run to run exactly which data gets through. If I cause the child process to read all its input immediately, the problem doesn't seem to occur. Normally, it does so gradually, which takes a few seconds. I'm using GHC 5.02.2 Volker From petersen@redhat.com Mon Mar 11 01:59:30 2002 From: petersen@redhat.com (Jens Petersen) Date: 11 Mar 2002 10:59:30 +0900 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: References: Message-ID: Volker Wysk writes: > (zu, von) <- createPipe > vonh <- fdToHandle von > hSetBuffering vonh NoBuffering > mpid <- forkProcess > case mpid of > Nothing -> do -- child > -- connect pipe's read end to stdin > -- and close its write end > dupTo zu (intToFd 0) > fdClose zu > hClose vonh > executeFile prog True par Nothing > ... -- (print error message) > Just pid -> do -- parent > fdClose zu -- close pipe's read end > -- ** here ** > hPutStr vonh txt -- write text to forked process > hClose vonh -- close pipe's write end > -- wait for child process to finish > (Just ps) <- getProcessStatus True True pid > if ps == Exited ExitSuccess > then return () > else ...) -- (error message) > > The problem is that the child process doesn't receive all the data which > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > somehow, and "hClose vonh" closes the pipe prematurely. > > It varies from run to run exactly which data gets through. If I cause the > child process to read all its input immediately, the problem doesn't > seem to occur. Normally, it does so gradually, which takes a few seconds. > > I'm using GHC 5.02.2 Quite possibly could be a bug. Lazy IO is rather subtle I think, specially when done across pipes. I faced some similar problem with in POpen recently. You can see how I solved it (worked round it?) by comparing the latest release 1.00 with the previous one 0.00.1: http://www.01.246.ne.jp/~juhp/haskell/popenhs/ In comparison Posix.runProcess allows attaching file handles to the in, out and error pipes, which can be written to and read from eagerly I suppose. Jens From jyrinx_list@mindspring.com Mon Mar 11 02:36:01 2002 From: jyrinx_list@mindspring.com (Jyrinx) Date: 10 Mar 2002 18:36:01 -0800 Subject: Isn't this tail recursive? Message-ID: <1015814162.18982.12.camel@kryptonitespoon.maurers> For practice, I'm playing with reimplementing the solution to the word count problem on the Great Computer Language Shootout (www.bagley.org/~doug/shootout). My current solution looks tail recursive to me: --- snip --- -- wc-luke.hs -- Reimplimentation of the Haskell word count program for the Great -- Computer Language Shootout -- Luke Maurer -- jyrinx@mindspring.com module Main where import IO data CharKind = Normal | White | Newline charKind :: Char -> CharKind charKind c = case c of '\n' -> Newline ' ' -> White '\t' -> White _ -> Normal countAll :: String -> (Int, Int, Int) countAll str = countAll' str 0 0 0 0 where countAll' [] _ nl nw nc = (nl, nw, nc) countAll' (c:cs) newWord nl nw nc = case charKind c of -- The following should all be tail calls ... right? Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) White -> countAll' cs 1 nl nw (nc + 1) Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) main = do -- We need a 4K buffer, as per the rules hSetBuffering stdin (BlockBuffering (Just 4096)) file <- getContents let (l, w, c) = countAll file putStrLn ((show l) ++ " " ++ (show w) ++ " " ++ (show c)) --- snip --- In the case expression at the end of countAll, each of the values looks to me like a recursive tail call - I should think (hope?) that it would be optimized by GHC into a goto statement (a la Scheme). Instead, my program eats up memory (I've got 256 MB) until the RTS whines about a stack overflow. Am I wrong about the tail call? Is there some optimization I should be aware of (I'm compiling with -O2)? Is this a flaw in GHC? (BTW, as a beginner, I'd be glad to hear general commentary on my code ...) Thanks! Jyrinx jyrinx_list at mindspring dot com From hdaume@ISI.EDU Mon Mar 11 02:38:54 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Sun, 10 Mar 2002 18:38:54 -0800 (PST) Subject: Isn't this tail recursive? In-Reply-To: <1015814162.18982.12.camel@kryptonitespoon.maurers> Message-ID: I don't think it's an issue of it being a tail call; i think it's just too lazy. > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > White -> countAll' cs 1 nl nw (nc + 1) > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) make this something like ... Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' White -> nc' `seq` countAll' cs 1 nl nw nc' Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' where nw' = nw + newWord nc' = nc + 1 nl' = nl + 1 ... or something. I'm not entirely sure but it's worth a shot. - Hal From sqrtofone@yahoo.com Mon Mar 11 05:28:10 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Sun, 10 Mar 2002 23:28:10 -0600 (CST) Subject: Isn't this tail recursive? In-Reply-To: <1015814162.18982.12.camel@kryptonitespoon.maurers> Message-ID: On 10 Mar 2002, Jyrinx wrote: > In the case expression at the end of countAll, each of the values looks > to me like a recursive tail call - I should think (hope?) that it would > be optimized by GHC into a goto statement (a la Scheme). Instead, my > program eats up memory (I've got 256 MB) until the RTS whines about a > stack overflow. It is tail recusive. unfortunately, that's not the problem. apparently ghc is not smart enough to realize that countAll' should really be strict in basically all arguments. (hell, I'm not quite sure I can claim to be smart enough to say that!) One way you could fix it up would be to do as Hal did and sprinkle seq and/or $! throughout your code. That would have been my solution as well, but I then realized this happens just too often to have been ignored by the haskell literati. I decided to muck around in the haskell manual and I think I may have found another way. Never fear, -fall-strict is here! Anyway compiling with that ghc option seams to make the problem go away. I just ran your code compiled with it over a 47M file and the heap size hits a max of 16 and stays constant throughout execution. I wish I knew more about what -fall-strict really means. The ghc 5.00 manual hardly explains it. It doesn't have the semantics I would have thought it should have. for instance: main = print foo where foo = let a = error "do I happen?" b = 3 in "foo" ++ show b I would have thought that the execution of that code compiled with the all-strict flag would have raised the error. a strict language would do that, right? Perhaps it is something to do purely with function application. I dont know. Anyway, I guess a fix would be to put in a pragma into your code to quote Malcolm Wallace >ghc and nhc98 already support this. ghc's mechanism is > {-# OPTIONS -fglasgow-exts ... etc #-} >at the top of the file - but there are quite a few restrictions on >what flags are accepted in that pragma. nhc98's mechanism is > {-# OPTIONS_COMPILE -nkpat ... etc #-} >anywhere in the file, which has no restrictions on the options it >accepts - you can use anything that can appear on the commandline. o just maybe you could exchange -fall-strict for -fglasgow-exts and pray to the haskell gods that it happens to be an acceptable option? Jay Cox From simonpj@microsoft.com Mon Mar 11 10:46:55 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 02:46:55 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE19374A69@RED-MSG-10.redmond.corp.microsoft.com> | Looking at the type of sequ, | the foralls for t end up at the top. | Hence, I have no chance to define sequential | composition. Indeed the foralls are at the top, but I claim that wherever you could use the composition function you were expecting, you can also use the one GHC gives you. The two types are isomorphic. Let me know if you find a situation where this isn't true. | Please let me know if this is a bug. No I believe it is not a bug. I would be interested to see why you needed to change your code. | I just realized that type synonyms in GHC seem to be valid=20 | arguments even when not completely instantiated? This is=20 | wonderful. It is not supported in hugs. How difficult is it=20 | to cope with this? Does it make a real difference for the type system? No, GHC does not support partially applied type synonyms,=20 except in the RHS of other type synonyms. It is a VERY BIG thing to allow this, because it amounts to allowing lambdas at the type level and that messes up inference cruelly. Why do you think GHC does? Simon From PPDP-2002@loria.fr Mon Mar 11 11:12:38 2002 From: PPDP-2002@loria.fr (Claude Kirchner) Date: Mon, 11 Mar 2002 12:12:38 +0100 (MET) Subject: PPDP 2002 - Last call for papers --> March 21 Message-ID: <15500.37158.135931.845369@apach.loria.fr> PPDP 2002 - Call for papers March 21, 2002 submission deadline http://ppdp2002.cs.brown.edu Fourth International Conference on Principles and Practice of Declarative Programming 6-8 October, Pittsburgh, USA as part of PLI 2002 (http://pli2002.cs.brown.edu) *** The electronic submission system is open at *** http://ppdp-2002.loria.fr/ Invited speakers: Neil Jones (University of Copenhagen) Catuscia Palamidessi (The Pennsylvania State University) Janos Sztipanovits (Vanderbilt University ) Important dates March 21, 2002 submission FIRM deadline May 30, 2002 acceptance decisions June 30, 2002 Camera-ready copies October 6-8, 2002 Conference Submission web site: http://ppdp-2002.loria.fr Conference Chair: Frank Pfenning, CMU, USA Program Chair: Claude Kirchner, LORIA and INRIA 615, rue du Jardin Botanique, BP 101 54602 Villers-lès-Nancy, France Claude.Kirchner@loria.fr Program Committee: Hassan Ait Kaci: ILOG, France Olivier Danvy: BRICS, University of Aarhus, Denmark Mariangiola Dezani: Universita di Torino, Italy Francois Fages: INRIA, France Fergus Henderson: The University of Melbourne, Australia Manuel Hermenegildo: University of Madrid, Spain Andrew Gordon: Microsoft Research, UK Amy Felty: University of Ottawa, Canada Claude Kirchner: LORIA & INRIA, France Paul Klint: CWI, The Netherlands Michael Maher: Griffith University, Australia and Loyola University Chicago, USA Dale Miller: The Pennsylvania State University, USA Roberto Nieuwenhuis: University of Barcelona, Spain Frank Pfenning: CMU, USA Francesca Rossi: University of Padova, Italy Scope of the Conference PPDP aims to stimulate research on the use of declarative methods in programming and on the design, implementation and application of programming languages that support such methods. Topics of interest include any aspect related to understanding, integrating and extending programming paradigms such as those for logic, functional, constraint, probabilistic, rule and object-oriented programming; concurrent extensions and mobile computing; type theory; support for modularity; use of logical methods in the design of program development tools; program analysis and verification; abstract interpretation; development of implementation methods; application of the relevant paradigms and associated methods in industry and education. This list is not exhaustive: submissions related to new and interesting ideas relating broadly to declarative programming are encouraged. The technical program of the conference will combine presentations of the accepted papers and system descriptions with invited talks and advanced tutorials. Previous PPDP meetings were held in Paris (1999), Montreal (2000), Firenze (2001). Topics of Interest Logic and Constraint Programming; Rule Programming; Object-Oriented Programming; Concurrent Programming; Mobile Computing; Specification Languages and Methods; Type and Module Systems; Program Logics and Verification; Program Analysis and Transformation; Abstract Machines and Compilation Methods; Parallel and Distributed Implementations; Programming Environments; Applications of Declarative Programming; Implementation Techniques; Logical and Semantical Aspects of Declarative Programming; Declarative and probabilistic programming. Paper Submissions Submissions must be received on or before March 21, 2002 (this is a HARD deadline) and must describe original, previously unpublished work that has not been simultaneously submitted for publication elsewhere. They must be written in English and, in case the work is accepted for presentation and publication, one of the author must attend the conference to present it. Submissions must contain a clearly delineated part intended for the proceedings not exceeding 12 pages and 9 pt (for a full description see the ACM conference format at http://www.acm.org/sigplan/conferences/author-info) and must have a cover page with an abstract of up to 200 words, keywords, postal and electronic mailing addresses, and phone and fax numbers of the corresponding author. Additional material for possible consideration by reviewers may be included in the form of appendices. Submitted papers can be either: Regular papers that will be judged in particular on originality, correctness and significance, or System descriptions that will be judged in particular on usefulness and design, originality of system design, implementation or application. They must contain a link to a working system. All submissions are to be electronic unless specifically approved by the Program Chair. Submissions in PostScript or PDF formats should be submitted via the conference management system as described on the web site. Authors will be notified of acceptance decisions by May 30, 2002 Camera-ready copies of the accepted papers must be received by June 30, 2002. Proceedings will be published by ACM Press. Authors of accepted papers will be required to sign the ACM copyright form, which will be made accessible from this site. Conference Venue and Related Events PPDP 2002 is part of a federation of colloquia known as Principles, Logics and Implementations of high-level programming languages (PLI 2002) which includes the ACM SIGPLAN International Conference on Functional Programming (ICFP 2002) and the first ACM SIGPLAN Conference on Generators and Components (GCSE/SAIG'02) . The colloquia and affiliated workshops will run from October 4 to October 8, 2002 and will be held in Pittsburgh, USA. Details about the affiliated conferences and workshops will appear at the URL http://pli2002.cs.brown.edu/. Sponsorship PPDP 2002 is sponsored by ACM SIGPLAN. ---------------------------------------------------------------- From simonpj@microsoft.com Mon Mar 11 11:49:23 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 03:49:23 -0800 Subject: Concurrent Haskell (GHC) and Win32 Applications ? Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041ABE@RED-MSG-10.redmond.corp.microsoft.com> | The problem I think is with the lightweight thread implementation -=20 | Win32 calls can (and will) block the OS thread that makes the call,=20 | which blocks the entire system. Given that I'm wanting to write a=20 | network server with a Win32 GUI, this is obviously a Bad Thing. Yes, that's true at the moment, but it's something that we expect to fix shortly. More precisely, Sigbjorn has been working on a=20 fix. It relies on using an OS thread to make a potentially-blocking call, so it's a robust fix. =20 I don't quite know when he'll be done with this -- Sigbjorn do you know? Meanwhile, all you can do is to avoid making blocking I/O calls. Simon From simonmar@microsoft.com Mon Mar 11 11:54:18 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 11 Mar 2002 11:54:18 -0000 Subject: Isn't this tail recursive? Message-ID: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> > On 10 Mar 2002, Jyrinx wrote: >=20 > > In the case expression at the end of countAll, each of the=20 > values looks > > to me like a recursive tail call - I should think (hope?)=20 > that it would > > be optimized by GHC into a goto statement (a la Scheme). Instead, my > > program eats up memory (I've got 256 MB) until the RTS=20 > whines about a > > stack overflow. >=20 > It is tail recusive. unfortunately, that's not the problem. > apparently ghc is not smart enough to realize that countAll' should > really be strict in basically all arguments. (hell, I'm not=20 > quite sure I > can claim to be smart enough to say that!) The function as written is only strict in its list argument, and its usage site only demands the 'l' argument strictly. So unless the compiler were to make use of the "can't fail" property of '+' on Int (which might not even hold if overflow checking is used), the compiler can't possibly evaluate the accumulating parameters of countAll' strictly. It would be possible to do strict evaluation in the case that the suspended computation is known to take a small bounded amount of time and space and can't fail - GHC doesn't do this, but we've wondered about it from time to time. I do wonder how often similar patterns crop up in practice - I've certainly encountered this pattern in my own code several times, and solved it using seq or strict constructor fields. > Never fear, > -fall-strict is here! I had no idea this flag still worked. As I recall, it was an experiment that turned out to be a bad idea - you're probably just better off using seq. Cheers, Simon From glynn@info.ucl.ac.be Mon Mar 11 12:41:40 2002 From: glynn@info.ucl.ac.be (Kevin Glynn) Date: Mon, 11 Mar 2002 13:41:40 +0100 (MET) Subject: Isn't this tail recursive? In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: <15500.42287.405957.128312@adventure> Looking at the online GHC Users Guide, this flag is documented in 4.19.14. Individual optimisations This has a link to Section 4.11.2, but -fall-strict isn't described in that section. Presumably its only been half removed (added) from the documentation. k Simon Marlow writes: > > On 10 Mar 2002, Jyrinx wrote: > > > > > Never fear, > > -fall-strict is here! > > I had no idea this flag still worked. As I recall, it was an experiment > that turned out to be a bad idea - you're probably just better off using > seq. > > Cheers, > Simon > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From reid@cs.utah.edu Mon Mar 11 12:50:01 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 11 Mar 2002 12:50:01 +0000 Subject: Isn't this tail recursive? In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: > It would be possible to do strict evaluation in the case that the > suspended computation is known to take a small bounded amount of > time and space and can't fail - GHC doesn't do this, but we've > wondered about it from time to time. I wonder if this would have the side-effect of making Haskell efficiency even more inscrutable. "Ah, yes, you would have expected this to be a bounded, non-failing computation but " Difficult tradeoff: compiler that optimizes most of your code vs. baffling changes in performance for minor changes in how the code is written. But it's not just Haskell users that get this - anyone using a modern processor can experience cache misses (huge performance cost) in C. -- Alastair Reid From icsm2002.info@unisannio.it Mon Mar 11 13:02:33 2002 From: icsm2002.info@unisannio.it (icsm2002.info@unisannio.it) Date: Mon, 11 Mar 2002 14:02:33 +0100 (CET) Subject: Icsm 2002 Call for Papers: deadline is approaching Message-ID: <200203111302.g2BD2X215957@unisannio.it> Dear Colleague I would like to remind you that the ICSM full paper submission deadline is approaching. ICSM (IEEE International Conference on Software Maintenance), 2002, and associated workshops: SCAM, WSE, WESS and the 1st Workshop on Database Maintenance and Reengineering (DBMR'2002) will be held next October 2002 in Montreal, Canada. Outstanding Keynotes such as Jon Pincus, Microsoft, Industrial and experience papers, research papers, tutorials, tool expositions, dissertation forum, workshops, panels, and other exciting activities have been planned. Papers are due by 18 March 2002 You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt we hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. If you would like to be removed from our list please send an email to icsm2002.info@unisannio.it with REMOVE in the subject. ICSM2002 Giuliano Antoniol, Program CoChair Ira D. Baxter, Program CoChair ============================================================================ IEEE International Conference on Software Maintenance 2002 Sponsored by IEEE ICSM-2002, Montreal, Canada, 3-6 October 2002 http://www.icsm2002.org icsm2002.info@unisannio.it Call for Papers Theme: Maintaining distributed heterogeneous systems ICSM is the major international conference in the field of software and systems maintenance, evolution, and management. This year's theme elaborates on last year's theme of "systems and software evolution in the era of the internet". Standalone legacy applications of yesterday and novel applications using today's technologies are rapidly becoming integrated as part of enterprise-wide and industry-wide systems. The need for rapid integration has led to many distributed heterogeneous systems that are very challenging to maintain and evolve. ICSM 2002 will address these new scenarios and the major challenges of maintenance and evolution. The focus of the conference will be on the new challenges that heterogeneous systems pose for software maintenance, and the new opportunities for researchers and practitioners. A main goal of ICSM is to promote interaction between researchers and practitioners. ICSM 2002 will bring together researchers, practitioners, developers and users of tools, technology transfer experts, and project managers. Jon Pincus (Microsoft) will describe how Microsoft handles software enhancements. Other outstanding Keynote speakers are being arranged. Past conferences have had Parnas, Rombach, McCabe, and Jacobson. ICSM-2002 will offer technical presentations and demonstrations from academia and industry. We are particularly interested in exchanging concepts, prototypes, research ideas, and other results that could contribute to the academic arena and also benefit business and the industrial community. ICSM 2002 will be participatory, with working collaborative sessions and presentations of industry projects. The Conference will be held in conjunction with: WESS -- Workshop on Empirical Studies of Software Maintenance. SCAM -- Source Code Analysis and Manipulation WSE -- Workshop on WEBsite Evolution Topics of interest include but are not restricted to the following aspects of maintenance and evolution: - Methods and theories - Maintenance and/or productivity metrics - Organizational frameworks - Preventive maintenance - Design for maintenance - Tools and environments - Life cycle and process control - Models/methods for error prediction - User interface evolution - Commercial off-the-shelf (COTS) - Third party maintenance - Freeware and open source applications - Program comprehension - Software and system visualisation - Knowledge based systems - Measurement of software - Formal methods - Legal aspects and standards - Software reusability - Internet and distributed systems - Empirical studies - Testing and regression testing - Remote, tele-work - Version and configuration management - Processes and strategies - Management and organisation - Co-operative applications - Source code analysis and manipulation - Processes and strategies - Impact of new software practices - Programming languages - Reengineering and reverse engineering - Multimedia systems RESEARCH PAPERS: Research papers should describe original and significant work in the research and practice of software maintenance and evolution. Case studies, empirical research, and experiments are particularly welcome. We also welcome papers that present leading edge and novel ideas in maintenance. Papers must not exceed 5000 words (10 pages IEEE style) in length, in English. To encourage strong submissions a prize will be awarded for the "Best Paper as Submitted". This Prize is offered by John Wiley & Sons, the publishers of the Journal of Software Maintenance and Evolution. The Program Committee will select the winner and a formal presentation of the Prize will be made in Montreal at ICSM 2002. FAST TRACK PAPERS: Fast Track papers should describe on-going research activities, or summarize the experience in software maintenance and evolution. Papers must not exceed 4 pages, IEEE style, in length, in English. Accepted fast-track papers will be included in a dedicated section of the conference proceedings. DISSERTATION FORUM: We welcome submissions of young researchers that have delivered their dissertation (Masters or Ph.D.) in the last three years. An award will be issued for the best submission. Four page summaries of accepted dissertations will be included in the conference proceedings and a special forum section will be organised at the conference. INDUSTRIAL APPLICATIONS: Proposals for presentations of Industrial Applications are welcome. These can be state-of-the-art descriptions, experience reports and survey reports from real projects, industrial practices and models, or tool demonstrations. A dedicated sub-committee of the program committee will review Industrial Application proposals and a 1-page summary of accepted proposals will be included in the conference proceedings. TUTORIALS: Tutorials should present software maintenance and evolution topics of interest to practitioners. Tutorials may be full day or half-day in length. SUBMISSION STYLE: PDF and/or Postscript electronic submission only. Papers longer than 15 pages or 6000 words will be returned to the authors. Acceptance notification will occur July 1, 2002. IMPORTANT DATES You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt Research Papers deadline: 18 March 2002 mailto:icsm2002.full@unisannio.it Fast Track Papers deadline: 1 May 2002 mailto:icsm2002.short@unisannio.it Dissertation Forum deadline: 1 May 2002 mailto:icsm2002.thesis@unisannio.it Industrial Applications deadline: 1 May 2002 mailto:icsm2002.industry@unisannio.it Tutorials deadline: 18 March 2002 mailto:icsm2002.tutorial@unisannio.it From simonpj@microsoft.com Mon Mar 11 13:04:28 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 05:04:28 -0800 Subject: Standard Library report: List union Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AC3@RED-MSG-10.redmond.corp.microsoft.com> There's a remark at the beginning of 7.2 that says: delete, (\\), union and intersect preserve the invariant=20 that lists don't contain duplicates, provided that=20 their first argument contains no duplicates. The same applies to unionBy etc. This design is one you might reasonably disagree with. I'd have thought it would be more sensible to have the invariant that *both* arguments to union and intersect are assumed to be sets (no dups). But I don't propose to change this now. Simon | -----Original Message----- | From: Jay Cox [mailto:sqrtofone@yahoo.com]=20 | Sent: 05 March 2002 01:51 | To: Jon Fairbairn | Cc: haskell@haskell.org | Subject: Re: Standard Library report: List union |=20 |=20 | On Mon, 4 Mar 2002, Jon Fairbairn wrote: |=20 | > The current library report defines unionBy like this: | > | > unionBy eq xs ys =3D xs ++ deleteFirstsBy eq (nubBy eq ys) xs | > | > why does it take the nub of ys, but not xs? I'd have expected | > | > unionBy eq xs ys =3D (nubBy eq xs) ++ deleteFirstsBy eq=20 | (nubBy eq ys)=20 | > xs | > | > J=F3n |=20 | Pure guess, but... (no really!) |=20 |=20 | For the sake of argument, lets define a ulist as a list where=20 | for all elements x in list l, there is no element n with=20 | index not equal to that of x (index being position of the=20 | element in the list) such that eq n x =3D=3D True. |=20 | In other words every element in a ulist appears only once. |=20 | Suppose you (unionBy eq x y) to get a result. | Suppose also that x is a ulist | A. x is a ulist by argument. | B. the result of (nubBy eq ys), lets call it z, is a ulist. | C. the result of (deleteFirstsBye eq z xs) is a list which=20 | has no elements in common with xs). because (deleteFirstsBy=20 | eq) "deletes" elements and doesnt add,the result is a ulist.=20 | D. Adding new, unique, elements (elements not equal to a=20 | element in the ulist in question) to a ulist results in a=20 | ulist. E. Therefore (unionBy eq x y) is a ulist. |=20 |=20 | Why should this be important? |=20 | what if you wanted to fold the function (unionBy eq) over a=20 | list of lists to get a ulist? Assuming you start with an=20 | initial ulist, by your suggestion you'd be applying (nubBy=20 | eq) to a ulist (generated by the the repeated application=20 | (unionByeq), which would be the same as applying the identity=20 | function to a ulist. (meaning you have essentially one big=20 | nasty no-op)! |=20 |=20 | However, in taking a look at unionBy, one might wonder why it=20 | isnt defined like so (assuming xs would be the accumulated=20 | ulist in the fold. |=20 |=20 | unionBy eq xs ys =3D (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs |=20 | or maybe better (to mirror (++)) |=20 | unionBy' eq ys xs =3D (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs |=20 | in using this definition, the number of conses with (:)=20 | should be linear (or less) with with the number of elements=20 | to be added to the first_ulist in the following folds. |=20 |=20 | foldl (unionBy eq) first_ulist list_of_lists | foldr (unionBy' eq) first_ulist list_of_lists |=20 | So, is there aother reason I cannot think of? I'm sure I=20 | haven't covered all bases here. |=20 | Thanks, |=20 | Jay Cox |=20 | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |=20 From bernhard@cogs.susx.ac.uk Mon Mar 11 13:06:58 2002 From: bernhard@cogs.susx.ac.uk (Bernhard Reus) Date: Mon, 11 Mar 2002 13:06:58 +0000 Subject: type aliases in instances References: <3C875792.DEB308C3@cogs.susx.ac.uk> Message-ID: <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Richard Uhtenwoldt wrote: > > I do not have experience commposing monads (maybe John Hughes can > chime in?), but I'll address where Bernhard Reus writes: > > >This can be avoided by using type > >aliases but then the monads in use cannot be instances of the Monad > >class. > >But not declaring the monads to be in class Monad can hardly > >be good style, can it? > > GHC's source code defines many monads not in class Monad. > I'll write some untested code to give an idea of > the naming conventions used: > > type FooMd out = (a,b,c)->((a,b,c),out) > returnFooMd out = \s0->out > thenFooMd p k = \s0->let (s,out) = p s0 > Thanks Richard. So this means it is common practice in the Haskell community to use type aliases and not to declare the monads as instances. But that makes me even more curious. Why are type aliases not allowed in instance declarations? I haven't found an explanation in the language doc. Does anybody know the exact reason? Any pointer appreciated. Cheers, Bernhard From franka@cs.uu.nl Mon Mar 11 14:42:33 2002 From: franka@cs.uu.nl (Frank Atanassow) Date: Mon, 11 Mar 2002 15:42:33 +0100 Subject: College Student In-Reply-To: <20020309051119.86835.qmail@web14708.mail.yahoo.com>; from mlsl99@yahoo.com on Fri, Mar 08, 2002 at 09:11:19PM -0800 References: <20020309051119.86835.qmail@web14708.mail.yahoo.com> Message-ID: <20020311154233.A27023@cs.uu.nl> My apologies to the list. This message is addressed to my old email address; I don't know why I was singled out for private tutoring lessons. Strange. Does this sort of thing happen to other people on this list too? I get these sorts of messages, usually privately, about once every two months. mary lee wrote (on 08-03-02 21:11 -0800): > > To : Mr. Frank A. > Chrishtoph > > I am recently doing my assignment on Haskell at my > college. I am just new on Haskell programming. I > would like to request if you can teach me for just few > programming rules on Haskell. It is my most > appreciation to learn from you. > > My assignment title is INTERNATIONAL AIRLINES SYSTEM. > > May i know how to open file, put record entry and just > read it from its database. How to do a simple input > and output for acquire user options using functional > programming. It is very important for me to learn > Haskell in a proper way. It will lead me to write a > good documentation. A good understanding on > programming is good. I am good in Visual Basic, > Pascal, Cobol, C++ and also JAVA. But facing > functional programming is a real problem for me. > > Now i have doing a simple Haskell programming on the > way. I just know how to import file, declare types > and display output. > > Your help and guidelines is most appreciated. > > From, > Lee Ling Ling -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-3791 From antony@apocalypse.org Mon Mar 11 15:36:53 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 11 Mar 2002 10:36:53 -0500 Subject: A Cygwin port of hmake? Message-ID: <3C8CCF15.8010004@apocalypse.org> Hi, Has anyone attempted / considered porting hmake to Cygwin? I'd like to try HaXmL under ghc on Windows, but it seems to require hmake to build. I made a naieve attempt to configure and build hmake under Cygwin myself, but the resulting Makefile tried to pass Cygwin-style /cygdrive/c/... paths to ghc, which promptly choked. I made some abortive attempts to hand-edit the Makefile.inc, but it then attempted to create some directories above my current working directory, and I eventually got lost trying to trace down the nested Makefile inclusions. Before I invest more time in either porting hmake or writing a portable Makefile for HaXmL, I thought I'd post here to see if anyone else had already been down this road. If you have, please get in touch. Thanks, -antony -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From sof@galois.com Mon Mar 11 16:43:46 2002 From: sof@galois.com (Sigbjorn Finne) Date: Mon, 11 Mar 2002 08:43:46 -0800 Subject: Concurrent Haskell (GHC) and Win32 Applications ? References: <1113DDB24D4A2841951BFDF86665EE1901041ABE@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <003301c1c91b$e9ab6b70$8132a8c0@sofxp> "Simon Peyton-Jones" writes: > > | The problem I think is with the lightweight thread implementation - > | Win32 calls can (and will) block the OS thread that makes the call, > | which blocks the entire system. Given that I'm wanting to write a > | network server with a Win32 GUI, this is obviously a Bad Thing. > > Yes, that's true at the moment, but it's something that we expect > to fix shortly. More precisely, Sigbjorn has been working on a > fix. It relies on using an OS thread to make a potentially-blocking > call, so it's a robust fix. > > I don't quite know when he'll be done with this -- Sigbjorn do you know? Modulo settling a couple of minor implementation details, I'd say it's done. To try it out, check out the fptools/ CVS sources, and configure & build it with the option --enable-threaded-rts Non-blocking callouts are enabled by attributing a 'foreign import' with 'threadsafe' (instead of 'unsafe' or 'safe') -- e.g., foreign import "wait" threadsafe snail :: IO () --sigbjorn From xddainese@xlibero.it Mon Mar 11 17:08:50 2002 From: xddainese@xlibero.it (Diego Dainese) Date: 11 Mar 2002 18:08:50 +0100 Subject: type aliases in instances In-Reply-To: <3C8CABF2.7C48E34F@cogs.susx.ac.uk> References: <3C875792.DEB308C3@cogs.susx.ac.uk> <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Message-ID: <87wuwjqbfh.fsf@benten.tomobiki.it> On Mon, 11 Mar 2002 13:06:58 +0000 Bernhard Reus wrote: [...] > But that makes me even more curious. Why are type aliases not allowed in > instance declarations? I haven't found an explanation in the language > doc. Does anybody know the exact reason? Any pointer appreciated. Look at this post from Mark P. Jones: it explains the reasons pretty well. Subject: RE: Constructor Classes Date: Wed, 8 Dec 1999 13:26:53 -0800 Message-Id: Regards, -- Diego To reply remove the 2 `x' from the address. From simonpj@microsoft.com Mon Mar 11 17:48:46 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 09:48:46 -0800 Subject: H98 Report: expression syntax glitch Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AD3@RED-MSG-10.redmond.corp.microsoft.com> Ross points out that this is really hard to parse: | case x of y | ($ True) $ \ z -> z :: Bool -> Bool -> y because the parser doesn't know when to stop eating the type and treat the arrow as the case-alternative arrow. Carl reminds us that this is hard to parse too: | do a =3D=3D b =3D=3D c because the layout processor is meant to insert a close curly where there would be a syntax error, and that depends on the non-associativity of (=3D=3D). In both cases, the specification is unambiguous, but asks too much of the=20 parser. But in neither case can I see a cure that is better than the=20 disease. Remember, large-scale fixes are out of court. So in both cases I propose to say something like: here is an example that is hard to implement; wise programers will avoid code like this That is, point out the trap, and acknowledge that few impls will respect the letter of the law. This seems honest, and better than inventing some elaborate cure. Simon From Sven.Panne@informatik.uni-muenchen.de Mon Mar 11 18:15:26 2002 From: Sven.Panne@informatik.uni-muenchen.de (Sven Panne) Date: Mon, 11 Mar 2002 19:15:26 +0100 Subject: type aliases in instances References: <3C875792.DEB308C3@cogs.susx.ac.uk> <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Message-ID: <3C8CF43E.1010805@informatik.uni-muenchen.de> Bernhard Reus wrote: > Richard Uhtenwoldt wrote: >> [...] GHC's source code defines many monads not in class Monad. >>I'll write some untested code to give an idea of >>the naming conventions used: >> >>type FooMd out = (a,b,c)->((a,b,c),out) >>returnFooMd out = \s0->out >>thenFooMd p k = \s0->let (s,out) = p s0 > > Thanks Richard. So this means it is common practice in the Haskell > community to use type aliases and not to declare the monads as > instances. [...] Nope, it just means that at the time those parts were written the class Monad didn't exist, i.e. pre-Haskell-1.3, IIRC. :-) Cheers, S. From Ralf.Laemmel@cwi.nl Mon Mar 11 19:59:54 2002 From: Ralf.Laemmel@cwi.nl (Ralf.Laemmel@cwi.nl) Date: Mon, 11 Mar 2002 20:59:54 +0100 (MET) Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: Simon Peyton-Jones wrote: > Indeed the foralls are at the top, but I claim that wherever > you could use the composition function you were expecting, > you can also use the one GHC gives you. The two types > are isomorphic. > ... > Let me know if you find a situation where this isn't true. > ... > No I believe it is not a bug. I would be interested to see why you > needed to change your code. It is all not that simple. Let me try to explain. For some deeper background I refer to my draft. One more week to finish. http://www.cwi.nl/~ralf/rank2/ Maybe, we should do that offline. But maybe it is interesting for people how like rank-2 stuff. Let's consult the following code with the ghc 5.03 snapshot. It is basically the same kind of example as in my last posting but I point out a few things more clearly, and the example is simpler. --------------------------------------------------------------------- type Generic i o = forall x. i x -> o x type Id x = x comb :: (Generic Id Id) -> (Generic Id Id) -> (Generic Id Id) comb = undefined comb' :: forall x1 x11 x. (Id x1 -> Id x1) -> (Id x11 -> Id x11) -> Id x -> Id x comb' = undefined yacomb :: (forall x. x -> x) -> (forall x. x -> x) -> (forall x. x -> x) yacomb = (.) yacomb' :: forall x y z. (x -> x) -> (y -> y) -> (z -> z) yacomb' = undefined --------------------------------------------------------------------- I explain the code per def./decl.: 1. The type synonym Generic captures a parameterized function type where we can still plug in type constructors of kind *->* to derive domain and codomain from the explicitly quantified x. The type Generic suggests that we deal parametric polymorphism but in my real code I have class constraints on x. This immediately resolves Simon's concern about the usefulness of defining sequential composition in some new way. I had chosen seq. comp. as an example to play with types. If we go beyond parametric polymorphism, several binary combinators using Generic for arguments and result make sense (see my draft; feedback appreciated). 2. The type constructor Id of kind * -> * is the identity type constructor. That is, given a type, it returns the very same type. There are plenty of useful type constructors like Id but let's restrict our discussion to Id for simplicity. As an aside, I like it very much that ghc allows me to compose type synoyms like I do with Generic and Id. hugs doesn't allow me that, and this implies that I have to use datatypes instead for things like Id, and this in turn implies that I have quite some wrapping / unwrapping going on in my hugs expression code. 3. Let's suppose we want to define SOME binary function combinator comb. It takes two polymorphic functions of a certain type as for i and o and returns another polymorphic function with potentially some other i and o for the domain and codomain. In fact, I have chosen Id for all i and o parameters for the above comb for simplicity. Let's us ignore parametricity for a moment and pretend we know how to define many combinators like this. In the example above, I left comb undefined since I only want to play with the ghc type system. As I said, in my true code I define interesting combinators with such type schemes but with extra class constraints. This is the reason that I can do more things than parametricity allows me. So let us really not think of ordinary (say, parametric polymorphic) sequential composition as my last email maybe suggested. 4. So now let's ask for the type of comb in ghc. It turns out to be the rank-1 (!!!) type I captured as explicit type annotation for comb'. I would have expected a rank-2 type because the forall is scoped by the type synonym Generic. So why should I like to see the forall going to the top? I still would say that THIS IS A BUG. Here is why the types are different: The rank-1 type allows me to combine functions on say integers (by using Int for x x1 and x11). The rank-2 type that I am asking for rules out monomorphic functions to be composed. So the type with the foralls at the top, and the foralls scoped in a rank-2 discipline are NOT isomorphic. Also, keep the possibility of class constraints in mind. Simon, is it maybe possible that you confused the type of (.), that is, forall b c a. (b -> c) -> (a -> b) -> a -> c with the type forall z y x. (x -> x) -> (y -> y) -> z -> z. The b c a in (.) types deal with the possibly different result types. The z y x in my rank-1 comb (messed up by ghc) deal were originally meant to display insistance on polymorphic function arguments. So the the foralls should not be at the top. 5. The type that I wrote down for yacomb is precisely the rank-2 type I would have favoured to see for comb instead of the actual type suggested by ghci. It is a rank-2 type. A minor issue: I expanded the occurrences of Id for readability (ghc keeps them at all costs because it seems to assume that I like to get reminded of them which is not the case BTW). So everything (the two arguments and the result) are of type forall x. x -> x (which should be equal to Generic Id Id). As an example, I define yacomb to be equal to (.). But note yacomb is a very much restricted (.), not just that it composes type-preserving functions but it insists on polymorphic functions. 6. Now let us see what happens if we take all the foralls to the top. This function would be of the type as shown for yacomb', that is, forall x y z., ... This is precisely the type ghci suggests instead of the rank-2 type except that I applied away Id. Now let's try to define yacomb' in terms of yacomb, that is: yacomb' = yacomb This works. Let us not wonder why. Now let's try to define yacomb' in terms of (.) instead, that is: yacomb' = (.) You get a nice type error in ghci 5.03: test.hs:17: Inferred type is less polymorphic than expected Quantified type variable `x' is unified with another quantified type variabl e `z' Quantified type variable `y' is unified with another quantified type variabl e `z' Signature type: forall z y x. (x -> x) -> (y -> y) -> z -> z Type to generalise: (x -> x) -> (x -> x) -> x -> x When checking the type signature for `yacomb'' When generalising the type(s) for `yacomb'' module `Prelude' is not interpreted Whatever this means, it at least shows that the two types are not isomorphic in the sense that ghci very well separates them even in the case of parametric polymorphism. Or is this (another) bug? Simon Peyton-Jones also wrote: > No, GHC does not support partially applied type synonyms, > except in the RHS of other type synonyms. It is a VERY BIG thing to > allow this, because it amounts to allowing lambdas at the type level > and that messes up inference cruelly. > > Why do you think GHC does? Ok, that's what I meant: in RHSs of other type synonyms. BTW, it also works when passing parameters to parameterized datatypes. Here is a variation on defining Generic as a datatypes as opposed to the earlier type synonym. Id is still the same type synonym as before. data Generic' i o = G (forall x. i x -> o x) type TP = Generic Id Id Yes, I was surprised to see that it works to this extent. In fact, it is already quite expressive in this form because it allows us to have type constructors as type synonyms but of course not arbitrary lambdas as Girard's system would ask for. So I revise my question: Does the current support for partially applied type synonyms pose any challenges or is it basically just like macro expansion? That is, is the type system maybe not even affected by it? If it is easy, why is not in Haskell 98 and in hugs? It is terribly useful. Ralf From claus.reinke@talk21.com Mon Mar 11 21:45:07 2002 From: claus.reinke@talk21.com (Claus Reinke) Date: Mon, 11 Mar 2002 21:45:07 -0000 Subject: A Cygwin port of hmake? References: <3C8CCF15.8010004@apocalypse.org> Message-ID: <003c01c1c946$1b8b6b20$ae1ffea9@Standard> > Has anyone attempted / considered porting hmake to Cygwin? > > I'd like to try HaXmL under ghc on Windows, but it seems to require > hmake to build. Just curious: is that the HaXmL in hslibs.Text that comes with ghc? Aren't hslibs thingies supposed to be portable (and ported/updated, if they come with a Haskell implementation)? > I made a naieve attempt to configure and build hmake under Cygwin > myself, but the resulting Makefile tried to pass Cygwin-style > /cygdrive/c/... paths to ghc, which promptly choked. I'm no expert on configure, but who exactly is putting the /cygdrive/c/.. stuff in there? Cygwin should use its pretended filesystem, or indeed local paths, so perhaps someone is explicitly setting an absolute path or path-prefix. Can you configure with c:/ instead (I understand that ghc only chokes on cygwin specials, not on Windows-infelicities or local paths, and some cygwin tools are tolerant towards c:/.. style), perhaps by setting appropriate prefixes? I seem to remember that compiling HOpenGL with non-cygwin GHC under cygwin/Win2k, using configure and co, worked without such problems. Claus From antony@apocalypse.org Mon Mar 11 22:40:55 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 11 Mar 2002 17:40:55 -0500 Subject: A Cygwin port of hmake? References: <3C8CCF15.8010004@apocalypse.org> <003c01c1c946$1b8b6b20$ae1ffea9@Standard> Message-ID: <3C8D3277.4060003@apocalypse.org> Claus Reinke wrote: >>Has anyone attempted / considered porting hmake to Cygwin? >> >>I'd like to try HaXmL under ghc on Windows, but it seems to require >>hmake to build. >> > > Just curious: is that the HaXmL in hslibs.Text that comes with ghc? > Aren't hslibs thingies supposed to be portable (and ported/updated, > if they come with a Haskell implementation)? Indeed it is. I was pleasantly surprised to learn that '-package text' was all I needed to use HaXmL. >>I made a naieve attempt to configure and build hmake under Cygwin >>myself, but the resulting Makefile tried to pass Cygwin-style >>/cygdrive/c/... paths to ghc, which promptly choked. >> > > I'm no expert on configure, but who exactly is putting the /cygdrive/c/.. > stuff in there? Cygwin should use its pretended filesystem, or indeed > local paths, so perhaps someone is explicitly setting an absolute path > or path-prefix. Can you configure with c:/ instead (I understand that > ghc only chokes on cygwin specials, not on Windows-infelicities or > local paths, and some cygwin tools are tolerant towards c:/.. style), > perhaps by setting appropriate prefixes? I seem to remember that > compiling HOpenGL with non-cygwin GHC under cygwin/Win2k, > using configure and co, worked without such problems. Unfortunately, that isn't the problem. I set prefix=c:/... when invoking configure, and configure used that path in its output. But unfortunately the Makefile.inc used to build hmake does some tricky $(PWD) shenanigans that have nothing to do with configure, and then passes the resulting path to ghc. Unfortunately, $(PWD) returns Cygwin-style paths, and I failed to find a good workaround for this in the few minutes I spent looking at it. Anyway, I'm relieved that HaXmL is in hslibs. -antony -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From sqrtofone@yahoo.com Tue Mar 12 04:35:47 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Mon, 11 Mar 2002 22:35:47 -0600 (CST) Subject: type aliases in instances In-Reply-To: <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Message-ID: On Mon, 11 Mar 2002, Bernhard Reus wrote: > Richard Uhtenwoldt wrote: > > > > I do not have experience commposing monads (maybe John Hughes can > > chime in?), but I'll address where Bernhard Reus writes: > > > > >This can be avoided by using type > > >aliases but then the monads in use cannot be instances of the Monad > > >class. > > >But not declaring the monads to be in class Monad can hardly > > >be good style, can it? > > > > GHC's source code defines many monads not in class Monad. > > I'll write some untested code to give an idea of > > the naming conventions used: > > > > type FooMd out = (a,b,c)->((a,b,c),out) > > returnFooMd out = \s0->out > > thenFooMd p k = \s0->let (s,out) = p s0 > > > > Thanks Richard. So this means it is common practice in the Haskell > community to use type aliases and not to declare the monads as > instances. I don't know about that. Andy Gill has a a monad library out there (sorry, the link I have is not in use anymore) that basically uses the newtype psuedo-type aliases. If I needed to construct monad for myself, I certainly wouldn't use "type". I'm sure most others feel the same way. Besides, there might be any number of reasons that GHC could use type aliases. The first that comes to mind is the old rule, "If it works, don't fix it." As I haven't read the sourcecode, I can only guess. > But that makes me even more curious. Why are type aliases not allowed in > instance declarations? I haven't found an explanation in the language > doc. Does anybody know the exact reason? Any pointer appreciated. With glasgow extensions, (perhaps hugs has this extension too?) you could use almost any arbitrary type. But as SPJ said in a previous post, you cannot have standalone "curried" type alias expressions, therefore I believe you, shouldn't be able to use type aliases for a definition of a Monad or Functor instance. (Hey, I tried! the original message that inspired this thread inspired me to do so.) As an example, I created this half finished library which allows one to type non-polymorphic expressions with type-classes. It uses ghc's -fallow-overlapping-instances so that something of type, say, String -> [(a,String)] as a "Parser a" (The "Parser a" example not included in source code). It also uses glasgow-exts, but I believe its only need is to express the type of the constant bottomless, which because it is polymorphic, I use to assign types to multiple instances of it. (basically, I have built a type class that recurses down the type expression trees.) and, well, perhaps another extension. I'm to lazy to research the names of all extensions :). The code is suprisingly trivial, if one can understand it. Here's a tidbit from the library >bottomless:: forall a. a >bottomless=error "This shouldn't happen in the HasType Module" > >class HasType a where > istype :: a -> String >instance HasType a => HasType(IO a) where > istype _ = "IO (" ++ istype (bottomless::a) ++ ")" If you want to take a look at more of it goto http://www.flash.net/~flygal/Jay/Haskell/HasType.lhs sometime. by that time you get it, it may look alittle different, as i perfect it, change it so that it doesn have to outragous runtime, change the class definition, actually define it as a Module, or whatever. Again, this is a temporary place, until I find a more permanent place, (like my own domain name.) I've digressed. Back to the problem of using type aliases, A problem with using overlapping instances is that you might want to use instances which overlap equally. For example, what if I wanted to use some alias for an arbitrary tuple? The type checker cannot tell the difference between the aliased type and the other, which means you cannot make the two instances type Alias1 =Type1 instance Foo Type1 where ... instance Foo Alias1 where ... Which you dearly might if you wanted to interpet your conception of what your type alias "means" into your program. That's probably why newtype was invented. Jay Cox From jyrinx_list@mindspring.com Tue Mar 12 05:33:01 2002 From: jyrinx_list@mindspring.com (Jyrinx) Date: 11 Mar 2002 21:33:01 -0800 Subject: Isn't this tail recursive? In-Reply-To: References: Message-ID: <1015911182.6392.11.camel@kryptonitespoon.maurers> > > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > > White -> countAll' cs 1 nl nw (nc + 1) > > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) > > > make this something like > > ... > > Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' > White -> nc' `seq` countAll' cs 1 nl nw nc' > Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' > where nw' = nw + newWord > nc' = nc + 1 > nl' = nl + 1 Cool! That did the trick ... (runs on very little memory *and* time now ... very cool) I've read through the other responses (thanks all!), and I'm still not exactly sure what's going on ... I'm relatively new to Haskell, and my understanding of laziness is hardly rigorous; in general, how should I know where I need to use seq, and what I need to use it on? Is there a paper I should read? (I've got Hudak's book, but it does everything lazily IIRC) Jyrinx jyrinx_list@mindspring.com From ketil@ii.uib.no Tue Mar 12 07:11:13 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 12 Mar 2002 08:11:13 +0100 Subject: Concurrent Haskell (GHC) and Win32 Applications ? In-Reply-To: <003301c1c91b$e9ab6b70$8132a8c0@sofxp> References: <1113DDB24D4A2841951BFDF86665EE1901041ABE@RED-MSG-10.redmond.corp.microsoft.com> <003301c1c91b$e9ab6b70$8132a8c0@sofxp> Message-ID: "Sigbjorn Finne" writes: >> Yes, that's true at the moment, but it's something that we expect >> to fix shortly. More precisely, Sigbjorn has been working on a >> fix. It relies on using an OS thread to make a potentially-blocking >> call, so it's a robust fix. > Modulo settling a couple of minor implementation details, I'd say it's done. > To try it out, check out the fptools/ CVS sources, and configure & build > it with the option --enable-threaded-rts Ahem - how far would this be from a "real" multithreaded implementation, i.e. one that could use a few OS threads to take advantage of multiple CPUs in an SMP system? -kzm -- If I haven't seen further, it is by standing in the footprints of giants From simonpj@microsoft.com Tue Mar 12 09:04:47 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 01:04:47 -0800 Subject: Concurrent Haskell (GHC) and Win32 Applications ? Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AD9@RED-MSG-10.redmond.corp.microsoft.com> | Ahem - how far would this be from a "real" multithreaded=20 | implementation, i.e. one that could use a few OS threads to=20 | take advantage of multiple CPUs in an SMP system? Not very far. We have had a working implementation of=20 such a thing, but not in a robust releasable state. S From info@emailwebonline.com Tue Mar 12 04:27:02 2002 From: info@emailwebonline.com (Online Notice) Date: 12/03/02 8:00:00 AM Subject: Your Email / Website Address Message-ID: <20020312092608.A916B4220B3@www.haskell.org> This is a multi-part message in MIME format. --NextMimePart Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit EmailWebOnline

  

                                                                              http://www.emailwebonline.com
                                                                              search@emailwebonline.com
12/03/02
REFERENCE: YOUR EMAIL / WEBSITE ADDRESS
Email:   haskell@haskell.org

EMAIL/WEB ADVICE NOTICE

Our listing department has advised that your organisation''s email details which now appear on the emailweb@online directory website http://www.emailwebonline.com have presently not been approved for listing. Below are your current detials which have been previously listed complementarily. If these are suitable for listing please return by clicking the confirm details online button below and completing relevant additional details with 7 days to avoid potential delection of your entry. We trust this does not cause any inconvience. Please Note: Kindly fill in additional information where required in the confirm details online section.

Such confusion has now been addressed by emailwebonline. This internet directory of email addresses and websites will now enable you or your organisation to be accessed much easier. It will also allow you or your organisation to provide any relevant information on the net to assist users in saving valuable time as well as the associated costs involved in making contact with you.


YOUR CURRENT EMAIL DETAILS:
email: haskell@haskell.org

Please Note: We would like to advise for your email address or website, we are now providing direct links free of charge. Additions or alterations can be made but must be returned within 7 days. This is not an invoice please do send any payment. Please click the "Confirm Details Online" button and complete details.

Kind Regards,
Mrs Amanda Tyler
Listing Co-Ordinator.

emailwebonline reaches 475 million people internationally. Internet analyses courtesy of Neilson Net Ratings & ITU(International Telecommunications Union).

From ketil@ii.uib.no Tue Mar 12 09:50:54 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 12 Mar 2002 10:50:54 +0100 Subject: Concurrent Haskell (GHC) and Win32 Applications ? In-Reply-To: <1113DDB24D4A2841951BFDF86665EE1901041AD9@RED-MSG-10.redmond.corp.microsoft.com> References: <1113DDB24D4A2841951BFDF86665EE1901041AD9@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: "Simon Peyton-Jones" writes: > | Ahem - how far would this be from a "real" multithreaded > | implementation, i.e. one that could use a few OS threads to > | take advantage of multiple CPUs in an SMP system? > Not very far. We have had a working implementation of > such a thing, but not in a robust releasable state. Really!? Wow! I have at my disposal an 8-CPU Sun and a (well, less disposable, but access to, at any rate) a cluster of three 64-CPU Regattae. I also have at hand compute-heavy problems with a Haskell-implemented solution. Do let me know when you have something you'll let an amateur with no compiler experience loose upon, won't you? :-) When I last asked about, it seemed that parallell Haskell was the way to go for performance gain, but sadly GPH is lagging real GHC a bit, and worse, is using PVM for parallellisation. As far as I understand, this means a lot of heap duplication (which hurts, since I consume lots of memory) and needless communication overhead on SMPs. May I assume that, if/when a multithreaded RTS stabilises, the paradigms from parallell Haskell can easily be implemented on it ("easily" meaning that it'll probably happen)? At the moment, I'm working on getting my program correct, so I'm only charting the waters, as it were, for parallellisation. -kzm -- If I haven't seen further, it is by standing in the footprints of giants From simonpj@microsoft.com Tue Mar 12 09:55:55 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 01:55:55 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041ADA@RED-MSG-10.redmond.corp.microsoft.com> | type Generic i o =3D forall x. i x -> o x |=20 | type Id x =3D x |=20 | comb ::=20 | (Generic Id Id) | -> (Generic Id Id) =20 | -> (Generic Id Id) =20 | comb =3D undefined | So now let's ask for the type of comb in ghc. | It turns out to be the rank-1 (!!!) type I captured as=20 | explicit type annotation for comb'. I would have expected a=20 | rank-2 type because the forall is scoped by the type synonym=20 | Generic. So why should I like to see the forall going to the=20 | top? I still would say that THIS IS A BUG. Here is why the=20 Yes, indeed this is a bug. Thank you for finding it. It turned out that in liberalising GHC's treatment of type synonyms (which you remark is a good thing) I had failed to cover a case. Fortunately, an ASSERT caught the bug in my build, and the fix is easy. | yacomb1 :: (forall x. x -> x)=20 | -> (forall x. x -> x)=20 | -> (forall x. x -> x)=20 | yacomb1 =3D (.) | | yacomb2 :: forall x y z. (x -> x) -> (y -> y) -> (z -> z) | yacomb2 =3D undefined | | Now let's try to define yacomb2 in terms of yacomb1, that is: | | yacomb2 =3D yacomb1 | | This works. Let us not wonder why. We should wonder why. It's plain wrong. yacomb1's type signature is more restrictive than that of yacomb2. This is a bug in the 5.03 snapshot, which fortunately I fixed a week or two ago. The compiler in the respository rejects the definition. Bottom line: you found two bugs, for which much thanks. But I stand by forall-lifting! (But note that the foralls are lifted only from *after* the arrow, not before. (forall a.a->a) -> Int is not the same as (forall a. (a->a) -> Int).) Simon From ross@soi.city.ac.uk Tue Mar 12 10:00:15 2002 From: ross@soi.city.ac.uk (Ross Paterson) Date: Tue, 12 Mar 2002 10:00:15 +0000 Subject: minor H98 inconsistency: sections Message-ID: <20020312100015.GA16972@soi.city.ac.uk> The following passages differ on the status of (a+b+): 3 Expressions aexp -> ... | ( expi+1 qop(a,i) ) (left section) | ( qop(a,i) expi+1 ) (right section) 3.5 Sections Syntactic precedence rules apply to sections as follows. (op e) is legal if and only if (x op e) parses in the same way as (x op (e)); and similarly for (e op). For example, (*a+b) is syntactically invalid, but (+a*b) and (*(a+b)) are valid. Because (+) is left associative, (a+b+) is syntactically correct, but (+a+b) is not; the latter may legally be written as (+(a+b)). ghc follows the grammar, rejecting (a+b+) Hugs accepts (op a op' b) and rejects (a op b op') regardless of associativity and precedence, while nhc accepts them both. The grammar could be made to match the text by adding two alternatives: | ( lexpi qop(l,i) ) (left section) | ( qop(r,i) rexpi ) (right section) Changing the text to match the grammar seems less attractive. But the text says more than the revised grammar. For example, it deals with the expression glitch I mentioned the other week: together with the disambiguation meta-rule, it implies that the expression (let x = 10 in x `div`) is invalid, because let x = 10 in x `div` z doesn't parse as (let x = 10 in x) `div` z (might be worth adding this as an example) but it's no help with SimonM's example let x = 10 in x == x == True From simonpj@microsoft.com Tue Mar 12 10:06:25 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 02:06:25 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041ADD@RED-MSG-10.redmond.corp.microsoft.com> | Ok, that's what I meant: in RHSs of other type synonyms. | BTW, it also works when passing parameters to parameterized=20 | datatypes. Here is a variation on defining Generic as a=20 | datatypes as opposed to the earlier type synonym. Id is still=20 | the same type synonym as before. |=20 | data Generic' i o =3D G (forall x. i x -> o x) | type TP =3D Generic Id Id |=20 | Yes, I was surprised to see that it works to this extent. This works because you said Generic not Generic' in the RHS of TP. If you use Generic' the program is rejected, and so it should be. | system would ask for. So I revise my question: Does the | current support for partially applied type synonyms=20 | pose any challenges or is it basically just like macro=20 | expansion? That is, is the type system maybe not even=20 | affected by it? If it is easy, why is not in Haskell 98 and=20 | in hugs? It is terribly useful. It's just macro expansion. GHC expands saturated type synonyms before looking for well-formedness in types. This is indeed=20 rather useful, and it's easy too. It's not in H98 because no one thought of it then.=20 Simon From Malcolm.Wallace@cs.york.ac.uk Tue Mar 12 10:20:44 2002 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Tue, 12 Mar 2002 10:20:44 +0000 Subject: A Cygwin port of hmake? In-Reply-To: <3C8D3277.4060003@apocalypse.org> Message-ID: Antony, > But unfortunately the Makefile.inc used to build hmake does some tricky > $(PWD) shenanigans that have nothing to do with configure, and then > passes the resulting path to ghc. Unfortunately, $(PWD) returns > Cygwin-style paths, and I failed to find a good workaround for this in > the few minutes I spent looking at it. David Duke recently reported that the hmake distributed with nhc98-1.10 builds correctly with ghc-5.02.2 under Cygwin, but the separate distribution of hmake-3.01 does not. This was very puzzling, but your mention of $(PWD) rings a bell as to what the difference between them might be. The working distribution uses $(shell pwd) in its Makefiles instead of $(PWD). I recently changed all instances of the former to the latter because I couldn't see any reason why we should fork off lots of shell processes just to find the current directory, when that information is instantly available in a variable. It seems that the slight performance hit entailed by the shell calls is a necessary evil in order to cope with Cygwin, so I'll change them back again. Apologies for the inconvenience I have caused you by introducing this simple "improvement". It looked benign at the time! Regards, Malcolm From simonpj@microsoft.com Tue Mar 12 12:08:56 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 04:08:56 -0800 Subject: FW: Layout indentation marking Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AE2@RED-MSG-10.redmond.corp.microsoft.com> I agree with Ian here (and not just because of what GHC does!) Does anyone disagree? Simon -----Original Message----- From: Ian Lynagh [mailto:igloo@earth.li]=20 Sent: 10 March 2002 15:23 To: Haskell list Subject: Layout indentation marking Given this module module Main where main :: IO() main =3D putStrLn $ show $ foo foo :: Int foo =3D x + y where x =3D 6 s =3D "foo\ \bar" y =3D 7 nhc98 and hugs correctly (as per the revised report) print 13. ghc gives q.lhs:11: parse error on input `=3D' I think ghc is in the right here and the report should be updated to read + Where the start of a lexeme does not follow the end of a lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) (it currently reads + Where the start of a lexeme does not follow a complete lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) where I have altered only the first line). Thanks Ian _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell From simonpj@microsoft.com Tue Mar 12 13:00:36 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 05:00:36 -0800 Subject: FW: H98 Report: expression syntax glitch Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AE6@RED-MSG-10.redmond.corp.microsoft.com> In response to my recent message (below), Ross asks: "Are you rejecting the fix I suggested: Add a side condition to the grammar in 3.13: the guard must not end with a type signature (because the following -> looks like part of the type)." Indeed, this would be possible. It would reject programs like f x =3D case x of { (a,b) | b :: Bool -> a } which are in principle reasonable, but are really hard to parse. Indeed, GHC, Hugs, and nhc all reject it. I suppose that the term "ends with" is a bit imprecise, too. Presumably this would be OK f x =3D case x of { (a,b) | (b :: Bool) -> a } Still, Ross's suggestion is pragmatic: if all the impls find this corner of the language too hard to parse, then some guidance about what=20 not to write would be a good plan. As usual, this is not a big deal: it's a dark corner that few will trip over. But it is my joyful task (aided by many others) to try to=20 illuminate the darkness, so I invite your opinions about which fix (the one below, or Ross's) is better. Simon -----Original Message----- From: Ross Paterson [mailto:ross@soi.city.ac.uk]=20 Sent: 11 March 2002 17:59 To: Simon Peyton-Jones Subject: Re: H98 Report: expression syntax glitch Simon, > Ross points out that this is really hard to parse: >=20 > | case x of y | ($ True) $ \ z -> z :: Bool -> Bool -> y >=20 > because the parser doesn't know when to stop eating the type and treat > the arrow as the case-alternative arrow. > But in neither case can I see a cure that is better than the > disease. Remember, large-scale fixes are out of court. An easier case than Carl's, I think. From simonpj@microsoft.com Tue Mar 12 17:08:07 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 09:08:07 -0800 Subject: Haskell report: deriving Show & Read instances, Appendix D Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AF4@RED-MSG-10.redmond.corp.microsoft.com> Folks Olaf points out a problem with the specification of 'deriving' Show. In particular: | "The representation will be enclosed in parentheses=20 | if the precedence of the top-level constructor operator in x=20 | is less than d."=20 Olaf proposes that we should change "less than" to "less than or equal to". His reasoning is below, and seems persuasive to me. Briefly, the=20 consequences of the change would be: a) The current specification yields syntactically incorrect Haskell for some associativities. The changed specification would avoid this. b) The changed spec would yield more than the minimum number of parentheses. c) The current spec makes it hard for simple recursive descent parsers, such as that suggested by the Report for Read, to avoid divergence on left recursion. The changed spec makes it easy. d) The downside is that all compilers would need to change, slightly. Any comments? Simon | In all Haskell implementations (tested Hugs,Ghc and nhc98)=20 | show sometimes produces output that does not represent=20 | well-formed expressions. For example: |=20 | data Tree a =3D Node a | Tree a :^: Tree a | Tree a ::: Tree a=20 | deriving (Eq,Show) |=20 | infixl 6 ::: | infixr 6 :^: |=20 | main =3D print ((Node True :^: Node False) ::: Node True) |=20 | yields |=20 | Node True :^: Node False ::: Node True |=20 | The expression is ill-formed because one constructor is left-=20 | and the other one is right-associative. |=20 | Finally, left-recursive data constructors that are=20 | left-associative lead read into infinite recursion. Example: |=20 | infixl 5 :^: | =20 | data Tree a =3D Leaf a | Tree a :^: Tree a deriving (Show,Read) |=20 | main =3D do | print (read "(Leaf True :^: Leaf False) :^: Leaf True" :: Tree Bool) |=20 |=20 | I have a solution for the two last problems. It means all=20 | Haskell compilers have to change, but I believe that it is worth it. |=20 | The source of the show problem is that show tries to handle=20 | associativity of infix constructors. But there is no way to=20 | do this correctly. showsPrec gets as argument the precedence=20 | of the surounding expression, but not its associativity. This=20 | associativity would be needed to use associativity of=20 | constructors correctly. |=20 | The solution is simple: dont' try to use associativity to=20 | avoid parenthesis. Thus you get some superfluous paranthesis,=20 | but the output is always correct and the implementation of=20 | deriving is even a bit simpler. E.g.: |=20 | showsPrec d (u :^: v) =3D showParen (d > 5) showStr | where | showStr =3D showsPrec 6 u .=20 | showString " :^: " . | showsPrec 6 v | For all of |=20 | infix 5 :^: | infixl 5 :^: | infixr 5 :^: |=20 | The second advantage of this simplification is, that the=20 | additional parentheses prevent infinite left recursion. You=20 | can read in the tree expression given above, because=20 | parentheses are now compulsory: |=20 | instance (Read a) =3D> Read (Tree a) where |=20 | readsPrec d r =3D readParen (d > 5) | (\r -> [(u:^:v,w) | | (u,s) <- readsPrec 6 r, | (":^:",t) <- lex s, | (v,w) <- readsPrec 6 t]) r |=20 | ++ readParen (d > 9) | (\r -> [(Leaf m,t) | | ("Leaf",s) <- lex r, | (m,t) <- readsPrec 10 s]) r |=20 | What do you think? |=20 | Discussing all the other minor problems with the report=20 | specification doesn't make sense before this major issue is=20 | cleared up. |=20 | Ciao, | Olaf |=20 | --=20 | OLAF CHITIL,=20 | Dept. of Computer Science, The University of York, York YO10=20 | 5DD, UK.=20 | URL: http://www.cs.york.ac.uk/~olaf/ | Tel: +44 1904 434756; Fax: +44 1904 432767 |=20 From hdaume@ISI.EDU Tue Mar 12 17:34:47 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Tue, 12 Mar 2002 09:34:47 -0800 (PST) Subject: Isn't this tail recursive? In-Reply-To: <1015911182.6392.11.camel@kryptonitespoon.maurers> Message-ID: Here's the basic idea. Suppose we have the function: > sum [] acc = acc > sum (x:xs) acc = sum xs (acc+x) This is tail recursive, but not strict in the accumulator argument. What this means is that the computation will be performed lazily, so sum [4,5,8,10,14,20] 0 will go like this: > sum [4,5,8,10,14,20] 0 = > sum [5,8,10,14,20] (0+4) = > sum [8,10,14,20] ((0+4)+5) = > sum [10,14,20] (((0+4)+5)+8) = > sum [14,20] ((((0+4)+5)+8)+10) = > sum [20] (((((0+4)+5)+8)+10)+14) = > sum [] ((((((0+4)+5)+8)+10)+14)+20) = > ((((((0+4)+5)+8)+10)+14)+20) this computation in the accumulator argument won't be evaluated until you try to print it or something, which will reduce it and perform the computation. this means that for a list of length n, the the sum computation will grow in size O(n). what you need is to make sure that the computation is done strictly and that is done using seq or $!, as in: > sum2 [] acc = acc > sum2 (x:xs) acc = sum2 xs $! (acc+x) this means that "acc+x" will be computed at each step, so the accumulator will hold only the integer (or whatever type) and not the thunk (the computation). the type of "$!" is the same as "$": > $! :: (a -> b) -> a -> b the sematics of $! are: > f $! a = f a but the difference is that $! causes "a" to be reduced completely, so it won't build a huge thunk. at least that's my understanding; i'm willing to be corrected :) - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On 11 Mar 2002, Jyrinx wrote: > > > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > > > White -> countAll' cs 1 nl nw (nc + 1) > > > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) > > > > > > make this something like > > > > ... > > > > Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' > > White -> nc' `seq` countAll' cs 1 nl nw nc' > > Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' > > where nw' = nw + newWord > > nc' = nc + 1 > > nl' = nl + 1 > > Cool! That did the trick ... (runs on very little memory *and* time now > ... very cool) I've read through the other responses (thanks all!), and > I'm still not exactly sure what's going on ... I'm relatively new to > Haskell, and my understanding of laziness is hardly rigorous; in > general, how should I know where I need to use seq, and what I need to > use it on? Is there a paper I should read? (I've got Hudak's book, but > it does everything lazily IIRC) > > Jyrinx > jyrinx_list@mindspring.com > From awfurtado@uol.com.br Tue Mar 12 20:16:29 2002 From: awfurtado@uol.com.br (Andre W B Furtado) Date: Tue, 12 Mar 2002 17:16:29 -0300 Subject: uniqueness typing Message-ID: <006601c1ca02$d32a61c0$2e30e3c8@windows9> I found the following text when visiting the Clean (a functional language) site: "Clean is the only functional language in the world which has a special type system, uniqueness typing. It enables to update function arguments destructively retaining the purity of the language." Then I have some questions: 1. Can anyone explain what does "update function arguments destructively" mean? 2. If this is a desirable thing, why does Haskell not implement it? Thanks, -- Andre From dgharrin@ucalgary.ca Tue Mar 12 22:52:29 2002 From: dgharrin@ucalgary.ca (Dana Harrington) Date: Tue, 12 Mar 2002 15:52:29 -0700 Subject: uniqueness typing References: <006601c1ca02$d32a61c0$2e30e3c8@windows9> Message-ID: <3C8E86AD.2000801@ucalgary.ca> Andre W B Furtado wrote: > I found the following text when visiting the Clean (a functional language) > site: > > "Clean is the only functional language in the world which has a special type > system, uniqueness typing. It enables to update function arguments > destructively retaining the purity of the language." I believe Mercury borrowed their uniqueness type (mode) system from Clean. But since Mercury is functional/logical then I guess its still true that Clean is the only functional language with a uniqueness type system. > Then I have some questions: > 1. Can anyone explain what does "update function arguments destructively" > mean? Uniquely typed values are guaranteed to be referenced at most once under program evaluation, these values can be modified in-place. As an example, suppose I have an array and I want to modify an element. In general I need to create a whole new copy of the array in order to make the modification since there may be other places in the program that require access to the old array. However, if I know that the old array has no other references (because the array has a unique type) then I do not need to make a copy, I can just modify the original array. This has obvious efficiency benefits. > 2. If this is a desirable thing, why does Haskell not implement it? - Uniqueness types, of course, require replacing the type system, this is a non-trivial task, - Destructive updates can already be accomplished with compiler supported libraries using monads, - Uniqueness types invalidate some program transformations. On the other hand I think uniqueness types are quite useful. Particularly as they allow much more flexible interaction between mutable data-structures than monadic approaches. I don't know of any concrete reasons a uniqueness type system couldn't be added to Haskell. This seems like a fine time to insert a plug for my Master's thesis, which describes a denotational semantics of uniqueness types: http://www.cpsc.ucalgary.ca/~danaha/uniqueness-types.ps Dana From christine@ema.trafficmagnet.net Tue Mar 12 23:41:33 2002 From: christine@ema.trafficmagnet.net (Christine Hall) Date: Wed, 13 Mar 2002 07:41:33 +0800 (CST) Subject: TrafficMagnet - Special Offer! Message-ID: <18CR1000101633@emaserver.trafficmagnet.net> --1264473606.1015976493000.JavaMail.SYSTEM.emaserver Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ReplyTo:"Christine Hall" Hi! Did you know that 85% of your potential customers will be using search engines to find what they are looking for on the Internet? Have you ever thought about getting your website listed on search engines worldwide? TrafficMagnet offers a unique technology that will submit your website to over 300,000 search engines and directories every month. We can help your customers find you! Submit your website to more than 300,000 search engines and directories http://haskell.org Normal Price: $14.95 per month Special Price: $9.95 per month You Save: more than 30% off Sign up today at http://www.trafficmagnet.net Benefit now! It's easy, it's affordable and you can sign up online. I look forward to hearing from you. Best Regards, Christine Hall Sales and Marketing E-mail: christine@trafficmagnet.net http://www.TrafficMagnet.net --1264473606.1015976493000.JavaMail.SYSTEM.emaserver Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Hi!

Did you know that 85% of your potential customers will be using search engines to find what they are looking for on the Internet? Have you ever thought about getting your website listed on search engines worldwide?

TrafficMagnet offers a unique technology that will submit your website to over 300,000 search engines and directories every month. We can help your customers find you!

Normal Price: $14.95 per month
Special Price: $9.95 per month
You Save: More than 30% off
 
Get Started Today
Learn More
Benefit now!
It's easy, it's affordable and you can sign up online.
I look forward to hearing from you.

Best Regards,

Christine Hall
Sales and Marketing
E-mail: christine@trafficmagnet.net
http://www.TrafficMagnet.net

This email was sent to haskell@haskell.org.
We understand you may wish NOT to receive information from us by eMail.
To be removed from this and other offers, simply click here.
. --1264473606.1015976493000.JavaMail.SYSTEM.emaserver-- From hdaume@ISI.EDU Wed Mar 13 00:28:37 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Tue, 12 Mar 2002 16:28:37 -0800 (PST) Subject: Isn't this tail recursive? In-Reply-To: Message-ID: Oops, I made a false statement: > > f $! a = f a > > but the difference is that $! causes "a" to be reduced completely, so it > won't build a huge thunk. This isn't true. $! will only perform one reduction, so for instance: > id $! (a+1,b+1) will not cause a+1 and b+1 to be calculated; it will only perform the computation which creates the tuple. similarly, > id $! [a+5] will not cause a+5 to be calculated, it will only result in the list being created (i.e., reduced from a computation which will compute [a+5] to simply the value [a+5]). if you want what i was talking about, use the DeepSeq module (http://www.isi.edu/~hdaume/haskell/Util/DeepSeq.hs) and then you can write: > id $!! [a+5] which will actually perform the calculation. - Hal From sqrtofone@yahoo.com Wed Mar 13 01:06:28 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Tue, 12 Mar 2002 19:06:28 -0600 (CST) Subject: Isn't this tail recursive? In-Reply-To: Message-ID: On Tue, 12 Mar 2002, Hal Daume III wrote: > Here's the basic idea. Suppose we have the function: > > > sum [] acc = acc > > sum (x:xs) acc = sum xs (acc+x) > > This is tail recursive, but not strict in the accumulator argument. What > this means is that the computation will be performed lazily, so sum > [4,5,8,10,14,20] 0 will go like this: > > > sum [4,5,8,10,14,20] 0 = > > sum [5,8,10,14,20] (0+4) = > > sum [8,10,14,20] ((0+4)+5) = > > sum [10,14,20] (((0+4)+5)+8) = > > sum [14,20] ((((0+4)+5)+8)+10) = > > sum [20] (((((0+4)+5)+8)+10)+14) = > > sum [] ((((((0+4)+5)+8)+10)+14)+20) = > > ((((((0+4)+5)+8)+10)+14)+20) > > this computation in the accumulator argument won't be evaluated until you > try to print it or something, which will reduce it and perform the > computation. this means that for a list of length n, the the sum > computation will grow in size O(n). what you need is to make sure that > the computation is done strictly and that is done using seq or $!, as in: > > > sum2 [] acc = acc > > sum2 (x:xs) acc = sum2 xs $! (acc+x) > > this means that "acc+x" will be computed at each step, so the accumulator > will hold only the integer (or whatever type) and not the thunk (the > computation). > > the type of "$!" is the same as "$": > > > $! :: (a -> b) -> a -> b > > the sematics of $! are: > > > f $! a = f a > > but the difference is that $! causes "a" to be reduced completely, so it > won't build a huge thunk. I hate to say it, but my understanding of it is that it isnt so simple (which could be good or bad depending upon your view). I guess he best i can describe it is that it will force a to weak head normal form (which is the same as being reduced completely for expressions with only integers, or whatever...) For instance, forcing x=(map f) $! [1..] will essentially force [1.. to (1: (thunk generating [2..]) just before the (map f) is applied. I think. Ok maybe that was a bad example but I can't really think of a good one right now. You might add something that it isn't the (+) operator thats generating the thunks. It is the fact (and only this!) that (+) isn't being forced. I always got confused how (+) could be strict in both arguments, at least for the primitives Float, Integer, and the like, yet still apparently generate a bunch of thunks, like in your expression ((((((0+4)+5)+8)+10)+14)+20). Appearances can be deceiving. But, once that outermost expression is forced, the forcing moves down toward the innermost expression and then the whole expression implodes into a value. I guess the confusion was I somehow conjectured that the application of a strict function to a value would cause haskell to apply that function strictly, when in fact it should not and does not and I was plainly wrong. Here is a short "proof" bottom::[Int] bottom=bottom --bottom = _|_ y = const 3 -- const v = \x -> v main=print (y (head bottom)) If my conjecture was right, main would not terminate. (head is a strict function being applied to _|_ ). However we know that since y = \x -> 3, y will not force x, therefore main will print 3. However... all one needs to do is to change the above to. main=print (y $! (head bottom)) _|_ should be, propagated to main by the following deductions: head _|_ = _|_, y $! _|_ = _|_, print _|_ = _|_. thus main = _|_. Ooh, interesting. I tried that in ghc 5.00 and in fact ghc is smart enough to detect bottom here! It says >[jay@localhost haskell]$ ./a.out > >Fail: <> awesome! I feel like I am rambling to no end. alright. I hope I haven't been too confusing here. All in all I do like your explanation though. Oh, and after I went to the trouble to write this, I see that you did correct yourself. All my work all for naught! Maybe somebody will get something from my ramblings. Thanks, Jay Cox From reid@cs.utah.edu Wed Mar 13 03:09:48 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 13 Mar 2002 03:09:48 +0000 Subject: HGL ang GHC on Win32 In-Reply-To: References: Message-ID: > When I compile a program using GHC 5.02.2 on Windows 200 using HGL, I don't have GHC installed on my Windows partition (nor space for it, I suspect) so I'll ask some questions and hope they suggest an answer. Does it work ok using Hugs and HGL? Sigbjorn Finne did a great job of packaging both Hugs and HGL as .msi files so it should be quick to check. Be sure to use December 2002 Hugs and version 2.0.4 HGL (i.e., the versions currently on the web pages. Any luck using ghci? (Unlikely to be any better) Does rebooting your machine help? (This is one of the larger straws I'm going to grasp at.) > when I run the exe, the window starts out initially as wide as my > screen and only as tall as the title bar, regardless of what is > passed as the dimensions to openWindow. What gives? I haven't heard of this before. A quick glance at the code doesn't suggest anything. Grasping at straws, here's an implausible story for what is going wrong (doesn't suggest how it would work for other people but not for you): If you use openWindow, the position on the screen is not specified (just the size). In Haskell, this is expressed as Nothing but in (this corner of) the Win32 API, it is expressed by specifying -1 for the X and Y position. It is just possible that something has gone wrong in how that -1 is passed over from Haskell to C and that this has somehow gotten confused with the window size. You could test this implausible theory by changing the openWindow call in HelloWorld to read w <- openWindowEx "Hello World Window" (Just (100,100)) (300, 300) Unbuffered Nothing > If I resize the window everything works fine, but in my own > application resizing the window causes it to report some error about > arithmetic being bigger than 32 bits... This might agree with my theory about -1's being passed around. The -1 might somehow come back as the maximum unsigned int 0xffffffff and almost any arithmetic operation on that would lead to overflow. Except that GHC doesn't detect overflow... > Any ideas? No good ones. I'm hoping that a GHC honcho will say "Well of course that happens with 5.02.2 - you should upgrade to 5.03 right away." or some such. Sorry I can't be more help, Alastair Reid From jyrinx_list@mindspring.com Wed Mar 13 03:52:40 2002 From: jyrinx_list@mindspring.com (Jyrinx) Date: 12 Mar 2002 19:52:40 -0800 Subject: Isn't this tail recursive? In-Reply-To: References: Message-ID: <1015991561.11321.2.camel@kryptonitespoon.maurers> Aha! Gotcha. Thanks for the explanation. I suppose that, in general, for tail recursion to work right, the accumulator has to be evaluated strictly (as is how my code was fixed)? Jyrinx jyrinx_list@mindspring.com On Tue, 2002-03-12 at 09:34, Hal Daume III wrote: > Here's the basic idea. Suppose we have the function: > > > sum [] acc = acc > > sum (x:xs) acc = sum xs (acc+x) > > This is tail recursive, but not strict in the accumulator argument. What > this means is that the computation will be performed lazily, so sum > [4,5,8,10,14,20] 0 will go like this: > > > sum [4,5,8,10,14,20] 0 = > > sum [5,8,10,14,20] (0+4) = > > sum [8,10,14,20] ((0+4)+5) = > > sum [10,14,20] (((0+4)+5)+8) = > > sum [14,20] ((((0+4)+5)+8)+10) = > > sum [20] (((((0+4)+5)+8)+10)+14) = > > sum [] ((((((0+4)+5)+8)+10)+14)+20) = > > ((((((0+4)+5)+8)+10)+14)+20) > > this computation in the accumulator argument won't be evaluated until you > try to print it or something, which will reduce it and perform the > computation. this means that for a list of length n, the the sum > computation will grow in size O(n). what you need is to make sure that > the computation is done strictly and that is done using seq or $!, as in: > > > sum2 [] acc = acc > > sum2 (x:xs) acc = sum2 xs $! (acc+x) > > this means that "acc+x" will be computed at each step, so the accumulator > will hold only the integer (or whatever type) and not the thunk (the > computation). > > the type of "$!" is the same as "$": > > > $! :: (a -> b) -> a -> b > > the sematics of $! are: > > > f $! a = f a > > but the difference is that $! causes "a" to be reduced completely, so it > won't build a huge thunk. > > at least that's my understanding; i'm willing to be corrected :) > > - Hal > > -- > Hal Daume III > > "Computer science is no more about computers | hdaume@isi.edu > than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume > > On 11 Mar 2002, Jyrinx wrote: > > > > > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > > > > White -> countAll' cs 1 nl nw (nc + 1) > > > > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) > > > > > > > > > make this something like > > > > > > ... > > > > > > Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' > > > White -> nc' `seq` countAll' cs 1 nl nw nc' > > > Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' > > > where nw' = nw + newWord > > > nc' = nc + 1 > > > nl' = nl + 1 > > > > Cool! That did the trick ... (runs on very little memory *and* time now > > ... very cool) I've read through the other responses (thanks all!), and > > I'm still not exactly sure what's going on ... I'm relatively new to > > Haskell, and my understanding of laziness is hardly rigorous; in > > general, how should I know where I need to use seq, and what I need to > > use it on? Is there a paper I should read? (I've got Hudak's book, but > > it does everything lazily IIRC) > > > > Jyrinx > > jyrinx_list@mindspring.com > > > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From lisper@it.kth.se Wed Mar 13 08:12:04 2002 From: lisper@it.kth.se (Bjorn Lisper) Date: Wed, 13 Mar 2002 09:12:04 +0100 (MET) Subject: Isn't this tail recursive? In-Reply-To: (message from Hal Daume III on Tue, 12 Mar 2002 09:34:47 -0800 (PST)) References: Message-ID: <200203130812.JAA08139@ripper.it.kth.se> Hal Daume III: >Here's the basic idea. Suppose we have the function: > >> sum [] acc = acc >> sum (x:xs) acc = sum xs (acc+x) > >This is tail recursive, but not strict in the accumulator argument. ... Just a nitpick here. sum is indeed strict in its second argument (given that (+) is strict in its first argument). That is, sum l _|_ = _|_ for all possible lists l. It is of course possible that the compiler you use does not detect this and generates nonstrict code. But I think a decent strictness analyzer should detect this. Can the problem be that + is overloaded in Haskell, so the compiler cannot assume any semantical properties like strictness for it? Björn Lisper From simonmar@microsoft.com Wed Mar 13 11:12:38 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 13 Mar 2002 11:12:38 -0000 Subject: HGL ang GHC on Win32 Message-ID: <9584A4A864BD8548932F2F88EB30D1C608973B5C@TVP-MSG-01.europe.corp.microsoft.com> > I'm hoping that a GHC honcho will say=20 >=20 > "Well of course that happens with 5.02.2 - you should=20 > upgrade to 5.03 right away." >=20 > or some such. I'm afraid not :-) But there *is* a bug in the native code generator in 5.02.2, namly in the FFI support for passing floating point arguments to ccalls, which I fixed yesterday and could potentially cause this kind of problem. Make sure the graphics library has been compiled with -fvia-C or -O to work around it (and if this helps, please let us know). Cheers, Simon From robert@TechFak.Uni-Bielefeld.DE Wed Mar 13 17:13:32 2002 From: robert@TechFak.Uni-Bielefeld.DE (Robert Giegerich) Date: Wed, 13 Mar 2002 18:13:32 +0100 Subject: Hugs plugin, Haskell Browser Message-ID: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Teachers in Haskell, I often use Haskell demos in teaching algorithms. The problem is that this does not integrate well with the rest of the material, e.g. lecture notes or slides in PDF or HTML. I'd like to integrate explanations and demos and explorative changes to algorithms. This needs better support. Is there something like a Hugs plugin for Netscape? Is there something like a Haskell source browser producing XML or HTML? Thanks for all hints Robert Giegerich From aegnor@antioch-college.edu Wed Mar 13 20:19:51 2002 From: aegnor@antioch-college.edu (Abraham Egnor) Date: Wed, 13 Mar 2002 15:19:51 -0500 (EST) Subject: Hugs plugin, Haskell Browser In-Reply-To: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Message-ID: Vim can produce HTML from any source code it has highlighting rules for, which includes Haskell. Dunno about the browser plugin, though. Abe On Wed, 13 Mar 2002, Robert Giegerich wrote: > Teachers in Haskell, > > I often use Haskell demos in teaching algorithms. The problem is that this > does not integrate well with the rest of the material, e.g. lecture > notes or slides in PDF or HTML. I'd like to integrate explanations and > demos and explorative changes to algorithms. This needs better support. > > Is there something like a Hugs plugin for Netscape? > > Is there something like a Haskell source browser producing XML or HTML? > > Thanks for all hints > > Robert Giegerich > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From hdaume@ISI.EDU Wed Mar 13 20:45:06 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 13 Mar 2002 12:45:06 -0800 (PST) Subject: HGL ang GHC on Win32 In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C608973B5C@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: That is a shame. I tried both suggestions (specifying position explicitly and recompiling with fvia-c -- i had been using O all along) and neither worked :(. I also tried using 5.03, and got the following warnings: ghc.exe: chasing modules from: HelloWorld.hs Compiling GraphicsFlag ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFlag.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFlag.o ) Compiling GraphicsUtilities ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtilit ies.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtilities.o ) Compiling GraphicsTypes ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTypes.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTypes.o ) Compiling GraphicsRegion ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsRegion. hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsRegion.o ) Compiling GraphicsBrush ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBrush.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBrush.o ) Compiling GraphicsFont ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFont.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFont.o ) Compiling GraphicsPen ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPen.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPen.o ) Compiling GraphicsDraw ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsDraw.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsDraw.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `GraphicsDraw_lvl_fast1' : C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:59: warning: implicit declaration of function `prim_rgb' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sc2l_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:1070: warning: implicit declaration o f function `prim_createCompatibleDC' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:1070: warning: assignment makes point er from integer without a cast Compiling GraphicsBitmap ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBitmap. hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBitmap.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sf06_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:652: warning: implicit declaration of function `prim_free' Compiling GraphicsPicture ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPicture .hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPicture.o ) Compiling GraphicsText ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsText.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsText.o ) Compiling GraphicsKey ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsKey.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsKey.o ) Compiling GraphicsEvent ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvent.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvent.o ) Compiling GraphicsEvents ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvents. hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvents.o ) Compiling GraphicsWND ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWND.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWND.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suYv_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:881: warning: implicit declaration of function `prim_dispatchMessage' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suYu_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:918: warning: implicit declaration of function `prim_translateMessage' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suZz_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:2033: warning: implicit declaration o f function `prim_showWindow' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sv08_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:2315: warning: implicit declaration o f function `prim_free' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sv06_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:2334: warning: implicit declaration o f function `prim_endPaint' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suZv_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:4248: warning: implicit declaration o f function `prim_registerClass' Compiling GraphicsWindows ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWindows .hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWindows.o ) Compiling GraphicsTime ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTime.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTime.o ) c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTime.hs:1: Warning: The export item `Time(..)' suggests that `Time' has constructor or class methods but it has none; it is a type synonym or abstract type or class Compiling GraphicsCore ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsCore.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsCore.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sylv_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:550: warning: implicit declaration of function `prim_deleteFont' Compiling GraphicsUtils ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtils.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtils.o ) Compiling Main ( HelloWorld.hs, ./HelloWorld.o ) ghc: linking ... all of which scares me, and now no window even pops up :) sigh. - hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On Wed, 13 Mar 2002, Simon Marlow wrote: > > I'm hoping that a GHC honcho will say > > > > "Well of course that happens with 5.02.2 - you should > > upgrade to 5.03 right away." > > > > or some such. > > I'm afraid not :-) But there *is* a bug in the native code generator in > 5.02.2, namly in the FFI support for passing floating point arguments to > ccalls, which I fixed yesterday and could potentially cause this kind of > problem. Make sure the graphics library has been compiled with -fvia-C > or -O to work around it (and if this helps, please let us know). > > Cheers, > Simon > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From reid@cs.utah.edu Wed Mar 13 22:50:31 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 13 Mar 2002 22:50:31 +0000 Subject: Hugs plugin, Haskell Browser In-Reply-To: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Message-ID: > Is there something like a Hugs plugin for Netscape? We used to have one at Yale. Can't remember what happened to it so I'm adding John Peterson to the address list in case he can remember. -- Alastair Reid Reid Consulting (UK) Ltd From hdaume@ISI.EDU Thu Mar 14 02:15:56 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 13 Mar 2002 18:15:56 -0800 (PST) Subject: un-layout program Message-ID: does there exist a program that'll take a layed out haskell program and output one that uses braces and semis to delimit? - hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume From chak@cse.unsw.edu.au Thu Mar 14 04:05:34 2002 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Thu, 14 Mar 2002 15:05:34 +1100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Message-ID: <20020314150534U.chak@cse.unsw.edu.au> "Robert Giegerich" wrote, > I often use Haskell demos in teaching algorithms. The problem is that this > does not integrate well with the rest of the material, e.g. lecture > notes or slides in PDF or HTML. I'd like to integrate explanations and > demos and explorative changes to algorithms. This needs better support. > > Is there something like a Hugs plugin for Netscape? What I am doing is to run XEmacs and a PostScript previewer (with the slides) on two different virtual desktops. I can switch between both desktops with a single keystroke. In XEmacs, I am using the Haskell mode from http://haskell.org/haskell-mode/ It does markup Haskell code quite nicely using colour and allows me to run GHCi as a background process - ie, my XEmacs window is split into two halfs with the font-locked source on top and my GHCi session on the bottom. In the first year programming course that I teach, I always develop and debug programs in front of the class (with maybe some definitions pre-defined for larger examples). In fact, I regard it as a big advantage of using Haskell for first-year teaching that this is possible (it's difficult with a more verbose language). I have run student surveys asking students to comment on the lecture and the feedback has been very positive. In fact, the vast majority of students has rated the described approach as by far superior to the traditional chalk&talk approach. > Is there something like a Haskell source browser producing XML or HTML? Again, XEmacs with the above mentioned Haskell mode can do it. Just execute the function `htmlize-buffer' on a buffer containing the Haskell source. As an example for the generated output, have a look at http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML (eg, as part of a Makefile), but I haven't actually used it that way yet. Cheers, Manuel PS: I am doing all this on a laptop running Linux, but I think the virtually same setup should be possible on a Win32 box as XEmacs is available for that platform, too. From sqrtofone@yahoo.com Thu Mar 14 04:47:18 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Wed, 13 Mar 2002 22:47:18 -0600 (CST) Subject: Strictness (was: Is this tail recursive?) In-Reply-To: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: On Wed, 13 Mar 2002, Bjorn Lisper wrote: > Hal Daume III: > >Here's the basic idea. Suppose we have the function: > > > >> sum [] acc = acc > >> sum (x:xs) acc = sum xs (acc+x) > > > >This is tail recursive, but not strict in the accumulator argument. > ... > > Just a nitpick here. sum is indeed strict in its second argument (given that > (+) is strict in its first argument). That is, sum l _|_ = _|_ for all > possible lists l. Do you really know that? all you know is (+):: Num a => a -> a -> a therefore sum :: Num a => [a] -> a -> a now, for any conceivable sum, you generally need both arguments to compute it (or am I wrong?), so i guess you could say (+) should probably be strict for both arguments. But how would you tell the compiler that? oh wait. . o O 0 church numerals... peano numerals.... data Peano = Zero | Succ (Peano) sumpeano blah (Succ x) = sumpeano (Succ blah) x sumpeano blah Zero = blah sumpeano not strict on first argument. define instance Num for Peano. I dont even know if you could talk about strictness in either argument with church numerals. (and I'm to lazy to remind myself what a church numeral looks like precisely so that I could find out.) Perhaps what could be done about this strictness business is to make a kind of strictness annotation. Perhaps something that says (force the second argument of function F before every call to F (including any time F calls itself)). Then perhaps one could define a strict_foldl = foldl but the strictness annotations basically "inserts" the proper seq expression or $! into the redefinition of foldl. here's a rough example. !a mean !a will be forced at its application (for not knowing proper language to call it). strict_foldl :: (a -> b -> a) -> !a -> [b] -> a strict_foldl = foldl of course, there has to be a number of things that must be propagated whence you start adding these things. like for instance. if f:: !a ->b ->c f x y = .... then (flip f) should have type b ->!a ->c and then there might be times when you want to ah, lazify, a strict function. maybe that would be taken care of by giving the type without the strictness annotation (explicitly giving the type but removing all "!") How about it? Has there been any other proposals? (like maybe going as far as a "Strictness Type" system?) Thanks, Jay Cox P.S. I do wonder if my message will even get to Björn Lisper. His mailserver apparently dumps anything sent with a yahoo.com in the From: header. (and unfortunately given how much spam comes from yahoo I can see why). From ketil@ii.uib.no Thu Mar 14 07:02:32 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 14 Mar 2002 08:02:32 +0100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020314150534U.chak@cse.unsw.edu.au> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: "Manuel M. T. Chakravarty" writes: > The detailed choice of colours is, of course, adjustable. > At least on a Unix machine, I am quite sure you can use > XEmacs also in batch mode to generate the HTML Sure. Have a look at -batch, -f and -eval options. Be prepared for a bit of lag at startup though :-) -kzm -- If I haven't seen further, it is by standing in the footprints of giants From mvelev@ece.gatech.edu Thu Mar 14 08:33:40 2002 From: mvelev@ece.gatech.edu (mvelev@ece.gatech.edu) Date: Thu, 14 Mar 2002 03:33:40 -0500 (EST) Subject: Final CFP: MTV'02 deadline on March 25 Message-ID: <200203140833.g2E8Xe9m010772@yamsrv3.ece.gatech.edu> Call for Papers ===================================================================== Microprocessor Test and Verification (MTV'02) June 6-7, 2002, Austin, Texas, USA http://ece.tamu.edu/MTV/ ===================================================================== Submission deadline: March 25, 2002 Sponsored by: IEEE Computer Society Test Technology Technical Council General Chair: Magdy S. Abadir (abadir@ibmoto.com), Motorola Program Chair: Li-C. Wang (licwang@ece.ucsb.edu), UCSB Areas of Interest: -Validation of microprocessors -Experiences on test and verification of high performance processors -Test/verification of multimedia processors -Performance testing -High-level test generation for functional verification -Emulation techniques -Silicon debugging -Formal techniques and their applications -Verification coverage -Test generation at the transistor level -Equivalence checking of custom circuits at the transistor level -Circuit level verification -Switch-level circuit modeling -Timing verification techniques -Path analysis for verification or test -Design error models -Design error diagnosis -Design for testability or verifiability -Optimizing SAT procedures for application to testing and formal verification From d95mback@dtek.chalmers.se Thu Mar 14 09:09:29 2002 From: d95mback@dtek.chalmers.se (Martin =?ISO-8859-1?Q?Norb=E4ck?=) Date: 14 Mar 2002 10:09:29 +0100 Subject: Hugs plugin, Haskell Browser In-Reply-To: References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: <1016096969.4469.4.camel@caesar.safelogic.se> tor 2002-03-14 klockan 08.02 skrev Ketil Z. Malde: > "Manuel M. T. Chakravarty" writes: > > > The detailed choice of colours is, of course, adjustable. > > At least on a Unix machine, I am quite sure you can use > > XEmacs also in batch mode to generate the HTML > > Sure. Have a look at -batch, -f and -eval options. Be prepared for a > bit of lag at startup though :-) Enscript has support for coloring Haskell and outputting html: enscript --language=html --pretty-print=haskell --color --output=- --output=- is for stdout You could easily invoke it from a cgi-script. Regards, Martin -- [ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ] Opinions expressed above are mine, and not those of my future employees. SIGBORE: Signature boring error, core dumped From Andrew.Butterfield@cs.tcd.ie Thu Mar 14 10:27:41 2002 From: Andrew.Butterfield@cs.tcd.ie (Andrew Butterfield) Date: Thu, 14 Mar 2002 10:27:41 +0000 Subject: Strictness (was: Is this tail recursive?) In-Reply-To: References: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: <5.1.0.14.0.20020314102524.00a23010@mail.cs.tcd.ie> At 22:47 13/03/02 -0600, Jay Cox wrote: >Perhaps what could be done about this strictness business is to make a >kind of strictness annotation. Perhaps something that says (force the >second argument of function F before every call to F (including any time F >calls itself)). >... >here's a rough example. !a mean !a will be forced at its application (for >not knowing proper language to call it). > >strict_foldl :: (a -> b -> a) -> !a -> [b] -> a >strict_foldl = foldl > >of course, there has to be a number of things that must be propagated >whence you start adding these things. like for instance. >.... >How about it? Has there been any other proposals? (like maybe going as >far as a "Strictness Type" system?) I think the Clean type system does stuff like this - it certainly supports strictness analysis and annotations: - see http://www.cs.kun.nl/~clean/ for more details >_______________________________________ >Haskell mailing list >Haskell@haskell.org >http://www.haskell.org/mailman/listinfo/haskell ------------------------------------------------------------------------ Dr. Andrew Butterfield (http://www.cs.tcd.ie/Andrew.Butterfield/) Course Director, B.A. (Mod.) Information & Communications Technology Dept.of Computer Science, Trinity College, Dublin University Tel: +353-1-608-2517, Fax: +353-1-677-2204 ------------------------------------------------------------------------ From simonmar@microsoft.com Thu Mar 14 11:22:25 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 14 Mar 2002 11:22:25 -0000 Subject: un-layout program Message-ID: <9584A4A864BD8548932F2F88EB30D1C608973F0C@TVP-MSG-01.europe.corp.microsoft.com> > does there exist a program that'll take a layed out haskell=20 > program and > output one that uses braces and semis to delimit? You can use GHC's hssource package to parse & then pretty-print the source code - the pretty printer can generate output with explicit layout tokens if you ask for it. The documentation is a bit lacking (well, there isn't any), so grab the source or browse it on the web here: http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/hssource/ Cheers, Simon From j_kops@hotmail.com Thu Mar 14 12:45:39 2002 From: j_kops@hotmail.com (jeroen kops) Date: Thu, 14 Mar 2002 13:45:39 +0100 Subject: which to download for SuSE7.0 Message-ID: Can I use hugs98 on mij Linux SuSE7.0 computer? If the awnser is yes, which files do I have to download? Greetings, J. Kops Student University Utrecht (The Netherlands) _________________________________________________________________ Download MSN Explorer gratis van http://explorer.msn.nl/intl.asp. From =?EUC-KR?B?waTBvrHm?=" Hi!!! ^^
I am a student who study a computer programing.
I want to have Haskell software to study .
However, it is very hard to get the Haskell . and I hope you give me the way to get the Heskell.
If you mail me to show the way to get the Heskell , I would appreciate your kindness.
Thank you!! ^^
  Á¤Á¾±æ  
   


"¿ì¸® ÀÎÅͳÝ, Daum" http://www.daum.net


  ¹«·á°ÔÀÓ + ÄûÁî¿Õ µµÀü±îÁö! ½Å³ª´Â ¿ì¸® °×õ±¹~
  ¢Ñ Daum°ÔÀÓÀ¸·Î ¹Ù·Î°¡±â
From afie@cs.uu.nl Thu Mar 14 13:18:14 2002 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Thu, 14 Mar 2002 14:18:14 +0100 Subject: For the Heskell References: <20020314214723.HM.F0000000003Vgjc@www16.hanmail.net> Message-ID: <00fe01c1cb5a$b2de8ff0$ec50d383@sushi> Hi, Hugs (a Haskell interpreter) can be downloaded at http://cvs.haskell.org/Hugs/pages/downloading.htm Arjan From afie@cs.uu.nl Thu Mar 14 13:22:28 2002 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Thu, 14 Mar 2002 14:22:28 +0100 Subject: which to download for SuSE7.0 References: Message-ID: <010401c1cb5b$49d087b0$ec50d383@sushi> Hi Jeroen, > Can I use hugs98 on mij Linux SuSE7.0 computer? I think you can. Download hugs98-Dec2001.tar.gz under Generix Unix at http://cvs.haskell.org/Hugs/pages/downloading.htm and compile it yourself. How to do this, can be found in the file "Install" inside the archive. Greetings, Arjan van IJzendoorn From franka@cs.uu.nl Thu Mar 14 16:14:19 2002 From: franka@cs.uu.nl (Frank Atanassow) Date: Thu, 14 Mar 2002 17:14:19 +0100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020314150534U.chak@cse.unsw.edu.au>; from chak@cse.unsw.edu.au on Thu, Mar 14, 2002 at 03:05:34PM +1100 References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: <20020314171419.B511@cs.uu.nl> "Robert Giegerich" wrote, > I often use Haskell demos in teaching algorithms. The problem is that this > does not integrate well with the rest of the material, e.g. lecture > notes or slides in PDF or HTML. I'd like to integrate explanations and > demos and explorative changes to algorithms. This needs better support. > > Is there something like a Hugs plugin for Netscape? Is DVI OK? The Active-DVI package http://pauillac.inria.fr/activedvi/ allows embedding programs into DVI files, along with a host of other features for presentations (effects, links, transitions, ...). If you look at the demo included with the distribution you will see a slide with a copy of the Ocaml interpreter running inside a DVI page. Files using ActiveDVI specials are still viewable with, for example, xdvi, but of course most of the features are absent or mangled. -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379 From simonmar@microsoft.com Thu Mar 14 17:27:27 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 14 Mar 2002 17:27:27 -0000 Subject: HGL ang GHC on Win32 Message-ID: <9584A4A864BD8548932F2F88EB30D1C60897405B@TVP-MSG-01.europe.corp.microsoft.com> > That is a shame. I tried both suggestions (specifying=20 > position explicitly > and recompiling with fvia-c -- i had been using O all along)=20 > and neither > worked :(. >=20 > I also tried using 5.03, and got the following warnings: [ message deleted ] It looks like there are some prototypes missing: > C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:59: warning: implicit > declaration of function `prim_rgb' GHC might not generate correct calls to these functions unless there is a visible prototype. In fact, taking this example, the definition of prim_rgb is DWORD prim_rgb(BYTE arg1,BYTE arg2,BYTE arg3) but its FFI declaration says foreign import ccall "prim_rgb" unsafe prim_rgb :: Word32 -> Word32 -> Word32 -> IO (Word32) this looks a bit strange - is there a green-card expert out there to explain what's going on? Why have the BYTEs been turned into Word32s? Cheers, Simon From max630@mail.ru Thu Mar 14 18:37:16 2002 From: max630@mail.ru (Max Kirillov) Date: Fri, 15 Mar 2002 00:37:16 +0600 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020314150534U.chak@cse.unsw.edu.au>; from chak@cse.unsw.edu.au on Thu, Mar 14, 2002 at 03:05:34PM +1100 References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: <20020315003716.A1621@max.home> On Thu, Mar 14, 2002 at 03:05:34PM +1100, Manuel M. T. Chakravarty wrote: > Again, XEmacs with the above mentioned Haskell mode can do > it. Just execute the function `htmlize-buffer' on a buffer > containing the Haskell source. As an example for the > generated output, have a look at > > http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html > > The detailed choice of colours is, of course, adjustable. > At least on a Unix machine, I am quite sure you can use > XEmacs also in batch mode to generate the HTML (eg, as part > of a Makefile), but I haven't actually used it that way yet. 1. Why CSS? Why did I need to enable Java in my Netscape to see the colours? Man, it's just to _indent_ and _paint_! 2. When I hear "translate to HTML" I imagine that underlined words which can be clicked to see, say, definition of function. Sadly, most htmlizers are focused on highlighting rather than navigation. The good news is that could be simply cured with postprocessing of the resulting html file using tags file. There are several tags generators for haskell, both for vim and emacs (ghc distribution contains 2 of them). So the problem can be "reduced to the already seen". Just today I've found the program which does the job for "vim documentation". It uses vim tags file and 2html.vim script which is in vim package. Though the idea is obvious, I've never seen before anybody think of it (maybe I'm the one who need it?). The program is very short perl script. I'll try to adopt it for common files (so, for the haskell too). The address: http://www.erebus.demon.nl/vim/ > Cheers, > Manuel Max. From C.Reinke@ukc.ac.uk Thu Mar 14 19:29:13 2002 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Thu, 14 Mar 2002 19:29:13 +0000 Subject: Hugs plugin, Haskell Browser In-Reply-To: Message from Max Kirillov of "Fri, 15 Mar 2002 00:37:16 +0600." <20020315003716.A1621@max.home> Message-ID: > 2. When I hear "translate to HTML" I imagine that underlined > words which can be clicked to see, say, definition of > function. Sadly, most htmlizers are focused on highlighting > rather than navigation. Why generate HTML pages if noone reads them?-) Take this obscure location, for instance: http://www.haskell.org/libraries/#docu admittedly, Jan Skibinski's Haskell module browser is currently only available via archives, but it wasn't HTML-based anyway, and the other two links still work. Here's another example of text colouring that can be clicked on (few people do, so it has become quite silent on the mailing list, try the first months for more action..): http://haskell.org/mailman/listinfo/haskelldoc Hth, Claus From matt@immute.net Thu Mar 14 22:29:59 2002 From: matt@immute.net (matt hellige) Date: Thu, 14 Mar 2002 16:29:59 -0600 Subject: Strictness (was: Is this tail recursive?) In-Reply-To: ; from sqrtofone@yahoo.com on Wed, Mar 13, 2002 at 10:47:18PM -0600 References: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: <20020314162959.A16282@metro.immute.net> [Jay Cox ] > > (+):: Num a => a -> a -> a therefore sum :: Num a => [a] -> a -> a > now, for any conceivable sum, you generally need both arguments to compute > it (or am I wrong?), so i guess you could say (+) should probably be > strict for both arguments. But how would you tell the compiler that? > > oh wait. > . o O 0 church numerals... peano numerals.... > > data Peano = Zero | Succ (Peano) > > sumpeano blah (Succ x) = sumpeano (Succ blah) x > sumpeano blah Zero = blah > > sumpeano not strict on first argument. > define instance Num for Peano. > > I dont even know if you could talk about strictness in either argument > with church numerals. (and I'm to lazy to remind myself what a church > numeral looks like precisely so that I could find out.) > i suppose this is getting a bit off-topic, but for any instance of Num with an additive identity, (+) probably doesn't need to be strict for both arguments, right? consider: sum 0 x = x sum x y = x + y if the first argument is 0, we don't need to inspect the second argument at all. if i'm correct, this just reinforces your point... m -- matt hellige matt@immute.net http://matt.immute.net From bhuffman@galois.com Thu Mar 14 23:59:39 2002 From: bhuffman@galois.com (Brian Huffman) Date: Thu, 14 Mar 2002 15:59:39 -0800 Subject: Strictness (was: Is this tail recursive?) Message-ID: <200203142359.g2ENxdY09415@localhost.localdomain> At 22:47 13/03/02 -0600, Jay Cox wrote: >Perhaps what could be done about this strictness business is to make a >kind of strictness annotation. Perhaps something that says (force the >second argument of function F before every call to F (including any time F >calls itself)). >... >here's a rough example. !a mean !a will be forced at its application (for >not knowing proper language to call it). > >strict_foldl :: (a -> b -> a) -> !a -> [b] -> a >strict_foldl = foldl > >of course, there has to be a number of things that must be propagated >whence you start adding these things. like for instance. >.... >How about it? Has there been any other proposals? (like maybe going as >far as a "Strictness Type" system?) In Haskell you can produce the desired behavior by using pattern guards. Since the pattern guards always get evaluated before the result does, they can be used to make things more strict. Here is the foldl example: strict x = seq x True foldl' :: (a -> b -> a) -> a -> [b] -> a foldl' f z [] = z foldl' f z (x:xs) | strict z = foldl' f (f z x) xs You can make multiple arguments strict by using && or similar, e.g.: f x y | strict x && strict y = ... f x y | all strict [x,y] = ... Of course, with the second example x and y must have the same type. Hope this helps. - Brian Huffman From sqrtofone@yahoo.com Fri Mar 15 04:10:22 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Thu, 14 Mar 2002 22:10:22 -0600 (CST) Subject: Strictness (was: Is this tail recursive?) In-Reply-To: <5.1.0.14.0.20020314102524.00a23010@mail.cs.tcd.ie> Message-ID: On Thu, 14 Mar 2002, Andrew Butterfield wrote: > I think the Clean type system does stuff like this - it certainly supports > strictness analysis and annotations: > - see http://www.cs.kun.nl/~clean/ for more details Thanks to both you and to Bernard James POPE for the replies. The embarrasing thing (for me) is that I'm ON the Clean mailing list! I should have known or remembered about clean's strictness annotations, though I really haven't ever coded anything in it. I intend to read anything those Clean(ers) happen to have on the subject. Cheers, Jay Cox PS: While I'm at it thanking people, thanks to Bjorn Lisper for relaying the fact that his server isn't censoring my messages from the haskell lists as well! From sqrtofone@yahoo.com Fri Mar 15 04:23:32 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Thu, 14 Mar 2002 22:23:32 -0600 (CST) Subject: Strictness! In-Reply-To: <200203142359.g2ENxdY09415@localhost.localdomain> Message-ID: On Thu, 14 Mar 2002, Brian Huffman wrote: > In Haskell you can produce the desired behavior by using pattern guards. > Since the pattern guards always get evaluated before the result does, they > can be used to make things more strict. Here is the foldl example: > > strict x = seq x True > > foldl' :: (a -> b -> a) -> a -> [b] -> a > foldl' f z [] = z > foldl' f z (x:xs) > | strict z = foldl' f (f z x) xs > > You can make multiple arguments strict by using && or similar, e.g.: > > f x y | strict x && strict y = ... > f x y | all strict [x,y] = ... > > Of course, with the second example x and y must have the same type. > Hope this helps. > > - Brian Huffman Thanks! that looks like a great haskell idiom to use! Jay Cox From chak@cse.unsw.edu.au Fri Mar 15 04:10:03 2002 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Fri, 15 Mar 2002 15:10:03 +1100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020315003716.A1621@max.home> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> <20020315003716.A1621@max.home> Message-ID: <20020315151003N.chak@cse.unsw.edu.au> Max Kirillov wrote, > On Thu, Mar 14, 2002 at 03:05:34PM +1100, Manuel M. T. Chakravarty wrote: > > Again, XEmacs with the above mentioned Haskell mode can do > > it. Just execute the function `htmlize-buffer' on a buffer > > containing the Haskell source. As an example for the > > generated output, have a look at > > > > http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html > > > > The detailed choice of colours is, of course, adjustable. > > At least on a Unix machine, I am quite sure you can use > > XEmacs also in batch mode to generate the HTML (eg, as part > > of a Makefile), but I haven't actually used it that way yet. > > 1. Why CSS? CSS is fine, ... > Why did I need to enable Java in my Netscape to > see the colours? Man, it's just to _indent_ and _paint_! it is Netscape which is rotten ;-) There is no reason in a Web browser to have to activate extra languages to implement CSS...except bad software design. I'd suggest to get a proper browser like Mozilla http://mozilla.org/ or Galeon http://galeon.sourceforge.net/ (I particularly like the latter.) (Switching on JavaScript is sufficient, btw.) > 2. When I hear "translate to HTML" I imagine that underlined > words which can be clicked to see, say, definition of > function. Sadly, most htmlizers are focused on highlighting > rather than navigation. The good news is that could be > simply cured with postprocessing of the resulting html file > using tags file. There are several tags generators for > haskell, both for vim and emacs (ghc distribution contains 2 > of them). So the problem can be "reduced to the already > seen". It depends what you want. A tool which cross-references variable occurences, I would call a cross reference tool rather than an HTML pretty-printer. Cheers, Manuel From fjh@cs.mu.OZ.AU Fri Mar 15 09:47:49 2002 From: fjh@cs.mu.OZ.AU (Fergus Henderson) Date: Fri, 15 Mar 2002 20:47:49 +1100 Subject: uniqueness typing In-Reply-To: <3C8E86AD.2000801@ucalgary.ca>; from dgharrin@ucalgary.ca on Tue, Mar 12, 2002 at 03:52:29PM -0700 References: <006601c1ca02$d32a61c0$2e30e3c8@windows9> <3C8E86AD.2000801@ucalgary.ca> Message-ID: <20020315204749.A3136@hg.cs.mu.oz.au> On 12-Mar-2002, Dana Harrington wrote: > > I believe Mercury borrowed their uniqueness type (mode) system from > Clean. Nope. The support for unique modes in Mercury was developed before we were aware of Clean. They achieve similar aims, but it's a case of convergent evolution, because we were both trying to solve the same problem, rather than borrowing. (This is in contrast to e.g. Mercury's support for type classes, which was pretty much directly lifted from Haskell.) In fact Clean's support for uniqueness is better than Mercury's. In particular, Clean supports uniqueness polymorphism, whereas Mercury only supports overloading on uniqueness. -- Fergus Henderson | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: | -- the last words of T. S. Garp. From consel@labri.fr Fri Mar 15 09:48:56 2002 From: consel@labri.fr (Charles Consel) Date: Fri, 15 Mar 2002 10:48:56 +0100 Subject: LAST CALL FOR PAPERS: Generators and Components (GCSE/SAIG'02) Message-ID: <3C91C388.4EF9EF98@labri.fr> = LAST CALL FOR PAPERS = Submission Deadline: March 21, 2002 = The First ACM SIGPLAN/SIGSOFT Conference on Generators and Components (GCSE/SAIG'02) = Supported by the National Science Foundation (NSF) Pittsburgh, PA, October 6-8, 2002. = http://www.cs.yale.edu/~taha/gcse-saig/cfp02.html = Invited Speakers: = * Neil Jones, University of Denmark * Catuscia Palamidessi, Penn State University * Janos Sztipanovits, Vanderbilt University = Program generation has the prospect of being an integral part of a wide range of software development processes. Many recent studies investigate different aspects of program generation, including their semantics, their application, and their implementation. Existing theories and systems address both high-level (source) language and low-level (machine) language generation. A number of programming languages now support program generation and manipulation, with different goals, implementation techniques, and targeted at different applications. The goal of this conference is to provide a meeting place for researchers and practitioners interested in this topic. = A particular area of interest is component-based software development, which bears the promise of considerable productivity increases to software development comparable to the introduction of the assembly line in manufacturing. But due to the very same sophistication that makes components useful, their maintenance can be hard. Generative programming presents a promising approach to alleviating the above problems, as changes affecting components can now be more effectively managed during the generation process rather than at the component level. = The goal of this joint event is to foster further cross-fertilization between the software engineering research community on the one hand, and the programming languages community on the other, in addition to supporting the original research goals of both GCSE and SAIG communities. We seek papers both in software engineering and programming languages, and especially those that bridge the gap. Being accessible to both communities at the same time is also valued. = The conference solicits submissions related (but not limited) to: = * Generative Programming: Reuse, meta-programming, partial evaluation, multi-stage and multi-level languages, * Semantics, type systems, symbolic computation, linking and explicit substitution, in-lining and macros, templates, program transformation, * Runtime code generation, compilation, active libraries, synthesis from specifications, development methods, generation of non-code artifacts, formal methods. Reflection. * Component-Based Software Engineering: Reuse, distributed platforms, distributed systems, evolution, analysis and design patterns, development methods, formal methods * Integration of Generative and Component-Based Approaches * Domain Engineering, analysis, and languages * Separation of Concerns: Aspect-Oriented Programming, Intentional * Programming, and Multi-Dimensional Separation of Concerns * Product Lines and generic architectures for that purpose. * Industrial Applications of Components and Generative Programming = Reports on applications of these techniques to real-world problems are especially encouraged, as are submissions that relate ideas and concepts from several of these topics, or bridge the gap between theory and practice. The program committee is happy to advise on the appropriateness of a particular subject. = General Chair: = Walid Taha, Yale University, USA. = Program Chair (GCSE focus): = Don Batory, University of Texas at Austin, USA. = Program Chair (SAIG focus): = Charles Consel, INRIA, LaBRI, France. = Program Committee (GCSE focus): = Jan Bosch , University of Groningen Greg Butler, Concordia University Prem Devanbu, University of California at Davis Cristina Gacek, University of Newcastle upon Tyne Stan Jarzabek, National University of Singapore Kyo Kang, Pohang University of Science and Technology Peter Knauber, Fraunhofer Institute for Experimental Software Engineering Hausi Muller, University of Victoria Nenad Medvidovic, University of Southern California Wolfgang Pree, University of Constance Yannis Smaragdakis, Georgia Institute of Technology Douglas R. Smith , Kestrel Institute = Program Committee (SAIG focus): = Craig Chambers, University of Washington Shigeru Chiba, Tokyo Institute of Technology Pierre Cointe, Ecole des Mines de Nantes Dawson Engler, Stanford University Siau cheng Khoo, National University of Singapore Gregor Kiczales, University of British Columbia Martin Odersky, Ecole Polytechnique F=E9d=E9rale de Lausanne Calton Pu, Georgia Institute of Technology Peter Thiemann, Universit=E4t Freiburg Andrew Tolmach, Portland State University = Submission Details: Authors are invited to submit papers of at most 5000 words (excluding figures), in postscript format (letter or A4), using the electronic submission form by March 21st, 2002. This deadline is firm. Both position and technical papers are welcome (Please indicate at time of submission.) Authors will be notified of acceptance by May 14th, 2002. Final version of the papers must be submitted by July 14, 2002. = Format: The three day conference will contain slots for technical papers (45 minutes) and position papers (30 minutes). Both times include discussion. Position papers are expected to describe important future directions, ongoing work, and survey previous results. This category is best thought of as one for "competitive invited papers". Technical papers are expected to contain novel results. All papers will be reviewed by the program committee for the above-mentioned criteria, in addition to correctness and clarity. Simultaneous submission to other venues is not allowed, as is submission of previously published material. In addition, there will be time allocated for open discussions at the end of the conference. Proceedings will be published as an LNCS volume. = Special Note on Combined Event: While the Program Committee is divided into two focus areas corresponding the parent events (GCSE and SAIG), there will be one unified program committee meeting. At the time of submission, authors must indicate whether they intend the paper for the GCSE audience, SAIG audience, or BOTH. The last category is the default, and is strongly encouraged. Papers submitted explicitly to only one focus will be accepted or rejected by the respective Program Chair. For papers submitted to BOTH, it is enough that one of the two Program Chairs accepts the paper. All members of the PC will allowed to bid for and review all papers, and cross-bidding is encouraged. The conference itself will not be divided along focus lines. Rather, an attempt will be made to ensure that each session is of interest to both parent communities. From simonpj@microsoft.com Fri Mar 15 10:11:13 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 15 Mar 2002 02:11:13 -0800 Subject: ICFP'02: 6 days to go. Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041B2F@RED-MSG-10.redmond.corp.microsoft.com> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Last chance for your ICFP'02 paper: 6 days to go. =20 Don't let me down! Simon =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ICFP 2002 International Conference on Functional Programming October 4-6, 2002, Pittsburgh, USA Final call for papers -------------------------------------------- Submission deadline: 21 March 2002 18:00 UTC -------------------------------------------- Program Chair: Simon Peyton Jones (Microsoft Research) Full call for papers including submission details:=20 http://icfp2002.cs.brown.edu/CfP/ =20 ICFP 2002 seeks original papers on the full spectrum of the art, science, and practice of functional programming. The conference invites submissions on all topics ranging from principles to practice, from foundations to features, and from abstraction to application. The scope covers all languages that encourage programming with functions, including both purely applicative and imperative languages, as well as languages that support objects and concurrency. Topics of interest include, but are not limited to, the following: Foundations: formal semantics, lambda calculus, type theory, monads, continuations, control, state, effects. Design: modules and type systems, concurrency and distribution, components and composition, relations to object-oriented and logic programming, multiparadigm programming. Implementation: abstract machines, compile-time and run-time optimization, just-in-time compilers, memory management, foreign-function and component interfaces. Transformation and analysis: abstract interpretation, partial evaluation, program transformation, theorem proving, specification and verification. Software development techniques for functional programming: design patterns, specification, verification and validation, debugging, test generation, etc. Human productivity of functional programming: visual, graphical (etc) approaches, evaluating language usability, empirical studies of human effectiveness, etc. Applications and domain-specific languages: scientific and numerical computing, symbolic computing and artificial intelligence, systems programming, databases, graphic user interfaces, multimedia programming, Web programming. Practice and experience: functional programming in education and industry, ramifications on other paradigms and computing disciplines. Functional pearls elegant, instructive examples of functional programming. General Chair: Mitchell Wand (Northeastern University) Program Committee Matthias Blume (Lucent)=20 Margaret Burnett (Oregon State University)=20 Manuel Chakravarty (University of New South Wales)=20 Matthew Flatt (University of Utah)=20 Haruo Hosoya (Kyoto University)=20 Uwe Nestmann (EPFL, Lausanne)=20 Chris Okasaki (United States Military Academy)=20 Norman Ramsey (Harvard University)=20 David Sands (Chalmers University)=20 Olin Shivers (Georgia Tech)=20 Stephanie Weirich (Cornell)=20 Joe Wells (Heriot Watt University) From Malcolm.Wallace@cs.york.ac.uk Fri Mar 15 17:42:26 2002 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Fri, 15 Mar 2002 17:42:26 +0000 Subject: ANNOUNCE: Hat 1.12 Message-ID: ------------------------------------ hat-1.12, nhc98-1.12, and hmake-3.02 ------------------------------------ We are pleased to announce a new release of Hat, the Haskell tracing (an debugging) system, together with supporting releases of the nhc98 compiler and the hmake compilation manager. This release of Hat is a major release. It incorporates new trace-browsing tools, and for the first time has support to compile programs for tracing with GHC in addition to nhc98. for information on hat: http://www.cs.york.ac.uk/fp/hat/ for information on nhc98: http://www.cs.york.ac.uk/fp/nhc98/ for information on hmake: http://www.cs.york.ac.uk/fp/hmake/ for downloads: http://www.cs.york.ac.uk/fp/nhc98/download.html (Hat and hmake are packaged together with nhc98 in a single download.) If you haven't already tried out the Hat tracing system, now is a good time to have a go! New features worth noting are: * There is a new tutorial introduction to Hat, showing how to generate program traces, how to explore them, and how they can help you to debug Haskell programs. * All the interactive trace browsing tools are implemented in Haskell, including a new, simpler, textual version of hat-trail. They all inter-operate, and use a similar command syntax. * The trace-generating machinery can now be used with GHC in addition to nhc98: just use `hmake -ghc -hat' instead of `hmake -nhc98 -T'. (However, for the moment, you still need to download and install the nhc98 distribution, even when you intend to trace programs only with GHC.) In addition there have also been many minor bugfixes to nhc98 and hmake. Bug reports should be sent to nhc-bugs@haskell.org. Discussion of the Hat system belongs on nhc-users@haskell.org. Regards, The Hat team at York From ronny@cs.kun.nl Fri Mar 15 18:27:32 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 15 Mar 2002 19:27:32 +0100 Subject: Isn't this tail recursive? In-Reply-To: <1015814162.18982.12.camel@kryptonitespoon.maurers> Message-ID: <5.1.0.14.0.20020315183201.02f3c830@localhost> Another way to evaluate the accumulating counts in each call is to combine them in a data type and use strictness flags for the individual count fields. (See , "Strictness Flags") For example (untested): data Counts = Counts !Int !Int !Int countAll :: String -> Counts countAll str = countAll' str 0 (Counts 0 0 0) // shouldn't this be 1 (start with new word)? where countAll' [] _ counts = counts countAll' (c:cs) newWord (Counts nl nw nc) = case charKind c of Normal -> countAll' cs 0 (Counts nl (nw+newWord) (nc+1)) White -> countAll' cs 1 (Counts nl nw (nc+1)) Newline -> countAll' cs 1 (Counts (nl+1) nw (nc+1)) The function countAll' is now strict in its counts argument. Because of the strictness flags in Counts, each count is evaluated. I think this looks nicer than using local calls to `seq`. Cheers, Ronny Wichers Schreur From ronny@cs.kun.nl Fri Mar 15 18:29:38 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 15 Mar 2002 19:29:38 +0100 Subject: Isn't this tail recursive? In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe .corp.microsoft.com> Message-ID: <5.1.0.14.0.20020315191319.02f20188@localhost> Simon Marlow writes (to the Haskell mailing list) >The function as written is only strict in its list argument, and >its usage site only demands the 'l' argument strictly. So [..] >the compiler can't possibly evaluate the accumulating parameters >of countAll' strictly. The Clean compiler uses an optimisation that works in this case. After observing that main evaluates all elements of the tuple result (because of the shows), the compiler creates a special version of countAll with (Clean) type countAll :: String -> (!Int, !Int, !Int) and the same for countAll`. It than calls the strictness analyzer again for these functions. Cheers, Ronny Wichers Schreur From ronny@cs.kun.nl Fri Mar 15 18:33:50 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 15 Mar 2002 19:33:50 +0100 Subject: Strictness In-Reply-To: <20020314162959.A16282@metro.immute.net> References: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: <5.1.0.14.0.20020315182620.00b08180@localhost> matt hellige writes (to the haskell mailing list): >[..] consider: > sum 0 x = x > sum x y = x + y > >if the first argument is 0, we don't need to inspect the second >argument at all. But sum returns its second argument, so it's still strict in that argument. Cheers, Ronny Wichers Schreur From max630@mail.ru Fri Mar 15 19:27:28 2002 From: max630@mail.ru (Max Kirillov) Date: Sat, 16 Mar 2002 01:27:28 +0600 Subject: Hugs plugin, Haskell Browser In-Reply-To: ; from C.Reinke@ukc.ac.uk on Thu, Mar 14, 2002 at 07:29:13PM +0000 References: Message-ID: <20020316012728.A1165@max.home> On Thu, Mar 14, 2002 at 07:29:13PM +0000, C.Reinke wrote: > >> 2. When I hear "translate to HTML" I imagine that underlined >> words which can be clicked to see, say, definition of >> function. Sadly, most htmlizers are focused on highlighting >> rather than navigation. > > Why generate HTML pages if noone reads them?-) I said "most"! :) (To be honest, I thought about "all") Well, I mostly referred at multi-lingual html grnerators which come with that unix editors. There are alot of xref tools for every given language, but that zoo is quite hard to maintain, if you have to live with, say, 4 languages. Max. From claus.reinke@talk21.com Fri Mar 15 22:05:55 2002 From: claus.reinke@talk21.com (Claus Reinke) Date: Fri, 15 Mar 2002 22:05:55 -0000 Subject: Hugs plugin, Haskell Browser References: <20020316012728.A1165@max.home> Message-ID: <00d501c1cc6d$9513f820$ae1ffea9@Standard> > >> function. Sadly, most htmlizers are focused on highlighting > >> rather than navigation. .. > I said "most"! :) (To be honest, I thought about "all") just wanted to point out that there have been several hyperlinking HTML documentation generators for Haskell (in fact, from memory I'm quite sure there have been more than the two listed:-). > Well, I mostly referred at multi-lingual html grnerators > which come with that unix editors. There are alot of xref > tools for every given language, but that zoo is quite hard > to maintain, if you have to live with, say, 4 languages. Now that is an entirely different problem. As you've mentioned, tags-generators and "syntax" definitions exist for many language/ editor-combinations, so one could indeed imagine having to write only one extra tool per editor. Another option would be literate programming tools with hyperref support. However, much of the discussion surrounding documentation tools has been on what standard formats programmers would have to adopt so that a tool would be able to extract comments and associate them with the correct declarations. Would you hope programmers of different languages/paradigms to agree on such an issue if they cannot even agree on an editor/a language?-) On an unrelated issue, though within the subject: Haskellers using Vim might want to take a sneak preview of a little hack in which I'm using Hugs as a kind of Vim plugin (hopelessly inefficient in theory, but no problem in practice with last year's machines:). a Vim compiler plugin for Hugs (drop in one of Vim's compiler/ directories) http://www.cs.ukc.ac.uk/people/staff/cr3/tmp/hugs.vim its help file (drop in one of Vim's doc/ directories, and regenerate helptags in that directory; then type :help hugs.vim) http://www.cs.ukc.ac.uk/people/staff/cr3/tmp/hugs.txt (pre-release testers and feedback welcome:-) Cheers, Claus -- Research Opportunity: Refactoring Functional Programs (UKC) Closing date: Friday 22 March 2002 !! http://www.cs.ukc.ac.uk/vacancies_dir/r02-24.html From sqrtofone@yahoo.com Sat Mar 16 02:16:49 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Fri, 15 Mar 2002 20:16:49 -0600 (CST) Subject: Strictness In-Reply-To: <5.1.0.14.0.20020315182620.00b08180@localhost> Message-ID: Alright. I know the haskell community probably gets tired of my long winded posts. I This post probably shouldn't even be on haskell@haskell.org (more like on haskell-cafe). I also realize that these posts may not mean much to you; many of you may have figured out most of this strictness business long, long ago and you are long bored of me. But I do feel strictness misconceptions and such are a potentially big problem with using haskell. I even at one time decided haskell might not be worth learning (more) about because it seemed like it might be too hard to analyze memory usesage and the like to create efficient programs. I think I may eventually attempt to write a haskell lazyness/strictness FAQ. I feel a bit underqualified for the job, so I'm probably going to need help in verification of what I may say in it. If anything, I hope for some help so that i will not embarass the haskell community! Or, at the very least, I may eventially add something to the haskell wiki. I'm not sure which. Any critique is welcome. On Fri, 15 Mar 2002, Ronny Wichers Schreur wrote: > matt hellige writes (to the haskell mailing list): > > >[..] consider: > > sum 0 x = x > > sum x y = x + y > > > >if the first argument is 0, we don't need to inspect the second > >argument at all. > > But sum returns its second argument, so it's still strict in that > argument. Oh boy. You are right. sum 0 _|_ = _|_, since obviously x = x. but what about sum x _|_? assuming (+) for integers, (+) is strict on both arguments. thus sum x _|_ = x + _|_ = _|_ Thus that definition of sum is strict on both arguments. (Apologies to Matt Hellige for incorrect analysis in private message). That also means my sumpeano isn't just strict on the second argument. data Peano = Zero | Succ (Peano) sumpeano blah (Succ x) = sumpeano (Succ blah) x sumpeano blah Zero = blah If the initial second argument of sumpeano is Zero, then sumpeano IS strict on the second argument, by the same reasoning above. But if it is not, then sumpeano _|_ (Succ x) = sumpeano (Succ _|_) x. When sumpeano finally reaches Zero in the second argument (for a initial non-Zero argument) the result will be a cascade of Succ applications like (Succ.) (Succ.) (Succ.) (Succ.) _|_ which, well, is not equivalent to _|_ (nor will it be unless all applications have been forced.. Therefore sumpeano is, CONDITIONALLY strict in the first argument! (The reader may wonder why I chose the "(Succ.)" notation. I wanted to give pause to the fact that sumpeano is generating Succ "thunks" which will generate Succ (Succ (Succ ...))) etc, and not the actual structure. perhaps I'm trying to be overly accurate for this argument.) In all the literature I've read (which, by the way, is not much) I've never seen such a phrase as conditionaly strict or conditionally lazy. Is such a conseption as being conditionally strict or conditionally lazy fairly useful? Or is this where the phrase "non-strict" comes in? Hmmm, redefining sumpeano in terms of functions of 1 argument, (and switching around the arguments around for the sake of argument) May also give some insight. Either (sumpeano z) is a strict function, or, it isn't. sumpeano' Zero = id -- id _|_ = _|_ sumpeano' (Succ x) = \blah -> (sumpeano' x) (Succ blah) Yet of course there are functions in common use which one could say have arguments which are fully lazy. take the definiton of map. map f [] = [] map f (x:xs) = f x : map f xs f can be bottom easily. take length $ map _|_ [1..5] for example. (for your pretend bottom, you could use error, as in bottom = error "I'm _|_!") This is quite intriguing. I've learned something today. I hope my post proves usefull to somebody else. > Cheers, > > Ronny Wichers Schreur Thanks, Jay Cox From wolfgang@jeltsch.net Sat Mar 16 11:46:07 2002 From: wolfgang@jeltsch.net (Wolfgang Jeltsch) Date: Sat, 16 Mar 2002 12:46:07 +0100 Subject: Strictness In-Reply-To: =?iso-8859-1?B?PFBpbmUuTE5YLjQuMzMuMDIw?= =?iso-8859-1?Q?3151719420=2E5062-100000=40localhost=2Elocaldomain=3E=3B_f?= =?iso-8859-1?Q?rom_sqrtofone=40yahoo=2Ecom_on_Sam=2C_M=E4?= =?iso-8859-1?Q?r?= 16, 2002 at 03:16:49 +0100 References: <5.1.0.14.0.20020315182620.00b08180@localhost> Message-ID: <20020316124607.A1933@localhost> On Saturday, March 16, 2002, 03:16 CET Jay Cox wrote: > [...] > I think I may eventually attempt to write a haskell lazyness/strictness FAQ. Great! I'm very interested in it. > [...] Wolfgang From Jon.Fairbairn@cl.cam.ac.uk Sun Mar 17 19:06:44 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Sun, 17 Mar 2002 19:06:44 +0000 Subject: Standard Library report: List union In-Reply-To: Your message of "Mon, 11 Mar 2002 05:04:28 PST." <1113DDB24D4A2841951BFDF86665EE1901041AC3@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <20721.1016392004@cl.cam.ac.uk> > There's a remark at the beginning of 7.2 that says: > = > delete, (\\), union and intersect preserve the invariant=3D20 > that lists don't contain duplicates, provided that=3D20 > their first argument contains no duplicates. > = > The same applies to unionBy etc. This design is one > you might reasonably disagree with. I'd have thought > it would be more sensible to have the invariant that > *both* arguments to union and intersect are assumed > to be sets (no dups). = That's partly what I was alluding to, but either way I'd have thought that there were clearer definitions, for example: unionBy eq xs ys =3D xs ++ [y | y <- nubBy eq ys, not (any (eq y) xs)] J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From aciego@ctima.uma.es Mon Mar 18 07:58:55 2002 From: aciego@ctima.uma.es (Manuel Ojeda Aciego) Date: Mon, 18 Mar 2002 08:58:55 +0100 Subject: Final CFP: Unification in non-classical logics Message-ID: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D We apologize if you receive this more than once =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Final call for papers Unification in Non-Classical Logics --co-located with ICALP 2002-- July, 12-13, 2002, M=E1laga, Spain http://www.satd.uma.es/aciego/icalp-ws.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The workshop on Unification in Non-Classical Logics will be held in M=E1laga, as a workshop of the 29-th International Colloquium on Automata, Languages, and Programming (ICALP 2002), which is a very convenient forum for an open discussion of the subject of non-canonical unification, roughly depicted below. Aims and scope -------------- Unification in non-classical logics, with various approaches to handling generalised terms, has drawn more and more attention in recent years. It turns out to be among the most promising areas of research on non-classical logics and its applications. So far, most popular lines of research include fuzzy unification of (conventional) databases and the use of fuzzy concepts in information retrieval. Some international events based on these topics have been held so far, for instance, the 2nd Intl Workshop on Logic Programming and Soft Computing (LPSC'98), or the special session on Advances in Possibilistic Logic and Related Issues at the IFSA Congress in Vancouver, Canada (2001), have non-classical unification among their topics. This workshop at ICALP is conceived as a forum for the exchange of ideas relevant for the concept of unification in non-classical logics, including, but not limited to, the following topics (practical implementations and experiences as well as theoretical advances): * Unification in multiple-valued and fuzzy logic programming. * Unification based on similarities and fuzzy equivalence relations. * Categorical unification. * Practical use of non-classical unification, e.g. in expert systems and information retrieval. We expect potential participants from the following areas: multiple-valued logic, fuzzy logic, uncertainty in logic programming, categorical applications to computer science. The workshop will have a limited number of presentations and the organizers will apply a refereeing procedure accordingly. The format will be as a set of presentations followed by a round table discussion. As the number of participants is estimated not to be very large, time enough will be allocated for each presentation (between 30 and 40 minutes), thus helping to have a relaxed workshop atmosphere in which discussions are encouraged. Submission ---------- Authors are invited to submit an extended abstract of their papers, presenting original contributions to the workshop themes. The workshop proceedings will be published as an issue in the ENTCS series (Electronic Notes on Theoretical Computer Science). Submissions should be written in English and not exceed 15 pages using the ENTCS style, and sent to the organizers in either PS or PDF form, together with a text-only message containig: title, abstract and keywords, the author's full names, and address and e-mail for correspondence. Simultaneous submission to other meetings with published proceedings is not allowed. Important dates --------------- * 20.03.2002 Workshop paper submission deadline * 21.04.2002 Workshop paper acceptance notification * 10.05.2002 Workshop paper camera-ready deadline Organizing Committee -------------------- Patrik Eklund Manuel Ojeda-Aciego Dept. Computing Science Dept. Matematica Aplicada Umea University Universidad de Malaga mailto:peklund@cs.umu.se mailto:aciego@ctima.uma.es ---------------------------------------------------------- From S.J.Thompson@ukc.ac.uk Mon Mar 18 12:48:38 2002 From: S.J.Thompson@ukc.ac.uk (S.J.Thompson) Date: Mon, 18 Mar 2002 12:48:38 +0000 Subject: Functional and Declarative Programming in Education (FDPE02) Message-ID: Functional and Declarative Programming in Education (FDPE02) A one day workshop at PLI'02 Monday 7 October 2002, Pittsburgh, PA, USA CALL FOR SUBMISSIONS Functional and declarative programming plays an increasingly important role in computing education at all levels. The aim of this workshop is to bring together educators and others who are interested in exchanging ideas on how to use a functional or declarative programming style in the classroom. Submissions are sought in a variety of forms, including: - Standard presentations (30 minutes) - Short talks or "tricks of the trade" presentations (10 minutes) The organisers would also welcome other sorts of submissions, such as software demos, panels, very short talks and so on. Michael Hanus, University of Kiel, Germany Shriram Krishnamurthi, Brown University, RI, USA Simon Thompson, University of Kent, UK More details at the FPDE02 website: FDPE02: http://www.cs.ukc.ac.uk/people/staff/sjt/fdpe02/description.html PLI'02: http://pli2002.cs.brown.edu/ From batory@cs.utexas.edu Mon Mar 18 14:07:58 2002 From: batory@cs.utexas.edu (Don Batory) Date: Mon, 18 Mar 2002 08:07:58 -0600 Subject: Reminder: GCSE/SAIG Submissions Message-ID: <003f01c1ce86$56904700$258d5380@csres.utexas.edu> This is a multi-part message in MIME format. ------=_NextPart_000_003C_01C1CE54.04C61670 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Please excuse multiple listings of this announcement. CALL FOR PAPERS Submission Deadline: March 21, 2002 The First ACM SIGPLAN/SIGSOFT Conference on Generators and Components (GCSE/SAIG'02) Supported by the National Science Foundation (NSF) Pittsburgh, PA, October 6-8, 2002. http://www.cs.yale.edu/~taha/gcse-saig/cfp02.html Invited Speakers: * Neil Jones, University of Denmark * Catuscia Palamidessi, Penn State University * Janos Sztipanovits, Vanderbilt University Program generation has the prospect of being an integral part of a wide range of software development processes. Many recent studies investigate different aspects of program generation, including their semantics, their application, and their implementation. Existing theories and systems address both high-level (source) language and low-level (machine) language generation. A number of programming languages now support program generation and manipulation, with different goals, implementation techniques, and targeted at different applications. The goal of this conference is to provide a meeting place for researchers and practitioners interested in this topic. A particular area of interest is component-based software development, which bears the promise of considerable productivity increases to software development comparable to the introduction of the assembly line in manufacturing. But due to the very same sophistication that makes components useful, their maintenance can be hard. Generative programming presents a promising approach to alleviating the above problems, as changes affecting components can now be more effectively managed during the generation process rather than at the component level. The goal of this joint event is to foster further cross-fertilization between the software engineering research community on the one hand, and the programming languages community on the other, in addition to supporting the original research goals of both GCSE and SAIG communities. We seek papers both in software engineering and programming languages, and especially those that bridge the gap. Being accessible to both communities at the same time is also valued. The conference solicits submissions related (but not limited) to: * Generative Programming: Reuse, meta-programming, partial = evaluation, multi-stage and multi-level languages, * Semantics, type systems, symbolic computation, linking and explicit substitution, in-lining and macros, templates, program = transformation, * Runtime code generation, compilation, active libraries, synthesis = from specifications, development methods, generation of non-code = artifacts, formal methods. Reflection. * Component-Based Software Engineering: Reuse, distributed platforms, distributed systems, evolution, analysis and design patterns, development methods, formal methods * Integration of Generative and Component-Based Approaches * Domain Engineering, analysis, and languages * Separation of Concerns: Aspect-Oriented Programming, Intentional * Programming, and Multi-Dimensional Separation of Concerns * Product Lines and generic architectures for that purpose. * Industrial Applications of Components and Generative Programming Reports on applications of these techniques to real-world problems are especially encouraged, as are submissions that relate ideas and concepts from several of these topics, or bridge the gap between theory and practice. The program committee is happy to advise on the appropriateness of a particular subject. General Chair: Walid Taha, Yale University, USA. Program Chair (GCSE focus): Don Batory, University of Texas at Austin, USA. Program Chair (SAIG focus): Charles Consel, INRIA, LaBRI, France. Program Committee (GCSE focus): Jan Bosch , University of Groningen Greg Butler, Concordia University Prem Devanbu, University of California at Davis Cristina Gacek, University of Newcastle upon Tyne Stan Jarzabek, National University of Singapore Kyo Kang, Pohang University of Science and Technology Peter Knauber, Fraunhofer Institute for Experimental Software Engineering Hausi Muller, University of Victoria Nenad Medvidovic, University of Southern California Wolfgang Pree, University of Constance Yannis Smaragdakis, Georgia Institute of Technology Douglas R. Smith , Kestrel Institute Program Committee (SAIG focus): Craig Chambers, University of Washington Shigeru Chiba, Tokyo Institute of Technology Pierre Cointe, Ecole des Mines de Nantes Dawson Engler, Stanford University Siau cheng Khoo, National University of Singapore Gregor Kiczales, University of British Columbia Martin Odersky, Ecole Polytechnique F=E9d=E9rale de Lausanne Calton Pu, Georgia Institute of Technology Peter Thiemann, Universit=E4t Freiburg Andrew Tolmach, Portland State University Submission Details: Authors are invited to submit papers of at most 5000 words (excluding figures), in postscript format (letter or A4), using the electronic submission form by March 21st, 2002. This deadline is firm. Both position and technical papers are welcome (Please indicate at time of submission.) Authors will be notified of acceptance by May 14th, 2002. Final version of the papers must be submitted by July 14, 2002. Format: The three day conference will contain slots for technical papers (45 minutes) and position papers (30 minutes). Both times include discussion. Position papers are expected to describe important future directions, ongoing work, and survey previous results. This category is best thought of as one for "competitive invited papers". Technical papers are expected to contain novel results. All papers will be reviewed by the program committee for the above-mentioned criteria, in addition to correctness and clarity. Simultaneous submission to other venues is not allowed, as is submission of previously published material. In addition, there will be time allocated for open discussions at the end of the conference. Proceedings will be published as an LNCS volume. Special Note on Combined Event: While the Program Committee is divided into two focus areas corresponding the parent events (GCSE and SAIG), there will be one unified program committee meeting. At the time of submission, authors must indicate whether they intend the paper for the GCSE audience, SAIG audience, or BOTH. The last category is the default, and is strongly encouraged. Papers submitted explicitly to only one focus will be accepted or rejected by the respective Program Chair. For papers submitted to BOTH, it is enough that one of the two Program Chairs accepts the paper. All members of the PC will allowed to bid for and review all papers, and cross-bidding is encouraged. The conference itself will not be divided along focus lines. Rather, an attempt will be made to ensure that each session is of interest to both parent communities. ------=_NextPart_000_003C_01C1CE54.04C61670 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Please excuse multiple listings = of this=20 announcement.
 

          &nbs= p;            = ;    =20 CALL FOR PAPERS
 
           &n= bsp;     =20 Submission Deadline: March 21, 2002
 
           &n= bsp;=20 The First ACM SIGPLAN/SIGSOFT Conference=20 on
           &= nbsp;  =20 Generators and Components (GCSE/SAIG'02)
 
          Supported by = the=20 National Science Foundation=20 (NSF)
          &nbs= p;      =20 Pittsburgh, PA, October 6-8, 2002.
 
          http://www.cs.= yale.edu/~taha/gcse-saig/cfp02.html
 
Invited Speakers:
 
* Neil Jones, University of Denmark
* Catuscia Palamidessi, Penn = State=20 University
* Janos Sztipanovits, Vanderbilt University
 
Program generation has the prospect of being an integral part of = a
wide=20 range of software development processes. Many recent = studies
investigate=20 different aspects of program generation, including their
semantics, = their=20 application, and their implementation. Existing
theories and systems = address=20 both high-level (source) language and
low-level (machine) language=20 generation. A number of programming
languages now support program = generation=20 and manipulation, with
different goals, implementation techniques, = and=20 targeted at different
applications. The goal of this conference is to = provide=20 a meeting
place for researchers and practitioners interested in this=20 topic.
 
A particular area of interest is component-based software=20 development,
which bears the promise of considerable productivity = increases=20 to
software development comparable to the introduction of the=20 assembly
line in manufacturing. But due to the very same = sophistication=20 that
makes components useful, their maintenance can be hard. =20 Generative
programming presents a promising approach to alleviating = the=20 above
problems, as changes affecting components can now be more=20 effectively
managed during the generation process rather than at the=20 component
level.
 
The goal of this joint event is to foster further=20 cross-fertilization
between the software engineering research = community on=20 the one hand,
and the programming languages community on the other, = in=20 addition to
supporting the original research goals of both GCSE and=20 SAIG
communities. We seek papers both in software engineering=20 and
programming languages, and especially those that bridge the gap.=20 Being
accessible to both communities at the same time is also = valued.
 
The conference solicits submissions related (but not limited) = to:
 
   * Generative Programming: Reuse, meta-programming, = partial=20 evaluation,
        multi-stage = and=20 multi-level languages,
   * Semantics, type systems, = symbolic=20 computation, linking and = explicit
       =20 substitution, in-lining and macros, templates, program=20 transformation,
   * Runtime code generation, compilation, = active=20 libraries, synthesis from
       =20 specifications, development methods, generation of non-code=20 artifacts,
        formal = methods. =20 Reflection.
   * Component-Based Software Engineering: = Reuse,=20 distributed platforms,
        = distributed=20 systems, evolution, analysis and design=20 patterns,
        development = methods,=20 formal methods
   * Integration of Generative and = Component-Based=20 Approaches
   * Domain Engineering, analysis, and=20 languages
   * Separation of Concerns: Aspect-Oriented = Programming,=20 Intentional
   * Programming, and Multi-Dimensional = Separation of=20 Concerns
   * Product Lines and generic architectures for = that=20 purpose.
   * Industrial Applications of Components and = Generative=20 Programming
 
Reports on applications of these techniques to real-world problems=20 are
especially encouraged, as are submissions that relate ideas=20 and
concepts from several of these topics, or bridge the gap=20 between
theory and practice. The program committee is happy to advise = on=20 the
appropriateness of a particular subject.
 

General Chair:
 
      Walid Taha, Yale University, = USA.
 
Program Chair (GCSE focus):
 
      Don Batory, University of Texas at = Austin,=20 USA.
 
Program Chair (SAIG focus):
 
      Charles Consel, INRIA, LaBRI, = France.
 
Program Committee (GCSE focus):
 
      Jan Bosch , University of=20 Groningen
      Greg Butler, Concordia=20 University
      Prem Devanbu, University of = California at Davis
      Cristina Gacek, = University=20 of Newcastle upon Tyne
      Stan Jarzabek, = National=20 University of Singapore
      Kyo Kang, = Pohang=20 University of Science and Technology
      = Peter=20 Knauber, Fraunhofer Institute
       = for=20 Experimental Software Engineering
      = Hausi=20 Muller, University of Victoria
      Nenad=20 Medvidovic, University of Southern = California
     =20 Wolfgang Pree, University of Constance
      = Yannis=20 Smaragdakis, Georgia Institute of = Technology
     =20 Douglas R. Smith , Kestrel Institute
 
Program Committee (SAIG focus):
 
      Craig Chambers, University of=20 Washington
      Shigeru Chiba, Tokyo = Institute of=20 Technology
      Pierre Cointe, Ecole des = Mines de=20 Nantes
      Dawson Engler, Stanford=20 University
      Siau cheng Khoo, National=20 University of Singapore
      Gregor = Kiczales,=20 University of British Columbia
      Martin = Odersky,=20 Ecole Polytechnique F=E9d=E9rale de = Lausanne
     =20 Calton Pu, Georgia Institute of = Technology
     =20 Peter Thiemann, Universit=E4t Freiburg
      = Andrew=20 Tolmach, Portland State University
 
Submission Details: Authors are invited to submit papers of at = most
5000=20 words (excluding figures), in postscript format (letter or A4),
using = the=20 electronic submission form by March 21st, 2002. This
deadline is = firm. Both=20 position and technical papers are welcome
(Please indicate at time of = submission.) Authors will be notified of
acceptance by May 14th, = 2002. =20 Final version of the papers must be
submitted by July 14, 2002.
 
Format: The three day conference will contain slots for = technical
papers=20 (45 minutes) and position papers (30 minutes). Both times
include=20 discussion.  Position papers are expected to describe
important = future=20 directions, ongoing work, and survey previous
results. This category = is best=20 thought of as one for "competitive
invited papers".  Technical = papers=20 are expected to contain novel
results.  All papers will be = reviewed by=20 the program committee for the
above-mentioned criteria, in addition = to=20 correctness and clarity.
Simultaneous submission to other venues is = not=20 allowed, as is
submission of previously published material. In = addition,=20 there will
be time allocated for open discussions at the end of the=20 conference.
Proceedings will be published as an LNCS volume.
 
Special Note on Combined Event: While the Program Committee is=20 divided
into two focus areas corresponding the parent events (GCSE = and=20 SAIG),
there will be one unified program committee meeting.  At = the time=20 of
submission, authors must indicate whether they intend the paper = for
the=20 GCSE audience, SAIG audience, or BOTH.  The last category is=20 the
default, and is strongly encouraged.  Papers submitted = explicitly=20 to
only one focus will be accepted or rejected by the respective=20 Program
Chair.  For papers submitted to BOTH, it is enough that = one of=20 the two
Program Chairs accepts the paper.  All members of the PC = will=20 allowed
to bid for and review all papers, and cross-bidding is=20 encouraged.
The conference itself will not be divided along focus=20 lines.  Rather,
an attempt will be made to ensure that each = session is=20 of interest to
both parent communities.
 

 
------=_NextPart_000_003C_01C1CE54.04C61670-- From gmh@Cs.Nott.AC.UK Mon Mar 18 14:27:51 2002 From: gmh@Cs.Nott.AC.UK (Graham Hutton) Date: Mon, 18 Mar 2002 14:27:51 +0000 Subject: PhD studentship in Nottingham Message-ID: <20020318142822.80CDF422222@www.haskell.org> Dear all, I'm seeking applicants for a PhD studentship in the area of functional programming, to start on 1st October 2002 for a period of three years. You will normally require a first-class Honours degree (or equivalent qualification) in Computer Science and/or Mathematics, and some experience of functional programming. If you are interested in the possibility of such a PhD position, in the first instance please email your full CV, including the results of all your university examinations to date. Best wishes, Graham +---------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | Foundations of Programming Group Web : www.cs.nott.ac.uk/~gmh | | School of Computer Science and IT | | University of Nottingham | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB Phone : +44 (0)115 951 4220 | | United Kingdom Fax : +44 (0)115 951 4254 | +---------------------------------------------------------------------+ From heringto@cs.unc.edu Mon Mar 18 17:37:12 2002 From: heringto@cs.unc.edu (Dean Herington) Date: Mon, 18 Mar 2002 12:37:12 -0500 Subject: question about concurrency implementation Message-ID: <3C9625C8.1E8FDCD8@cs.unc.edu> I'm curious about the implementation of Concurrent Haskell in GHC and Hugs. Does access to values possibly shared among threads cost the same in Concurrent Haskell as in regular Haskell? I'm guessing the answer is "yes", because Concurrent Haskell is provided by default in GHC. If the costs are the same, does that rely on there being no true concurrency in the current implementations? How would the cost change if true concurrency were provided? Wouldn't thunk evaluation involve mutual exclusion? Dean Herington From ajc99@aber.ac.uk Mon Mar 18 17:43:49 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Mon, 18 Mar 2002 17:43:49 +0000 Subject: using less stack Message-ID: <3C962755.7080109@aber.ac.uk> I have stack problems: my program uses too much stack. I suspect, from removing bits of code, that it's due to a foldr in my program. If I use foldr or foldl on a long list (eg >500 bulky elements for a 3M stack), is this likely to be filling the stack? What is it that gets stored on the stack? If so, is there an obvious refactoring of the fold to use? Amanda -- Amanda Clare http://users.aber.ac.uk/ajc99/ Tel: +44 (0)1970 621787 Fax: +44 (0)1970 622455 Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB From simonpj@microsoft.com Mon Mar 18 17:50:04 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 18 Mar 2002 09:50:04 -0800 Subject: Haskell 98 report: March release Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041B5A@RED-MSG-10.redmond.corp.microsoft.com> Folks Before I get buried in ICFP submissions I thought I should get out the H98 report draft. It's in the usual place: http://research.microsoft.com/~simonpj/haskell98-revised Main changes since the Dec release are: Much improved informal semantics of pattern matching (3.17). Minor changes to the lexical syntax for white space (!). Two extra productions for expressions, which makes the treatment of sections align with the text in 3.5. Add notes in three places about hard-to-parse constructs.=20 This is my eventual solution to some dark corners in the=20 grammar (Chapter 3). Allow duplicates in the subordinate names of export lists (5.2). Remark that Eq and Ord are strict in both arguments (Appendix D.1).=20 plus quite a few other minor corrections. As ever, your careful proofreading, esp of the new parts, would be most helpful. From simonmar@microsoft.com Mon Mar 18 17:50:10 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 18 Mar 2002 17:50:10 -0000 Subject: question about concurrency implementation Message-ID: <9584A4A864BD8548932F2F88EB30D1C608AA4458@TVP-MSG-01.europe.corp.microsoft.com> > I'm curious about the implementation of Concurrent Haskell in GHC and > Hugs. Does access to values possibly shared among threads=20 > cost the same > in Concurrent Haskell as in regular Haskell? I'm guessing=20 > the answer is > "yes", because Concurrent Haskell is provided by default in=20 > GHC. "yes" > If the costs are the same, does that rely on there being no true=20 > concurrency in > the current implementations? It depends what you mean by true concurrency: from the point of view of the Haskell programmer, GHC's implementation of concurrency is "almost" preemptive, because we can context-switch at any allocation. Most computation does some allocation, but it's possible to write functions that don't (although these tend to be on the trivial side - an optimised nfib won't allocate, for example). We could artificially cause all computation to do some allocation to avoid this problem, but we haven't found it necessary so far. But I suspect by "true concurrency" you're referring at the kind of concurrent processes that can be executed on multiple CPUs simultaneously. We did investigate doing this a while back, and found that the locking required on thunks was very expensive (slowed down the program by at least 2x on the bog-standard SMP machine we had here). However there are some clever techniques that can be used to reduce the cost - giving each process its own private allocation area and only degrading to full locking for access to the shared portion of the heap is one such technique we experimented with briefly but I don't have any concrete benchmarks I'm afraid. Also you really need a multithreaded garbage collector, which is a lot of work. Cheers, Simon From ajc99@aber.ac.uk Mon Mar 18 17:59:07 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Mon, 18 Mar 2002 17:59:07 +0000 Subject: using less stack References: <3C962755.7080109@aber.ac.uk> Message-ID: <3C962AEB.9070505@aber.ac.uk> Apologies for the typo: that should have been 50000 elements, not 500. Amanda Clare wrote: > I have stack problems: my program uses too much stack. I suspect, from > removing bits of code, that it's due to a foldr in my program. If I use > foldr or foldl on a long list (eg >500 bulky elements for a 3M stack), > is this likely to be filling the stack? What is it that gets stored on > the stack? If so, is there an obvious refactoring of the fold to use? > > Amanda > > -- > Amanda Clare http://users.aber.ac.uk/ajc99/ > Tel: +44 (0)1970 621787 Fax: +44 (0)1970 622455 > Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > > From Jon.Fairbairn@cl.cam.ac.uk Mon Mar 18 19:14:16 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Mon, 18 Mar 2002 19:14:16 +0000 Subject: using less stack In-Reply-To: Your message of "Mon, 18 Mar 2002 17:59:07 GMT." <3C962AEB.9070505@aber.ac.uk> Message-ID: <29465.1016478856@cl.cam.ac.uk> > Apologies for the typo: that should have been 50000 elements, not 500. > = > Amanda Clare wrote: > > I have stack problems: my program uses too much stack. I suspect, fro= m = > > removing bits of code, that it's due to a foldr in my program. If I u= se = > > foldr or foldl on a long list (eg >500 bulky elements for a 3M stack)= , = > > is this likely to be filling the stack? The fold itself won't be filling the stack. Without seeing some of the code it's hard to tell, but the most common cause of this sort of problem is a lack of strictness. foldr (+) 0 [0..5000] doesn't use up stack for the fold, but it builds a suspension for all 5000 additions, and evaluating that /does/ use stack unless the compiler has spotted that (+) is strict. (What compiler/interpreter are you using?) > > What is it that gets stored on = > > the stack? If so, is there an obvious refactoring of the fold to use?= The solution is to stick in $! judiciously and use foldr' (which seems to have got dropped from the standard libraries at some point, so you'll have to write your own) that uses $!. J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From senganb@ia.nsc.com Mon Mar 18 19:19:21 2002 From: senganb@ia.nsc.com (senganb@ia.nsc.com) Date: Mon, 18 Mar 2002 14:19:21 -0500 Subject: Haskell slicing tool? Message-ID: <20020318141921.582b412f.senganb@ia.nsc.com> Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all "fromJusts" invoked from the current function, or all functions that use a particular member of my monad's ADT. Sengan From reid@cs.utah.edu Mon Mar 18 20:47:26 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 18 Mar 2002 20:47:26 +0000 Subject: question about concurrency implementation In-Reply-To: <3C9625C8.1E8FDCD8@cs.unc.edu> References: <3C9625C8.1E8FDCD8@cs.unc.edu> Message-ID: > I'm curious about the implementation of Concurrent Haskell in GHC > and Hugs. Hugs' implementation of concurrency is non-preemptive wherease GHC's implementation is preemptive (or "almost preemptive") as described by Simon. > Does access to values possibly shared among threads cost the same in > Concurrent Haskell as in regular Haskell? I'm guessing the answer > is "yes", because Concurrent Haskell is provided by default in GHC. The answer is yes for Hugs. > If the costs are the same, does that rely on there being no true > concurrency in the current implementations? Just to be sure we agree on terminology: some people like to distinguish between "parallelism" and "concurrency". Parallelism is a way of going faster but doesn't change your programming model. Implemented correctly, a parallel implementation yields the same results as a sequential implementation - it just runs faster. (This is ignoring the effects of interaction with the outside world, of course - since that can also affect determinism.) Parallel Haskell adds "par" and friends (operations which have no effect on the semantics of your program). Concurrency changes your programming model. A concurrent program is allowed to give different results and interesting interactions (including race conditions) between threads. A concurrent program may run on a single processor. Concurrent Haskell adds forkIO, killThread, MVars, etc (operations which affect not just the semantics of your program but also the way the semantics are defined). You might want to use different words for those concepts but I hope the distinction is clear. (Note that the two concepts are rarely/never separated in imperative languages. Arguably, Esterel is an exception.) Using this terminology, I think what you're asking about is "parallelism" and not "concurrency". -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/ From promos@motolev.com Mon Mar 18 20:57:28 2002 From: promos@motolev.com (promos@motolev.com) Date: Mon, 18 Mar 2002 16:57:28 -0400 Subject: Hello Message-ID: <200203182057.g2IKvS826553@server.angiesshowpalace.com> We Welcome You Angie's Show Palace Your Private Virtual Date Awaits You. Are you tired of those XXX sites that boast they have 10,000 photos and videos that are available on many other adult web sites? We are. Why not have hundreds of photos of our very sexy girls that you can take on your very own virtual dates. We update our site every 3 days.We always have fresh new faces for you. http://www.angiesxxx.com Must be 18 years or older. From cwitty@newtonlabs.com Tue Mar 19 00:07:41 2002 From: cwitty@newtonlabs.com (Carl R. Witty) Date: 18 Mar 2002 16:07:41 -0800 Subject: Strictness! In-Reply-To: Jay Cox's message of "Thu, 14 Mar 2002 22:23:32 -0600 (CST)" References: Message-ID: Jay Cox writes: > On Thu, 14 Mar 2002, Brian Huffman wrote: > > > In Haskell you can produce the desired behavior by using pattern guards. > > Since the pattern guards always get evaluated before the result does, they > > can be used to make things more strict. Here is the foldl example: > > > > strict x = seq x True > > > > foldl' :: (a -> b -> a) -> a -> [b] -> a > > foldl' f z [] = z > > foldl' f z (x:xs) > > | strict z = foldl' f (f z x) xs > > > > You can make multiple arguments strict by using && or similar, e.g.: > > > > f x y | strict x && strict y = ... > > f x y | all strict [x,y] = ... > > > > Of course, with the second example x and y must have the same type. > > Hope this helps. > > > > - Brian Huffman > > Thanks! that looks like a great haskell idiom to use! > > Jay Cox I also like this for trace: f x y | trace (show (x, y)) True = ... (Putting the trace on a separate line like that makes it easy to comment out.) Or, if you've got a function with a lot of cases, you can trace all of them by adding: f x y | trace (show (x, y)) False = undefined above all the other cases. Carl Witty From heringto@cs.unc.edu Tue Mar 19 04:56:27 2002 From: heringto@cs.unc.edu (Dean Herington) Date: Mon, 18 Mar 2002 23:56:27 -0500 (EST) Subject: question about concurrency implementation In-Reply-To: Message-ID: By "true concurrency" I meant "simultaneous execution of multiple threads by multiple processors". This involves both concepts you define: "concurrency" (to have multiple threads) and "parallelism" (to have them execute possibly simultaneously when multiple processors are available). >From Simon Marlow's reply, I gather that the current implementations of Concurrent Haskell provide "concurrency" but not "parallelism", and that provision of parallelism is not likely in the near term. I've asked these questions in order to convince myself that multiple threads can (and will) cooperate in lazily evaluating a value they share, without need for any special programming. In particular, I plan to have multiple threads share values whose computations involve uses of `unsafePerformIO` (the safety of which my application's usage pattern guarantees). Thanks to you and others for your helpful replies. Dean On 18 Mar 2002, Alastair David Reid wrote: > > > I'm curious about the implementation of Concurrent Haskell in GHC > > and Hugs. > > Hugs' implementation of concurrency is non-preemptive wherease GHC's > implementation is preemptive (or "almost preemptive") as described by > Simon. > > > Does access to values possibly shared among threads cost the same in > > Concurrent Haskell as in regular Haskell? I'm guessing the answer > > is "yes", because Concurrent Haskell is provided by default in GHC. > > The answer is yes for Hugs. > > > If the costs are the same, does that rely on there being no true > > concurrency in the current implementations? > > Just to be sure we agree on terminology: some people like to > distinguish between "parallelism" and "concurrency". > > Parallelism is a way of going faster but doesn't change your > programming model. Implemented correctly, a parallel implementation > yields the same results as a sequential implementation - it just runs > faster. (This is ignoring the effects of interaction with the outside > world, of course - since that can also affect determinism.) Parallel > Haskell adds "par" and friends (operations which have no effect on the > semantics of your program). > > Concurrency changes your programming model. A concurrent program is > allowed to give different results and interesting interactions > (including race conditions) between threads. A concurrent program may > run on a single processor. Concurrent Haskell adds forkIO, > killThread, MVars, etc (operations which affect not just the semantics > of your program but also the way the semantics are defined). > > You might want to use different words for those concepts but I hope > the distinction is clear. (Note that the two concepts are rarely/never > separated in imperative languages. Arguably, Esterel is an exception.) > > Using this terminology, I think what you're asking about is > "parallelism" and not "concurrency". From ketil@ii.uib.no Tue Mar 19 07:56:40 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 19 Mar 2002 08:56:40 +0100 Subject: question about concurrency implementation In-Reply-To: References: Message-ID: Dean Herington writes: > From Simon Marlow's reply, I gather that the current implementations of > Concurrent Haskell provide "concurrency" but not "parallelism", and that > provision of parallelism is not likely in the near term. Uh, GPH exists, doesn't it? So you can get "parallelism" if you're after performance. The only implementation appears to be based on PVM, so I expect some overhead on SMPs, although I haven't gotten around to actually try it yet. I don't know if or how you can mix the two paradigms. There's also an implementation using threads for asynchronous calls to Win32 libraries, if I understand things correctly. A full thread-based parallel implementation might (or might not) be a logical next step. -kzm -- If I haven't seen further, it is by standing in the footprints of giants From colin@cs.york.ac.uk Tue Mar 19 09:56:49 2002 From: colin@cs.york.ac.uk (Colin Runciman) Date: Tue, 19 Mar 2002 09:56:49 +0000 Subject: Haskell slicing tool? Message-ID: > Are there any tools to perform program slicing on Haskell? > I often find myself wanting to find all "fromJusts" invoked > from the current function, or all functions that use a > particular member of my monad's ADT. Assuming that what you want to see are the applications of these functions that occur at run-time, and the evaluation contexts in which they arise, you could try the Hat tracing tools (http://www.cs.york.ac.uk/fp/hat/). Colin R From ajc99@aber.ac.uk Tue Mar 19 11:15:28 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Tue, 19 Mar 2002 11:15:28 +0000 Subject: using less stack References: <29465.1016478856@cl.cam.ac.uk> Message-ID: <3C971DD0.1030002@aber.ac.uk> Thanks for all the advice. In the end, I couldn't make $! work for me (it always seems to be harder than I think it will be to use it, and $! and deepSeq makes my code run slowly). But a continuation passing style foldl worked wonderfully. I now have: > cpsfold f a [] = a > cpsfold f a (x:xs) = f x a (\y -> cpsfold f y xs) and f takes a continuation, Bob's my uncle, and I have a program that runs quickly in constant space! Amanda -- Amanda Clare http://users.aber.ac.uk/ajc99/ Tel: +44 (0)1970 621787 Fax: +44 (0)1970 622455 Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB From dominic.j.steinitz@britishairways.com Tue Mar 19 11:33:11 2002 From: dominic.j.steinitz@britishairways.com (dominic.j.steinitz@britishairways.com) Date: Tue, 19 Mar 2002 11:33:11 +0000 Subject: Gaussian Integers Message-ID: On holiday, I started reading about Gaussian integers (as you do) and I thought this should be a piece of cake for Haskell. I get the following error in Hugs: ERROR "D:\Temp\comptst2.hs" (line 4): Cannot build superclass instance *** Instance : Num (Gaussian a) *** Context supplied : () *** Required superclass : Eq (Gaussian a) and a similar one using GHCi: Could not deduce `Eq b' from the context () Probable fix: Add `Eq b' to the instance declaration context arising from an instance declaration at comptst1.hs:4 I've already declared Gaussian a as being of class Eq so why does it need to be told again? data Integral a => Gaussian a = Gaussian a a deriving (Eq, Show) instance Num (Gaussian a) where Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') negate (Gaussian a b) = Gaussian (negate a) (negate b) fromInteger a = Gaussian (fromIntegral a) 0 From voigt@orchid.inf.tu-dresden.de Tue Mar 19 11:46:43 2002 From: voigt@orchid.inf.tu-dresden.de (Janis Voigtlaender) Date: Tue, 19 Mar 2002 12:46:43 +0100 Subject: Gaussian Integers References: Message-ID: <3C972523.A09DBE6A@tcs.inf.tu-dresden.de> dominic.j.steinitz@britishairways.com wrote: > I've already declared Gaussian a as being of class Eq so why does it need > to be told again? > > data Integral a => Gaussian a = Gaussian a a > deriving (Eq, Show) > > instance Num (Gaussian a) where > Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') > Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') > Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') > negate (Gaussian a b) = Gaussian (negate a) (negate b) > fromInteger a = Gaussian (fromIntegral a) 0 You have only declared Gaussian a as being of class Eq (by deriving) if "a" is of class Integral (as a context in the data declaration). Adding Integral a to your instance should fix the problem: instance Integral a => Num (Gaussian a) where Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') negate (Gaussian a b) = Gaussian (negate a) (negate b) fromInteger a = Gaussian (fromIntegral a) 0 -- Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:voigt@tcs.inf.tu-dresden.de From mechvel@math.botik.ru Tue Mar 19 12:05:03 2002 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Tue, 19 Mar 2002 15:05:03 +0300 Subject: Gaussian integers. Reply Message-ID: dominic.j.steinitz@britishairways.com writes > On holiday, I started reading about Gaussian integers (as you do) and I > thought this should be a piece of cake for Haskell. I get the following > error in Hugs: > [..] > > data Integral a => Gaussian a = Gaussian a a > deriving (Eq, Show) > > instance Num (Gaussian a) where > Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') > Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') > Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') > negate (Gaussian a b) = Gaussian (negate a) (negate b) > fromInteger a = Gaussian (fromIntegral a) 0 To my mind, it is not good to set `Integral a =>' to data declaration. It is better to set such things in the instance declarations. Try, say data Gaussian a = Gau a a deriving (Eq, Show) instance Integral a => Num (Gaussian a) where Gau a b - Gau a' b' = Gau (a-a') (b-b') ... ------------------------------------------------- scico:~/t> ghci M.hs ... GHC Interactive, version 5.02.2, for Haskell 98. ... M> Gau 1 1 * Gau 1 (-1) Gau 2 0 ----------------- Serge Mechveliani mechvel@botik.ru From simonpj@microsoft.com Tue Mar 19 12:03:40 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 19 Mar 2002 04:03:40 -0800 Subject: question about concurrency implementation Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041B68@RED-MSG-10.redmond.corp.microsoft.com> Dean | From Simon Marlow's reply, I gather that the current=20 | implementations of Concurrent Haskell provide "concurrency"=20 | but not "parallelism", and that provision of parallelism is=20 | not likely in the near term. That's more or less right. The trouble is that for shared-memory parallelism - you take a performance hit for fine-grain locking - so you need real parallelism to recover that performance All the pieces are there in GHC, mostly implemented; but making it all really work, really reliably, and somewhat portably, is a non-trivial task... and the reward (as I say above) can be elusive. | I've asked these questions in order to convince myself that=20 | multiple threads can (and will) cooperate in lazily=20 | evaluating a value they share, without need for any special=20 | programming. In particular, I plan to have multiple threads=20 | share values whose computations involve uses of=20 | `unsafePerformIO` (the safety of which my application's usage=20 | pattern guarantees). Do make sure you understand Concurrent Haskell (I'm sure you do), which is specifically about multiple threads each of which can perform I/O. (See "Tackling the awkward squad" on my home page.) You are on thin ice with unsafePerformIO, especially when concurrency is involved. Simon From daan@cs.uu.nl Tue Mar 19 14:55:58 2002 From: daan@cs.uu.nl (Daan Leijen) Date: Tue, 19 Mar 2002 15:55:58 +0100 Subject: Haskell puzzles! Message-ID: <018401c1cf56$2e95f080$9650d383@ajam> Hi all, I have put together some interesting Haskell puzzles! Not many people were able to solve all three puzzles so don't be discouraged you don't know all the answers. Have fun, Daan. ----------------------------------------------------- - All three puzzles are "Haskell 98"; you can solve them using the Haskell 98 manual and they should be implementation independent. - "equal" means that two evaluated expression denote the same semantical value; i.e. when typed on the Hugs prompt, I will see the same answer. - All the answers are at the end of this mail. ----------------------------------------------------- 1) Are e1 and e2 equal? > f (x:xs) y = x > g (x:xs) = \y -> x > > e1 = seq (f []) 1 > e2 = seq (g []) 1 ----------------------------------------------------- 2) Are e1 and e2 equal? Is one definition preferred over the other? (And what about "h x = nfib 30" ?) > f = const (nfib 30) > g = \x -> nfib 30 > > e1 = f 1 + f 2 > e2 = g 1 + g 2 ----------------------------------------------------- 3) Are e1 and e2 equal? And what if I typed them on the Hugs prompt? > f = \x -> x + x > g x = x + x > > e1 = f 1.0 + f 2.0 > e2 = g 1.0 + g 2.0 ----------------------------------------------------- Answers at the end of this email..... Answers: ----------------------------------------------------- 1) answer: "e1" equals the value 1, while "e2" is undefined. explanation: This is due to the translation of pattern matching. The functions are de sugared into: > f x' y = case x' of (x:xs) -> x > g x' = case x' of (x:xs) -> (\y -> x) Now, the expression "f []" is a partial application and thus in weak head normal form while "g []" is evaluated and the pattern matching fails. opinion: I think that the pattern matching translation rules are wrong here and we shouldn't push the "case" through the lambda's. However, the current rules are potentially more efficient since all arguments can be collected before matching. ----------------------------------------------------- 2) answer: Yes, "e1" and "e2" are equal. However, the "f" definition is preferred since it potentially shares the computation of "nfib 30". ("e1" will be almost twice as fast as "e2" on most systems). explanation: The Haskell language is only defined to be "non-strict". This means that there are no guarantees about sharing. However, all current Haskell systems use lazy semantics. This means that both "f" and "g" are caf's. When "g" is evaluated, the expression "\x -> nfib 30" is shared and on each call "nfib 30" is re-evaluated. When "f" is evaluated, the application node "const (nfib 30)" is shared and once it is applied it will be updated and "nfib 30" is only evaluated once. Smart compilers like GHC however, will inline definitions like "g" and after common expression elimination we also end up with an efficient version. Same would hold for a full laziness transformation. Note that "h x = nfib 30" behaves exactly like "g" except that it's type is more general due to the monomorphism restriction and defaulting: > f,g :: a -> Integer > h :: Num b => a -> b opinion: I believe that the operational distinction between both definitions is fundamentally important and should be expressible by the user. ----------------------------------------------------- 3) answer: Yes, "e1" and "e2" are equal (6.0). However, when "e1" and "e2" are used outside the scope of "f" and "g", for example when typed on the Hugs prompt, "e1" is not well-typed. explanation: The type of "g" is "Num a => a -> a". One would expect the same type for "f" but unfortunately, the monomorphism restriction prevents this and defaulting tries to resolve the instance. Based on the usage of "f", it will default to "Double" and we get the type "Double -> Double" for "f". However, if we would use it from the Hugs prompt, there is no usage site of "f" and defaulting will resort to the "default defaulting" rules and set the type of "f" to "Integer -> Integer" and the expression "f 1.0" becomes ill typed -- that is, unless I use a "default" declaration in the module, as in: > default (Double) opinion: Clearly, as puzzle 2 shows, we want to have a distinction between shared values and functions. So, we need at least to be warned when the compiler would add a dictionary argument. I would say that an "overloading warning" is more appropriate than a "monomorphism restriction". Anyway, the real culprit here is the horrible defaulting mechanism. I believe that defaulting has no place in Haskell modules and should probably only be used on expressions in a top-level interpreter. From jmaessen@alum.mit.edu Tue Mar 19 15:44:26 2002 From: jmaessen@alum.mit.edu (Jan-Willem Maessen) Date: Tue, 19 Mar 2002 10:44:26 -0500 Subject: Haskell puzzles! Message-ID: <200203191544.KAA00691@lauzeta.mit.edu> Daan Leijen writes: > 1) Are e1 and e2 equal? > > > f (x:xs) y = x > > g (x:xs) = \y -> x > > > > e1 = seq (f []) 1 > > e2 = seq (g []) 1 > ... > 1) > answer: > "e1" equals the value 1, while "e2" is undefined. > ... > opinion: > I think that the pattern matching translation rules > are wrong here and we shouldn't push the "case" through > the lambda's. However, the current rules are potentially > more efficient since all arguments can be collected > before matching. On the contrary, I far prefer the way things are now. Matching arguments as they arrive makes programs far too eager about pattern matching. Consider the following minor variation on your example (which happily also avoids using "seq"): Q) Are e1 and e2 both defined? > f (x:xs) y z = x > g (x:xs) = \y -> \z -> x > > e1 = f [] 1 > e2 = g [] 1 A) No, e1 is defined---pattern matching happens only when all the arguments have arrived. This is nice and lazy---we don't do any work until we know we have to. By contrast, e2 performs the matching as soon as (g []) is applied to 1. We've matched eagerly, and our program fails. opinion: In practice, pattern matches are much more complicated than f and g. There is no easy and convenient way to get the behavior of e1 if matching always works as in e2. Indeed, it's not even clear how to do complex multiple-argument pattern matches if we proceed this way. Meanwhile, there's a simple way to turn f into g if that's what is desired. -Jan-Willem Maessen And I've implemented *Eager* Haskell, too. From Sengan.Baring-Gould@nsc.com Tue Mar 19 18:20:39 2002 From: Sengan.Baring-Gould@nsc.com (Sengan.Baring-Gould@nsc.com) Date: Tue, 19 Mar 2002 13:20:39 -0500 Subject: Haskell slicing tool? In-Reply-To: References: Message-ID: <20020319132039.37e63d70.senganb@ia.nsc.com> On Tue, 19 Mar 2002 09:56:49 +0000 "Colin Runciman" wrote: > > Are there any tools to perform program slicing on Haskell? > > I often find myself wanting to find all "fromJusts" invoked > > from the current function, or all functions that use a > > particular member of my monad's ADT. > > Assuming that what you want to see are the applications of > these functions that occur at run-time, and the evaluation > contexts in which they arise, you could try the Hat > tracing tools (http://www.cs.york.ac.uk/fp/hat/). Actually I was hoping for a static tool. But now HAT works with GHC I'll be trying it out. Thanks. Sengan From ESEJournal@unisannio.it Tue Mar 19 23:56:07 2002 From: ESEJournal@unisannio.it (ESEJournal@unisannio.it) Date: Wed, 20 Mar 2002 00:56:07 +0100 (CET) Subject: Empirical Software Engineering: An International Journal - CALL FOR PAPERS Message-ID: <200203192356.g2JNu7O05682@unisannio.it> *********************************************************** Empirical Software Engineering: An International Journal - CALL FOR PAPERS - *********************************************************** http://www.kluweronline.com/issn/1382-3256 . Consider submitting papers on your latest experiments and field studies! . The journal focuses on software measurement, quality and productivity improvement, and technology evaluation . Empirical studies addressing important software development issues are reported, providing results and data . Check the Journal Contents link for a sample of published articles . Papers can be searched and downloaded on line! . Individual subscription: USD $68 - subscribe on-line Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this message. If you would like to be removed from our list please send an email to ESEJournal@unisannio.it with REMOVE in the subject. From Diego Yanivello" This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C1CF8C.3AAA60A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hi, =20 is there (in Haskell) a function like =20 existFile :: FilePath -> IO (Bool) ? Thanks! ------=_NextPart_000_000E_01C1CF8C.3AAA60A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hi,    
    is there (in Haskell) a function=20 like  
        existFile :: FilePath = -> IO=20 (Bool) ?
 
Thanks!
------=_NextPart_000_000E_01C1CF8C.3AAA60A0-- From lennart@augustsson.net Wed Mar 20 00:32:35 2002 From: lennart@augustsson.net (Lennart Augustsson) Date: Wed, 20 Mar 2002 01:32:35 +0100 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> Message-ID: <3C97D8A3.B8CA185@augustsson.net> Using such a function is generally a bad idea because of race conditions. -- Lennart Diego Yanivello wrote: > hi, is there (in Haskell) a function like existFile :: FilePath -> > IO (Bool) ? Thanks! From pixel@mandrakesoft.com Wed Mar 20 00:54:23 2002 From: pixel@mandrakesoft.com (Pixel) Date: 20 Mar 2002 01:54:23 +0100 Subject: finding .... In-Reply-To: <3C97D8A3.B8CA185@augustsson.net> References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> Message-ID: Lennart Augustsson writes: > > Diego Yanivello wrote: > > > > > hi, is there (in Haskell) a function like existFile :: FilePath -> > > > IO (Bool) ? Thanks! > > Using such a function is generally a bad idea because of race conditions. however, real world programs use those tests since you don't need to care *everytime* about race conditions. (of course using this existFile before creating a temporary file is wrong, but existFile has *many* other applications) From hallgren@cse.ogi.edu Wed Mar 20 01:05:25 2002 From: hallgren@cse.ogi.edu (Thomas Hallgren) Date: Tue, 19 Mar 2002 17:05:25 -0800 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> Message-ID: <3C97E055.4030001@cse.ogi.edu> Hi, The standard library module Directory contains doesFileExist :: FilePath -> IO Bool See http://www.haskell.org/onlinelibrary/directory.html Regards, Thomas Hallgren PS If using doesFileExist is a bad idea, then using some of the other functions from the module Directory, e.g. getDirectoryContents, is probablya bad idea too... Lennart Augustsson wrote: >Using such a function is generally a bad idea because of race conditions. > > -- Lennart > >Diego Yanivello wrote: > >>hi, is there (in Haskell) a function like existFile :: FilePath -> >>IO (Bool) ? Thanks! >> From lennart@augustsson.net Wed Mar 20 01:18:05 2002 From: lennart@augustsson.net (Lennart Augustsson) Date: Wed, 20 Mar 2002 02:18:05 +0100 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> Message-ID: <3C97E34D.81449C0C@augustsson.net> Just because many applications use this doesn't make it safe or good. Presumably you are testing for the existence of the file to do something to it (read, create, delete...). It's better to do the operation you want to do and have it fail if the file is missing (or existing if you create). You then just have to handle the exception (that part is already in H98) or proceed with the normal path. I claim the code simpler this way and you avoid any race conditions. -- Lennart Pixel wrote: > Lennart Augustsson writes: > > > > Diego Yanivello wrote: > > > > > > > hi, is there (in Haskell) a function like existFile :: FilePath -> > > > > IO (Bool) ? Thanks! > > > > Using such a function is generally a bad idea because of race conditions. > > however, real world programs use those tests since you don't need to care > *everytime* about race conditions. (of course using this existFile before > creating a temporary file is wrong, but existFile has *many* other > applications) > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From pixel@mandrakesoft.com Wed Mar 20 01:37:03 2002 From: pixel@mandrakesoft.com (Pixel) Date: 20 Mar 2002 02:37:03 +0100 Subject: finding .... In-Reply-To: <3C97E34D.81449C0C@augustsson.net> References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> <3C97E34D.81449C0C@augustsson.net> Message-ID: Lennart Augustsson writes: > Just because many applications use this doesn't make it safe or good. > Presumably you are testing for the existence of the file to do something > to it (read, create, delete...). It's better to do the operation you want to > do and have it fail if the file is missing (or existing if you create). You > then just have to handle the exception (that part is already in H98) or > proceed with the normal path. I claim the code simpler this way and you > avoid any race conditions. I said real-world pbs ;p WARNING, perl below! - checking if devfs is mounted in /dev: -e "/dev/.devfsd" - checking wether there is cdrom drive with devfs: -e "/dev/cdroms/cdrom0" - looking for a file in a PATH-like: if ($f !~ m|/|) { -e "$_/$f" and $f = "$_/$f", last foreach @icon_paths } - if (-e "$f.gz") { # ... the wanted file is gzip'ed, doing whatever is needed } - -x "/bin/sh" or die "cannot open shell - /bin/sh doesn't exist"; fork and return; # doing things # now, and only now exec'ing exec "/bin/sh" - if (! -e '/usr/sbin/showmount') { my $pkg = 'nfs-utils-clients'; $in->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return; $in->do_pkgs->install($pkg); } If you want some more, just ask ;) From lennart@augustsson.net Wed Mar 20 01:42:02 2002 From: lennart@augustsson.net (Lennart Augustsson) Date: Wed, 20 Mar 2002 02:42:02 +0100 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> <3C97E34D.81449C0C@augustsson.net> Message-ID: <3C97E8EA.C0C8326A@augustsson.net> Thank you for making my point. All these are indeed examples of broken code. (Not because it's Perl. :) -- Lennart Pixel wrote: > Lennart Augustsson writes: > > > Just because many applications use this doesn't make it safe or good. > > Presumably you are testing for the existence of the file to do something > > to it (read, create, delete...). It's better to do the operation you want to > > do and have it fail if the file is missing (or existing if you create). You > > then just have to handle the exception (that part is already in H98) or > > proceed with the normal path. I claim the code simpler this way and you > > avoid any race conditions. > > I said real-world pbs ;p > > WARNING, perl below! > > - checking if devfs is mounted in /dev: -e "/dev/.devfsd" > - checking wether there is cdrom drive with devfs: -e "/dev/cdroms/cdrom0" > - looking for a file in a PATH-like: > if ($f !~ m|/|) { -e "$_/$f" and $f = "$_/$f", last foreach @icon_paths } > - > if (-e "$f.gz") { > # ... the wanted file is gzip'ed, doing whatever is needed > } > > - > -x "/bin/sh" or die "cannot open shell - /bin/sh doesn't exist"; > fork and return; > # doing things > # now, and only now exec'ing > exec "/bin/sh" > > - > if (! -e '/usr/sbin/showmount') { > my $pkg = 'nfs-utils-clients'; > $in->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return; > $in->do_pkgs->install($pkg); > } > > If you want some more, just ask ;) > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From camio@yahoo.com Wed Mar 20 02:37:34 2002 From: camio@yahoo.com (David Sankel) Date: Tue, 19 Mar 2002 18:37:34 -0800 (PST) Subject: finding .... In-Reply-To: Message-ID: <20020320023734.29314.qmail@web13206.mail.yahoo.com> --- Pixel wrote: > Lennart Augustsson writes: > > > > Diego Yanivello wrote: > > > > > > > hi, is there (in Haskell) a function like > existFile :: FilePath -> > > > > IO (Bool) ? Thanks! > > > > Using such a function is generally a bad idea > because of race conditions. > > however, real world programs use those tests since > you don't need to care > *everytime* about race conditions. (of course using > this existFile before > creating a temporary file is wrong, but existFile > has *many* other > applications) Could someone post an example of the creation of a temporary file where race conditions are important? Thanks, David J. Sankel __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/ From juhp@01.246.ne.jp Wed Mar 20 06:00:32 2002 From: juhp@01.246.ne.jp (Jens Petersen) Date: 20 Mar 2002 15:00:32 +0900 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: References: Message-ID: Jens Petersen writes: > > The problem is that the child process doesn't receive all the data which > > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > > somehow, and "hClose vonh" closes the pipe prematurely. > > > > It varies from run to run exactly which data gets through. If I cause the > > child process to read all its input immediately, the problem doesn't > > seem to occur. Normally, it does so gradually, which takes a few seconds. > > > > I'm using GHC 5.02.2 > > Quite possibly could be a bug. Lazy IO is rather subtle I > think, specially when done across pipes. I faced some > similar problem with in POpen recently. You can see how I > solved it (worked round it?) by comparing the latest release > 1.00 with the previous one 0.00.1: > > http://www.01.246.ne.jp/~juhp/haskell/popenhs/ > > In comparison Posix.runProcess allows attaching file handles > to the in, out and error pipes, which can be written to and > read from eagerly I suppose. Also I just rediscovered Manuel Chakravarty's HPL (Haskell Ports Library), which provides a rather elegant, sophisticated approach. http://www.cse.unsw.edu.au/~chak/haskell/ports/ It compiles fine under ghc-5.02.2, and using the BufferMode patch included at the end output seems to be ok, but input of more than 2048 bytes doesn't seem to be being handled reliably. Eg with the test program below: % test-processes ping localhost works (with the aforementioned patch below to Processes.hs), but % cat 4096 | test-processes cat [4096 is a file of 4096 chars] mostly gives no output, but occasionally I see Warning: Ports.listenToPort: Attempted to listen to a closed port! Needs some debugging I guess. :) Jens -- ghc -o test-processes `ports-config --cflags --libs` test-processes.hs module Main where import Processes import Ports import IO (openFile, hGetContents, IOMode(..), hSetBuffering, BufferMode(..)) import Monad (unless) main :: IO() main = do inpt <- getContents withPorts [] $ \ (cmd:args) -> do outpt <- newPort ' ' errpt <- newPort ' ' let p = proc cmd args p inpt outpt errpt putStrLn "output:" out <- listenToPort outpt mapM_ putStrLn $ lines out putStrLn "error:" errclosed <- isClosedPort errpt unless errclosed $ do err <- listenToPort errpt putStr err putStrLn "test finished" Index: Processes.hs =================================================================== RCS file: /home/chakcvs/cvs/ports/lib/Processes.hs,v retrieving revision 1.7 diff -u -r1.7 Processes.hs --- Processes.hs 2001/07/04 16:15:52 1.7 +++ Processes.hs 2002/03/20 05:28:33 @@ -145,6 +145,8 @@ stdoutWriteHandle <- fdToHandle stdoutWriteFD stderrReadHandle <- fdToHandle stderrReadFD stderrWriteHandle <- fdToHandle stderrWriteFD + hSetBuffering stdoutReadHandle LineBuffering + hSetBuffering stderrReadHandle LineBuffering -- -- the child must close the pipe ends that it doesn't use (especially, the -- write end) From Jon.Fairbairn@cl.cam.ac.uk Wed Mar 20 10:18:56 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 20 Mar 2002 10:18:56 +0000 Subject: finding .... In-Reply-To: Your message of "Tue, 19 Mar 2002 18:37:34 PST." <20020320023734.29314.qmail@web13206.mail.yahoo.com> Message-ID: <8240.1016619536@cl.cam.ac.uk> > Could someone post an example of the creation of a > temporary file where race conditions are important? /any/ programme that does this on a multi-process system. Between the test for existence and the creation, some other process could have created a file of the same name. Then the create fails because of insufficient permissions, so the programme has to deal with failure anyway, or it succeeds and stomps on the data belonging to the other process. do possible_handle <- try $ openFile "whatever" ReadMode case possible_handle = of (Right handle) -> do_things_to handle (Left error) -> do whatever you would have done had the existence test returned false is no more complex than a version using an existence test, but to create a file for writing, surely we need an openNewFile primitive? Otherwise we might open on a file that already exists and hit the "stomp" error mentioned above. J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From dfeuer@cs.brown.edu Wed Mar 20 10:26:13 2002 From: dfeuer@cs.brown.edu (David Feuer) Date: Wed, 20 Mar 2002 05:26:13 -0500 Subject: finding .... In-Reply-To: <8240.1016619536@cl.cam.ac.uk>; from Jon.Fairbairn@cl.cam.ac.uk on Wed, Mar 20, 2002 at 10:18:56AM +0000 References: <20020320023734.29314.qmail@web13206.mail.yahoo.com> <8240.1016619536@cl.cam.ac.uk> Message-ID: <20020320052612.B8025@cslab7e.cs.brown.edu> On Wed, Mar 20, 2002, Jon Fairbairn wrote: > > Could someone post an example of the creation of a > > temporary file where race conditions are important? > > /any/ programme that does this on a multi-process system. Occasionally, the presence or absence of a file (usually empty) of a certain name in a certain directory is used for communication between processes on a multi-process system. David From Jon.Fairbairn@cl.cam.ac.uk Wed Mar 20 10:31:28 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 20 Mar 2002 10:31:28 +0000 Subject: using less stack In-Reply-To: Your message of "Tue, 19 Mar 2002 11:15:28 GMT." <3C971DD0.1030002@aber.ac.uk> Message-ID: <8291.1016620288@cl.cam.ac.uk> > Thanks for all the advice. In the end, I couldn't make $! work for me = > (it always seems to be harder than I think it will be to use it, and $!= = > and deepSeq makes my code run slowly). = :-( > But a continuation passing style foldl worked wonderfully. As Jay Cox pointed out by email, my answer was rot because I had confused foldl and foldr > I now have: > = > > cpsfold f a [] =3D a > > cpsfold f a (x:xs) =3D f x a (\y -> cpsfold f y xs) > = > and f takes a continuation, Bob's my uncle, and I have a program that = > runs quickly in constant space! Good. I'm curious to know from other readers whether continuations like this are the only way of solving it, though. J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From Jon.Fairbairn@cl.cam.ac.uk Wed Mar 20 10:33:17 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 20 Mar 2002 10:33:17 +0000 Subject: finding .... In-Reply-To: Your message of "Wed, 20 Mar 2002 05:26:13 EST." <20020320052612.B8025@cslab7e.cs.brown.edu> Message-ID: <8314.1016620397@cl.cam.ac.uk> > On Wed, Mar 20, 2002, Jon Fairbairn wrote: > > > Could someone post an example of the creation of a > > > temporary file where race conditions are important? > > = > > /any/ programme that does this on a multi-process system. > = > Occasionally, the presence or absence of a file (usually empty) of a > certain name in a certain directory is used for communication between > processes on a multi-process system. Hence the need for an atomic openNewFile. -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From olaf@cs.york.ac.uk Wed Mar 20 10:42:15 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Wed, 20 Mar 2002 10:42:15 +0000 Subject: Haskell slicing tool? References: <20020319132039.37e63d70.senganb@ia.nsc.com> Message-ID: <3C986787.830C8F9B@cs.york.ac.uk> Sengan.Baring-Gould@nsc.com wrote: > > > Are there any tools to perform program slicing on Haskell? > > > I often find myself wanting to find all "fromJusts" invoked > > > from the current function, or all functions that use a > > > particular member of my monad's ADT. > Actually I was hoping for a static tool. I'd be interested to learn for what purpose you want this kind of information and also more precisely what you would like such a static tool to do for you. Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From trinder@cee.hw.ac.uk Wed Mar 20 11:51:57 2002 From: trinder@cee.hw.ac.uk (Phil Trinder) Date: Wed, 20 Mar 2002 11:51:57 +0000 (GMT Standard Time) Subject: question about concurrency implementation In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C608AA4458@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: Dean, > > If the costs are the same, does that rely on there being no true > > concurrency in > > the current implementations? > > It depends what you mean by true concurrency: from the point of view of > the Haskell programmer, GHC's implementation of concurrency is "almost" > preemptive, because we can context-switch at any allocation. Most > computation does some allocation, but it's possible to write functions > that don't (although these tend to be on the trivial side - an optimised > nfib won't allocate, for example). We could artificially cause all > computation to do some allocation to avoid this problem, but we haven't > found it necessary so far. > > But I suspect by "true concurrency" you're referring at the kind of > concurrent processes that can be executed on multiple CPUs > simultaneously. We did investigate doing this a while back, and found > that the locking required on thunks was very expensive (slowed down the > program by at least 2x on the bog-standard SMP machine we had here). > However there are some clever techniques that can be used to reduce the > cost - giving each process its own private allocation area and only > degrading to full locking for access to the shared portion of the heap > is one such technique we experimented with briefly but I don't have any > concrete benchmarks I'm afraid. Also you really need a multithreaded > garbage collector, which is a lot of work. We've developed a Haskell extension that exhibit's "true concurrency" on multiple CPUs, it's called Glasgow distributed Haskell (GdH). It's primarily designed for distribution (i.e. multiple stateful threads on multiple processors), but can be used to build parallel programs too. For more info see http://www.cee.hw.ac.uk/~dsg/gdh/ Phil -------------------------------------------------- Phil Trinder Department of Computing and Electrical Engineering Heriot Watt University Riccarton Edinburgh, EH14 4AS E-mail: trinder@cee.hw.ac.uk Teleph: +44 (0)131 451 3435 Depart: +44 (0)131 451 3328 Fasmly: +44 (0)131 451 3327 Intrnt: http://www.cee.hw.ac.uk/~trinder From C.Reinke@ukc.ac.uk Wed Mar 20 18:12:12 2002 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Wed, 20 Mar 2002 18:12:12 +0000 Subject: using less stack In-Reply-To: Message from Jon Fairbairn of "Wed, 20 Mar 2002 10:31:28 GMT." <8291.1016620288@cl.cam.ac.uk> Message-ID: > > > cpsfold f a [] ú > > > cpsfold f a (x:xs) ÿ x a (\y -> cpsfold f y xs) > > > > and f takes a continuation, Bob's my uncle, and I have a program that > > runs quickly in constant space! > > Good. I'm curious to know from other readers whether > continuations like this are the only way of solving it, > though. Actually, and quite apart from it being cumbersome to use, I've got my doubts about whether this cpsfold really does the job (is that just me missing some point?-). Also, I'm curious to know why the usual strict variant of foldl doesn't help in this case? foldl' f a [] = a foldl' f a (x:xs) = (foldl' f $! f a x) xs or, with the recently suggested idiom for strictness, tracing and other annotations:-) annotation = undefined strict a = seq a False foldl' f a l | strict a = annotation foldl' f a [] = a foldl' f a (x:xs) = foldl' f (f a x) xs Claus From hdaume@ISI.EDU Wed Mar 20 18:28:13 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 20 Mar 2002 10:28:13 -0800 (PST) Subject: using less stack In-Reply-To: Message-ID: > strict a = seq a False > > foldl' f a l | strict a = annotation > foldl' f a [] = a > foldl' f a (x:xs) = foldl' f (f a x) xs Or, perhaps strict a = a `deepSeq` False or strict a = rnf a `seq` False if you prefer the rnf notation instead. depending on what you want... \begin{rant} I think the whole seq thing is very confusing for beginning/intermediate haskell programmers. I was very confused for a long time as to why > (unsafePerformIO (putStrLn "Hello")) `seq` 5 would print "Hello", but > [unsafePerformIO (putStrLn "Hello")] `seq` 5 would not. this goes back to the earlier discussion of "does a haskell programmer need to know how the compiler works." while you could argue this isn't exactly a compiler issue and that the semantics of seq *are* well defined outside any particular compiler, you do need to know something about how the graph reduction happens, etc., in order to understand exactly what is being evaluated on the left hand side of `seq`. I would almost prefer if the semantics of `seq` were instead those of rnf or deepSeq, so long as either (a) we were allowed to derive DeepSeq or NFData, or (b) if the compiler would just do it itself. Yes, this would cut down on the expressions which we could `seq`, but does that really matter. I mean, how often are we going to say: > (+) `seq` 5 What the heck is that supposed to mean? I would almost *prefer* if an expression like that didn't typecheck. Since seq isn't lambda definable anyway, I don't see any particular reason the compiler couldn't just reduce to normal form instead of weak head normal form for seqs. Perhaps artifically introduce an NFData instance for everything so the above doesn't typecheck. But that's just me :) \end{rant} From ajc99@aber.ac.uk Wed Mar 20 18:45:15 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Wed, 20 Mar 2002 18:45:15 +0000 Subject: using less stack References: Message-ID: <3C98D8BB.5060001@aber.ac.uk> [cpsfold omitted] > Actually, and quite apart from it being cumbersome to use, I've got > my doubts about whether this cpsfold really does the job (is that > just me missing some point?-). It does the job for me! In practical terms I can see it works. I'm not an expert - I may have this all wrong, but perhaps the point you're looking for is that the arguments to f are brought to the very outside of the expression, and hence available for evaluation. Imagine for [x1,x2,x3,x4] from foldr: f x1 (f x2 (f x3 (f x4 a))) from foldl: f (f (f (f a x1) x2) x3) x4 Neither are available for immediate evaluation. In the case of foldr the end of the list (x4) has to be reached before anything can be evaluated. In the case of foldl the first function to be pulled upon is the outermost f, which then can't do anything useful (in my case) without evaluating its second argument, and so on. with the cpsfold I get f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4) so x1 and a are available immediately for f to use, and f x1 a is the outermost expression so will be evaluated first. See for yourself with the following (difference can be seen in ghc with standard 1M stack): > answer1 = foldr larger 0 [1..500000] > answer2 = foldl larger 0 [1..500000] > answer3 = cpsfold cpslarger 0 [1..500000] > larger x y = if x > y then x else y > cpslarger x y k = if x > y then k x else k y > Also, I'm curious to know why the usual strict variant of foldl > doesn't help in this case? > > foldl' f a [] = a > foldl' f a (x:xs) = (foldl' f $! f a x) xs Because $! and seq only evaluates enough to make sure the answer is not bottom, and if my f is complex then it doesn't do enough. Amanda From olaf@cs.york.ac.uk Wed Mar 20 19:05:37 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Wed, 20 Mar 2002 19:05:37 +0000 Subject: using less stack References: <3C98D8BB.5060001@aber.ac.uk> Message-ID: <3C98DD81.6CE0CEE0@cs.york.ac.uk> > with the cpsfold I get > > f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4) > > so x1 and a are available immediately for f to use, and f x1 a is the > outermost expression so will be evaluated first. Yes, however, if f just calls its continuation without forcing the evaluation of at least its second argument, e.g. f x y k = k (g x y) you get f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4)))) => f x2 (g x1 a) (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4))) => f x3 (g x2 (g x1 a)) (\y3 -> f x4 y4 (\y4 -> y4))) => f x4 (g x3 (g x2 (g x1 a))) (\y4 -> y4) => g x4 (g x3 (g x2 (g x1 a))) like the foldr. > > larger x y = if x > y then x else y > > cpslarger x y k = if x > y then k x else k y Yes, with this definition of `cpslarger' no stack is used, because the comparison forces evaluation. With cpslarger x y k = k (larger x y) it does not work. Still, if your definition of cpslarger is natural for your application, it is a nice solution of the problem. Ciao, Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From C.Reinke@ukc.ac.uk Wed Mar 20 20:32:19 2002 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Wed, 20 Mar 2002 20:32:19 +0000 Subject: using less stack In-Reply-To: Message from Amanda Clare of "Wed, 20 Mar 2002 18:45:15 GMT." <3C98D8BB.5060001@aber.ac.uk> Message-ID: > > Actually, and quite apart from it being cumbersome to use, I've got > > my doubts about whether this cpsfold really does the job (is that > > just me missing some point?-). > > It does the job for me! In practical terms I can see it works. ..[explanation omitted].. I didn't express myself well: I don't doubt that you solved your problem by using cpsfold, but the cpsfold alone doesn't do the trick. It just translates the implicit continuation (which uses stack space) into an explicit continuation function (which uses heap space). So there's something else going on. As you explained, having the continuation explicit makes it easier to get a handle on what happens next at every step, which is the usual reason for using CPS style. And if neither the cautious evaluate-to-weak-head-normal-form seq nor the all-out evaluate-to-normal-form deepSeq do the job for you, I can well imagine that CPS style permits you to fine-tune evaluation to the needs of your application. But as Olaf has pointed out, having that much control can be a bit of a fragile construction. So I was just wondering about the specific use of fold in your application, and how you've redefined your operator to make use of your CPS version of fold (in order to solve the space problem). Incidentally, cpsfold processes the list in reversed order, which may or may not matter, depending on the operator passed to it. Hugs session for: Prelude.hs R.hs folds.hs Main> foldr (-) 0 [1..4] (1 - (2 - (3 - (4 - 0)))) Main> foldl (-) 0 [1..4] ((((0 - 1) - 2) - 3) - 4) Main> cpsfold (\x y c-> c $ x - y) 0 [1..4] (4 - (3 - (2 - (1 - 0)))) Claus -- Research Opportunity: Refactoring Functional Programs (UKC) Closing date: Friday 22 March 2002 <------- !!! http://www.cs.ukc.ac.uk/vacancies_dir/r02-24.html From post@volker-wysk.de Wed Mar 20 21:08:51 2002 From: post@volker-wysk.de (Volker Wysk) Date: 20 Mar 2002 22:08:51 +0100 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: References: Message-ID: <1016658532.3061.43.camel@volker> On Mit, 2002-03-20 at 07:00, Jens Petersen wrote: > Jens Petersen writes: > > > > The problem is that the child process doesn't receive all the data which > > > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > > > somehow, and "hClose vonh" closes the pipe prematurely. > > > > > > It varies from run to run exactly which data gets through. If I cause the > > > child process to read all its input immediately, the problem doesn't > > > seem to occur. Normally, it does so gradually, which takes a few seconds. > > > > > > I'm using GHC 5.02.2 > > > > Quite possibly could be a bug. Lazy IO is rather subtle I > > think, specially when done across pipes. I faced some > > similar problem with in POpen recently. You can see how I > > solved it (worked round it?) by comparing the latest release > > 1.00 with the previous one 0.00.1: > > > > http://www.01.246.ne.jp/~juhp/haskell/popenhs/ POpen-1.0.0 contains the same bug which I made. It doesn't ensure that the values which are needed after the call of forkProcess, before that of executeFile, are fully evaluated. So, if they are read lazily from a stream, the newly spawned child process reads data from a stream which it shares with its parent, making it disappear from the parent's input. In this situation, this sure isn't intended. Inserting the following lines just before the line "pid <- forkProcess", in POpen.hs, would force the corresponding values to be evaluated, so no data will be lost. seq (length path) $ seq (sum (map length args)) $ return () when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) (fromJust env))) $ return () when (isJust dir) $ seq (length (fromJust dir)) $ return () I'm also not sure what this part is supposed to do: inr <- if (isJust inpt) then do (inr', inw) <- createPipe hin <- fdToHandle inw hPutStr hin $ fromJust inpt hClose hin return $ Just inr' else return Nothing Doesn't it write the input data to a pipe which no process reads from..?? Volker From sohufm365sina@fm365.com Thu Mar 21 05:54:11 2002 From: sohufm365sina@fm365.com (sohufm365sina@fm365.com) Date: Thu, 21 Mar 2002 05:54:11 Subject: ¹âÁÙÌøÎèÀ¼£¬ÓкñÀñÅÉËÍ------ÊýÂëÀñÆ·£¡ Message-ID: <200202180521.FAA27879@netpower> ÌøÎèÀ¼¹ºÎïÉ̳Ç
 
¡¤ËùÓÐÌøÎèÀ¼Ð¡¢ÀÏÓû§¶¼½«Ãâ·Ñ»ñµÃ¼ÛÖµ10ÔªµÄÌøÎèȯ
¡¤¹ºÎォ°´"¹ºÎïÿ100ÔªËÍ5Ôª"µÄ·½Ê½»ñÔùÌøÎèȯ
¡¤ÌøÎèÀ¼É̳ÇÌØ±ðÔùËÍMP3»ú¡¢ÊÖ»úµÈÌØ±ðÔùÆ·
1999-2001°æÈ¨ËùÓÐ ÌøÎèÀ¼¹ºÎï³Ç
°´ÕÕ¹ú¼Ê¹ßÀý£¬Ö»Òª±¾Óʼþ°üÀ¨¡°ÁªÏµÐÅÏ¢¡±ºÍ¡°ÒƳýÐÅÏ¢¡±£¬¾Í²»Ó¦±»¿´×öÀ¬»øÐżþ¡£Èç¹ûÄúÏëÎÒÃÇ´ÓÓʼþÁбíÖÐÒÆ³ýÄúµÄÓʼþµØÖ·£¬ÇëÓÃÄúÏëÒÆ³ýµÄÐÅÏäµã´Ë·¢ÐÅ£¬ÐżþÖ÷Ì⣺¡°Remove"£¬Èç¹û±¾Óʼþ¸øÄú´øÀ´Á˲»±ã£¬ÎÒÃÇÉî±íǸÒâ¡£
Under Bill s.1618 Title III passed by the 105th U.S. Congress this mail cannot be considered Spam as long as we include contact information and a remove link for removal from our mailing list. To be removed from our mailing list reply with "remove" and include your "original email address/addresses" in the subject heading send to here. Include complete address/addresses and/or domain to be removed. We will immediately update it accordingly. We apologize for the inconvenience if any caused.
From rakdver@hotmail.com Thu Mar 21 07:44:51 2002 From: rakdver@hotmail.com (Zdenek Dvorak) Date: Thu, 21 Mar 2002 07:44:51 +0000 Subject: Haskell puzzles! Message-ID: Hello. >- All the answers are at the end of this mail. > >----------------------------------------------------- >1) Are e1 and e2 equal? > > > f (x:xs) y = x > > g (x:xs) = \y -> x > > > > e1 = seq (f []) 1 > > e2 = seq (g []) 1 Should not these be f (x:xs) y = y g (x:xs) = \y -> y ? Otherwise, both e1 and e2 are obviously undefined. Zdenek Dvorak _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com From kyagrd@bawi.org Thu Mar 21 08:52:15 2002 From: kyagrd@bawi.org (Ahn Ki-yung) Date: Thu, 21 Mar 2002 17:52:15 +0900 Subject: Hugs Bug ! Message-ID: <3C999F3F.97BF994D@bawi.org> Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!} Prelude> f 1 where f x = x : f x ==================== in unix/linux proper error msg comes out and back to interpreter. ERROR - Control stack overflow =========== but in windows 2000 Then suddnly interpreter fails and the red (X) popup window pops up. hugs.exe - application programm error unknown software exception (0xc000fd) ... blabla From rjmh@cs.chalmers.se Thu Mar 21 09:18:21 2002 From: rjmh@cs.chalmers.se (John Hughes) Date: Thu, 21 Mar 2002 10:18:21 +0100 (MET) Subject: using less stack Message-ID: <200203210918.KAA02073@muppet30.cs.chalmers.se> \begin{rant} I think the whole seq thing is very confusing for beginning/intermediate haskell programmers. I was very confused for a long time as to why > (unsafePerformIO (putStrLn "Hello")) `seq` 5 would print "Hello", but > [unsafePerformIO (putStrLn "Hello")] `seq` 5 would not. ... I would almost prefer if the semantics of `seq` were instead those of rnf or deepSeq, so long as either (a) we were allowed to derive DeepSeq or NFData, or (b) if the compiler would just do it itself. Yes, this would cut down on the expressions which we could `seq`, but does that really matter. ... \end{rant} Well, seq isn't there to enable sequencing of unsafe IO. It's there to enable space optimisation. When heap profiling was first developed for Haskell, it fairly soon became clear that fine control of evaluation order was often the key to fixing space leaks. (Note: "fine control" includes making things lazier at times via ~ patterns, but also making things stricter at times). Seq is designed so that you can take ANY expression and move its evaluation where you want. If we only had deepSeq, we could only move an expression together with all of its subexpressions -- not good if a lazy list needs to be forced a little earlier! As for putting seq in a class excluding functions, that would mean that if you happened to use a function to represent an abstract data type, you would suddenly be unable to control the evaluation order of programs using that abstract data type -- and so potentially, unable to fix space leaks in them. That would make functions a kind of second class citizen: you would always know, when choosing a representation for an ADT, that if you chose a function then that would have an impact on space debugging later... If one is going to provide control of evaluation order (and it IS important), why surround it with complex rules and restrictions, when seq provides it simply for every single expression in the language? Space debugging is a bit of a hobby horse of mine, and I know it is considered by many to be something of a black art. It isn't so hard really: just run the heap profiler, find the leaks, and often the fix involves changing evaluation order. Use seq or ~ to do so. (There can be other fixes also, but these are a good start). I can't emphasize too much how useful the heap profiler is for building good intuitions about how programs are evaluated. I'd strongly advise intermediate Haskell programmers to spend some time using it: one learns a LOT! John Hughes From trinder@cee.hw.ac.uk Thu Mar 21 09:19:44 2002 From: trinder@cee.hw.ac.uk (Phil Trinder) Date: Thu, 21 Mar 2002 09:19:44 +0000 (GMT Standard Time) Subject: question about concurrency implementation In-Reply-To: Message-ID: Dean, Alastair Reid wrote: > > Just to be sure we agree on terminology: some people like to > > distinguish between "parallelism" and "concurrency". > > > > Parallelism is a way of going faster but doesn't change your > > programming model. Implemented correctly, a parallel implementation > > yields the same results as a sequential implementation - it just runs > > faster. (This is ignoring the effects of interaction with the outside > > world, of course - since that can also affect determinism.) Parallel > > Haskell adds "par" and friends (operations which have no effect on the > > semantics of your program). > > > > Concurrency changes your programming model. A concurrent program is > > allowed to give different results and interesting interactions > > (including race conditions) between threads. A concurrent program may > > run on a single processor. Concurrent Haskell adds forkIO, > > killThread, MVars, etc (operations which affect not just the semantics > > of your program but also the way the semantics are defined). We distinguish between parallel, concurrent and distributed depending on the number of processors and whether threads are *stateful*, i.e. access stateful objects like Mvars or Files, or *stateless*. That is: Sequential, e.g. Haskell 98: 1 PE, 1 Stateful thread, 0 stateless threads Concurrent, e.g. Concurrent Haskell: 1 PE, N Stateful thread, 0 stateless threads Parallel, e.g. GpH: N PEs, 1 Stateful thread, N stateless threads Distributed, e.g. GdH: N PEs, N Stateful thread, N stateless threads In fact these languages form an inclusion hierarchy, e.g. GdH is a superset of both GpH and Concurrent Haskell: GdH / \ GpH Conc. Haskell \ / Haskell 98 Dean Herington wrote: > I've asked these questions in order to convince myself that multiple > threads can (and will) cooperate in lazily evaluating a value they share, > without need for any special programming. In particular, I plan to have > multiple threads share values whose computations involve uses of > `unsafePerformIO` (the safety of which my application's usage pattern > guarantees). The key issue is whether the 'values' are stateful (e.g. Mvars or Files) or stateless (e.g. a shared Haskell variable). Sharing stateless objects between parallel, concurrent, or distributed threads preserves sequential semantics, but sharing stateful objects can introduce non-determinism, unless you have additional properties. Phil -------------------------------------------------- Phil Trinder Department of Computing and Electrical Engineering Heriot Watt University Riccarton Edinburgh, EH14 4AS E-mail: trinder@cee.hw.ac.uk Teleph: +44 (0)131 451 3435 Depart: +44 (0)131 451 3328 Fasmly: +44 (0)131 451 3327 Intrnt: http://www.cee.hw.ac.uk/~trinder From wflp2002@dimi.uniud.it Wed Mar 20 19:43:40 2002 From: wflp2002@dimi.uniud.it (WFLP2002 Organizing Committee) Date: Wed, 20 Mar 2002 20:43:40 +0100 Subject: [E-CFP] WFLP2002 - deadline EXTENSION Message-ID: --============_-1195469066==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Dear Colleague The submission deadline for the WFLP 2002 has been extended till March 27, 2002 WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming. WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration. For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/ Papers are due by March 27, 2002. This is a firm deadline. You can submit papers following the electronic submission process at: http://www.dimi.uniud.it/~wflp2002/submit/ We hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. -- WFLP 2002 Organizing Committee http://www.dimi.uniud.ut/~wflp2002/ --============_-1195469066==_ma============ Content-Type: text/html; charset="us-ascii" [E-CFP] WFLP2002 - deadline EXTENSION
Dear Colleague

The submission deadline for the WFLP 2002 has been extended till
      March 27, 2002
WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming.  WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration.  For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/

Papers are due by March 27, 2002. This is a firm deadline.

You can submit papers following the electronic submission process at:

http://www.dimi.uniud.it/~wflp2002/submit/

We hope  that this  "Call For  Papers" will be  useful for  your work.
Please  forward  the  following  to  anybody  who  you  think  may  be
interested.  Our apologies if you received multiple copy of this.
-- 
WFLP 2002 Organizing Committee
http://www.dimi.uniud.ut/~wflp2002/
--============_-1195469066==_ma============-- From gmh@Cs.Nott.AC.UK Thu Mar 21 11:57:20 2002 From: gmh@Cs.Nott.AC.UK (Graham Hutton) Date: Thu, 21 Mar 2002 11:57:20 +0000 Subject: using less stack Message-ID: <20020321115730.2DA034223CC@www.haskell.org> > In the case of foldr the end of the list has to be > reached before anything can be evaluated. This is perhaps a good time to point out the common missconception that foldr can only be used to define functions that process the elements of lists in right-to-left order. For a discussion of this point, see section 5 of my JFP tutorial paper on foldr, which (amonst other things) shows how to sum a list of numbers in left-to-right order using foldr: http://www.cs.nott.ac.uk/~gmh/fold.pdf Graham +----------------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | Foundations of Programming Group Web : http://www.cs.nott.ac.uk/~gmh | | School of Computer Science and IT | | University of Nottingham | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB Phone : +44 (0)115 951 4220 | | United Kingdom Fax : +44 (0)115 951 4254 | +----------------------------------------------------------------------------+ From rjchaaft@cs.uu.nl Thu Mar 21 13:38:05 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Thu, 21 Mar 2002 14:38:05 +0100 Subject: Haskell puzzles! In-Reply-To: Message-ID: <4.3.0.20020321143034.00b30018@pop.students.cs.uu.nl> Zdenek Dvorak wrote: >>----------------------------------------------------- >>1) Are e1 and e2 equal? >> >> > f (x:xs) y = x >> > g (x:xs) = \y -> x >> > >> > e1 = seq (f []) 1 >> > e2 = seq (g []) 1 > >Should not these be > >f (x:xs) y = y >g (x:xs) = \y -> y >? >Otherwise, both e1 and e2 are obviously undefined. That seems to be obvious, but e1 is NOT undefined! That's the point Daan makes. seq forces it's first argument and returns the second one. However, because f is partially parametrized, seq doesn't change anything in f and just returns 1. The right-hand-side of f is not involved at all! In e2 though, g is fully parametrized, so seq behaves as you expect and the pattern match failes. Rijk-Jan From rjchaaft@cs.uu.nl Thu Mar 21 14:04:35 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Thu, 21 Mar 2002 15:04:35 +0100 Subject: Hugs Bug ! In-Reply-To: <3C999F3F.97BF994D@bawi.org> Message-ID: <4.3.0.20020321150155.00b2cef8@pop.students.cs.uu.nl> >but in windows 2000 > >Then suddnly interpreter fails and >the red (X) popup window pops up. > >hugs.exe - application programm error > > unknown software exception (0xc000fd) ... blabla Are you sure you have the very very very latest download? There have been some undocumented updates of the December 2001 release of Hugs. Download the very latest release and try it again. I tried you expression on Win2000, with Hugs Dec 2001, downloaded last week, and it runs in constant space for an unlimited time. Rijk-Jan From petersen@redhat.com Thu Mar 21 14:20:17 2002 From: petersen@redhat.com (Jens Petersen) Date: 21 Mar 2002 23:20:17 +0900 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: <1016658532.3061.43.camel@volker> References: <1016658532.3061.43.camel@volker> Message-ID: Hi Volker, Volker Wysk writes: > On Mit, 2002-03-20 at 07:00, Jens Petersen wrote: > > Jens Petersen writes: > > > > > > The problem is that the child process doesn't > > > > receive all the data which the parent sends. It's as > > > > if "hPutStr vonh txt" sends the data lazily somehow, > > > > and "hClose vonh" closes the pipe prematurely. > > > > > > > > It varies from run to run exactly which data gets > > > > through. If I cause the child process to read all > > > > its input immediately, the problem doesn't seem to > > > > occur. Normally, it does so gradually, which takes a > > > > few seconds. > > > > > > > > I'm using GHC 5.02.2 > > > > > > Quite possibly could be a bug. Lazy IO is rather subtle I > > > think, specially when done across pipes. I faced some > > > similar problem with in POpen recently. You can see how I > > > solved it (worked round it?) by comparing the latest release > > > 1.00 with the previous one 0.00.1: > > > > > > http://www.01.246.ne.jp/~juhp/haskell/popenhs/ > > POpen-1.0.0 contains the same bug which I made. It doesn't ensure that > the values which are needed after the call of forkProcess, before that > of executeFile, are fully evaluated. So, if they are read lazily from a > stream, the newly spawned child process reads data from a stream which > it shares with its parent, making it disappear from the parent's input. > In this situation, this sure isn't intended. Perhaps you could give an explicit example? > Inserting the following lines just before the line "pid <- forkProcess", > in POpen.hs, would force the corresponding values to be evaluated, so no > data will be lost. > > seq (length path) $ seq (sum (map length args)) $ return () > when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) > (fromJust env))) $ return () > when (isJust dir) $ seq (length (fromJust dir)) $ return () Hmmm, I don't really see why this is necessary. Don't the lazy values of "path", "env" and "dir" just get evaluated when they're needed here as normal? (If what you say is true though it would be simpler just to use "$!" or "!"s for strict evaluation I guess.) I would be more worried about the input stream string not being complete when the input handle is closed. > I'm also not sure what this part is supposed to do: > > inr <- if (isJust inpt) then > do > (inr', inw) <- createPipe > hin <- fdToHandle inw > hPutStr hin $ fromJust inpt > hClose hin > return $ Just inr' > else > return Nothing It returns the output end of a pipe containing the input string if one is given. > Doesn't it write the input data to a pipe which no process reads > from..?? Nope, "doTheBusiness" dup2's it to the stdin of the subprocess: (outr, outw) <- createPipe (errr, errw) <- createPipe pid <- forkProcess case pid of Nothing -> doTheBusiness inr outw errw -- *** Just p -> do -- close other end of pipes in here when (isJust inr) $ fdClose $ fromJust inr fdClose outw fdClose errw hout <- fdToHandle outr outstrm <- hGetContents hout herr <- fdToHandle errr errstrm <- hGetContents herr return (outstrm, errstrm , p) where doTheBusiness :: Maybe Fd -- stdin -> Fd -- stdout -> Fd -- stderr -> IO (String, String, ProcessID) -- (stdout, stderr) doTheBusiness inr outw errw = do maybeChangeWorkingDirectory dir when (isJust inr) $ dupTo (fromJust inr) stdInput -- *** dupTo outw stdOutput dupTo errw stdError executeFile path True args env -- for typing, should never actually run error "executeFile failed!" Jens From anatoli@yahoo.com Thu Mar 21 16:35:27 2002 From: anatoli@yahoo.com (anatoli) Date: Thu, 21 Mar 2002 08:35:27 -0800 (PST) Subject: Lambda over types. Message-ID: <20020321163527.92822.qmail@web14201.mail.yahoo.com> I apologise in case this doesn't make any sense. ghc -fglasgow-exts -fallow-undecidable-instances allows constructs which amount to lambda abstraction over types. I've written a small untyped lambda calculus interpreter in the Haskell class/instance sublanguage, just to prove this point. (The terms are Haskell *types*.) Using this interpreter as a basis, and adapting it as necessary, I can now write arbitrary "functions" [1] that take types to types. But of course it's a pain to write them like that. Maybe, after all, it does make sense to have a dedicated lambda-over-types Haskell extension which is convenient to use? [1] - I cannot produce an equivalent of > type Foo a b c = a b c but I can do an equivalent of this: > fun :: T1 -> T2 -> T3 -> T1 T2 T3 -- anatoli __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ From anatoli@yahoo.com Thu Mar 21 17:37:46 2002 From: anatoli@yahoo.com (anatoli) Date: Thu, 21 Mar 2002 09:37:46 -0800 (PST) Subject: Lambda over types. In-Reply-To: Message-ID: <20020321173746.48681.qmail@web14202.mail.yahoo.com> --0-681966285-1016732266=:42373 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hal Daume III wrote: > I'd be interested in seeing how you do this. I attempted such a thing a > while back but was unsuccessful. Attached are two interpreters: one for untyped lambda calculus, and one for an Unlambda-style language (combinators). Of course pure lambda terms are not very useful Haskell types. You may use your own types as primitive terms by defining instances of Subst and/or Eval of them. -- anatoli __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ --0-681966285-1016732266=:42373 Content-Type: application/x-unknown; name="lambda.lhs" Content-Transfer-Encoding: base64 Content-Description: lambda.lhs Content-Disposition: attachment; filename="lambda.lhs" VGhlIGNsYXNzIG1ldGhvZHMsIGxhbWJkYVN1YnN0IGFuZCBsYW1iZGFFdmFs LCBhcmUKZm9yIGRlYnVnZ2luZyBmcm9tIEh1Z3MvZ2hjaSBwcm9tcHQuClRv IGV2YWx1YXRlIGEgdGVybSwgdHlwZToKCkxhbWJkYT46dCBsYW1iZGFFdmFs IDx0ZXJtPgoKZm9yIGluc3RhbmNlCgpMYW1iZGE+OnQgbGFtYmRhRXZhbCAo QSAoTCBYIFgpIChMIFkgWikpCkwgWSBaCkxhbWJkYT46dCBsYW1iZGFFdmFs IChBIChMIFggKEEgWCBYKSkgKEwgWCAoQSBYIFgpKSkKPGRvZXMgbm90IHRl cm1pbmF0ZT4KCj4gbW9kdWxlIExhbWJkYSB3aGVyZQoKVmFyaWFibGVzIAoK PiBkYXRhIFggPSBYCj4gZGF0YSBZID0gWQo+IGRhdGEgWiA9IFoKPiBkYXRh IFQgPSBUCgpMYW1iZGEgYWJzdHJhY3Rpb24gOiBceC0+eQoKPiBkYXRhIEwg eCB5ID0gTCB4IHkKCkFwcGxpY2F0aW9uIDogeCB5Cgo+IGRhdGEgQSB4IHkg PSBBIHggeQoKU3Vic3RpdHV0aW9uCgo+IGNsYXNzIFN1YnN0IHYgZSB0IHIg fCB2IGUgdCAtPiByIHdoZXJlCj4gICBsYW1iZGFTdWJzdCA6OiB2IC0+IGUg LT4gdCAtPiByCj4gICBsYW1iZGFTdWJzdCA9IHVuZGVmaW5lZAoKVHJpdmlh bCBzdWJzdGl0dXRpb25zCgo+IGluc3RhbmNlIFN1YnN0IFggYSBYIGEKPiBp bnN0YW5jZSBTdWJzdCBYIGEgWSBZCj4gaW5zdGFuY2UgU3Vic3QgWCBhIFog Wgo+IGluc3RhbmNlIFN1YnN0IFggYSBUIFQKCj4gaW5zdGFuY2UgU3Vic3Qg WSBhIFggWAo+IGluc3RhbmNlIFN1YnN0IFkgYSBZIGEKPiBpbnN0YW5jZSBT dWJzdCBZIGEgWiBaCj4gaW5zdGFuY2UgU3Vic3QgWSBhIFQgVAoKPiBpbnN0 YW5jZSBTdWJzdCBaIGEgWCBYCj4gaW5zdGFuY2UgU3Vic3QgWiBhIFkgWQo+ IGluc3RhbmNlIFN1YnN0IFogYSBaIGEKPiBpbnN0YW5jZSBTdWJzdCBaIGEg VCBUCgo+IGluc3RhbmNlIFN1YnN0IFQgYSBYIFgKPiBpbnN0YW5jZSBTdWJz dCBUIGEgWSBZCj4gaW5zdGFuY2UgU3Vic3QgVCBhIFogWgo+IGluc3RhbmNl IFN1YnN0IFQgYSBUIGEKClNjb3BlIHJ1bGVzCgo+IGluc3RhbmNlICAgICAg ICAgICAgICAgICAgU3Vic3QgWCBhIChMIFggYikgKEwgWCBiKQo+IGluc3Rh bmNlIFN1YnN0IFggYSBiIGMgPT4gU3Vic3QgWCBhIChMIFkgYikgKEwgWSBj KQo+IGluc3RhbmNlIFN1YnN0IFggYSBiIGMgPT4gU3Vic3QgWCBhIChMIFog YikgKEwgWiBjKQo+IGluc3RhbmNlIFN1YnN0IFggYSBiIGMgPT4gU3Vic3Qg WCBhIChMIFQgYikgKEwgVCBjKQoKPiBpbnN0YW5jZSBTdWJzdCBZIGEgYiBj ID0+IFN1YnN0IFkgYSAoTCBYIGIpIChMIFggYykKPiBpbnN0YW5jZSAgICAg ICAgICAgICAgICAgIFN1YnN0IFkgYSAoTCBZIGIpIChMIFkgYikKPiBpbnN0 YW5jZSBTdWJzdCBZIGEgYiBjID0+IFN1YnN0IFkgYSAoTCBaIGIpIChMIFog YykKPiBpbnN0YW5jZSBTdWJzdCBZIGEgYiBjID0+IFN1YnN0IFkgYSAoTCBU IGIpIChMIFQgYykKCj4gaW5zdGFuY2UgU3Vic3QgWiBhIGIgYyA9PiBTdWJz dCBaIGEgKEwgWCBiKSAoTCBYIGMpCj4gaW5zdGFuY2UgU3Vic3QgWiBhIGIg YyA9PiBTdWJzdCBaIGEgKEwgWSBiKSAoTCBZIGMpCj4gaW5zdGFuY2UgICAg ICAgICAgICAgICAgICBTdWJzdCBaIGEgKEwgWiBiKSAoTCBaIGIpCj4gaW5z dGFuY2UgU3Vic3QgWiBhIGIgYyA9PiBTdWJzdCBaIGEgKEwgVCBiKSAoTCBU IGMpCgo+IGluc3RhbmNlIFN1YnN0IFQgYSBiIGMgPT4gU3Vic3QgVCBhIChM IFggYikgKEwgWCBjKQo+IGluc3RhbmNlIFN1YnN0IFQgYSBiIGMgPT4gU3Vi c3QgVCBhIChMIFkgYikgKEwgWSBjKQo+IGluc3RhbmNlIFN1YnN0IFQgYSBi IGMgPT4gU3Vic3QgVCBhIChMIFogYikgKEwgWiBjKQo+IGluc3RhbmNlICAg ICAgICAgICAgICAgICAgU3Vic3QgVCBhIChMIFQgYikgKEwgVCBiKQoKQXBw bGljYXRpb24gc3Vic3RpdHV0aW9uCgo+IGluc3RhbmNlIChTdWJzdCB2IGUg dCByLCBTdWJzdCB2IGUgdCcgcicpID0+IFN1YnN0IHYgZSAoQSB0IHQnKSAo QSByIHInKQoKRXZhbHVhdGlvbiBydWxlcwoKPiBjbGFzcyBFdmFsIGUgZScg fCBlIC0+IGUnIHdoZXJlCj4gICBsYW1iZGFFdmFsIDo6IGUgLT4gZScKPiAg IGxhbWJkYUV2YWwgPSB1bmRlZmluZWQKClZhcmlhYmxlcyBldmFsdWF0ZSB0 byB0aGVtc2VsdmVzCgo+IGluc3RhbmNlIEV2YWwgWCBYCj4gaW5zdGFuY2Ug RXZhbCBZIFkKPiBpbnN0YW5jZSBFdmFsIFogWgo+IGluc3RhbmNlIEV2YWwg VCBUCgpTbyBpcyBsYW1iZGEgYWJzdHJhY3Rpb24KCj4gaW5zdGFuY2UgRXZh bCAoTCB2IGUpIChMIHYgZSkKCkFwcGxpY2F0aW9uIG9mIGxhbWJkYSBhYnN0 cmFjdGlvbiBpcyBldmFsdWF0ZWQgdmlhIHN1YnN0aXR1dGlvbgoKPiBpbnN0 YW5jZSAoU3Vic3QgdiBnIGUgciwgRXZhbCByIHInKSA9PiBFdmFsIChBIChM IHYgZSkgZykgcicKCkFwcGxpY2F0aW9uIG9mIGFwcGxpY2F0aW9uOiBldmFs dWF0ZSB0aGUgZnVuY3Rpb24gYW5kIHJldHJ5CkhlcmUgbGllcyB0aGUgdW5k ZWNpZGFiaWxpdHkuCgo+IGluc3RhbmNlIChFdmFsIChBIGIgYykgZCwgRXZh bCAoQSBkIGUpIGYpID0+IEV2YWwgKEEgKEEgYiBjKSBlKSBmCgo= --0-681966285-1016732266=:42373 Content-Type: application/x-unknown; name="unlambda.lhs" Content-Transfer-Encoding: base64 Content-Description: unlambda.lhs Content-Disposition: attachment; filename="unlambda.lhs" UXVhc2ktVW5sYW1iZGEgaW50ZXJwcmV0ZXIgaW4gSGFza2VsbCBjbGFzc2Vz IQpTZWUgbGFtYmRhLmxocyBmb3IgaW5zaWdodC4KCj4gbW9kdWxlIFVubGFt YmRhIHdoZXJlCgo+IGRhdGEgSyAgICAgICAgPSBLCj4gZGF0YSBLMSB4ICAg ICA9IEsxIHgKCj4gZGF0YSBTICAgICAgICA9IFMKPiBkYXRhIFMxIHggICAg ID0gUzEgeAo+IGRhdGEgUzIgeCB5ICAgPSBTMiB4IHkKCj4gZGF0YSBJICAg ICAgICA9IEkKCj4gZGF0YSBWICAgICAgICA9IFYKCj4gZGF0YSBBcHAgZiBn ICA9IEFwcCBmIGcKCj4gY2xhc3MgRXZhbCBmIGcgfCBmIC0+IGcgd2hlcmUK PiAgIHVubGFtYmRhRXZhbCA6OiBmIC0+IGcKPiAgIHVubGFtYmRhRXZhbCA9 IHVuZGVmaW5lZAoKPiBjbGFzcyBBcHBseSBmIGcgaCB8IGYgZyAtPiBoIHdo ZXJlCj4gICB1bmxhbWJkYUFwcGx5IDo6IGYgLT4gZyAtPiBoCj4gICB1bmxh bWJkYUFwcGx5ID0gdW5kZWZpbmVkCgo+IGluc3RhbmNlIEV2YWwgSyBLCj4g aW5zdGFuY2UgRXZhbCAoSzEgeCkgKEsxIHgpCj4gaW5zdGFuY2UgRXZhbCBT IFMKPiBpbnN0YW5jZSBFdmFsIChTMSB4KSAoUzEgeCkKPiBpbnN0YW5jZSBF dmFsIChTMiB4IHkpIChTMiB4IHkpCj4gaW5zdGFuY2UgRXZhbCBJIEkKPiBp bnN0YW5jZSBFdmFsIFYgVgoKPiBpbnN0YW5jZSAoRXZhbCB4IHgnLCBFdmFs IHkgeScsIEFwcGx5IHgnIHknIHopID0+IEV2YWwgKEFwcCB4IHkpIHoKCj4g aW5zdGFuY2UgQXBwbHkgSyB4IChLMSB4KQo+IGluc3RhbmNlIEFwcGx5IChL MSB4KSB5IHgKCj4gaW5zdGFuY2UgQXBwbHkgUyB4IChTMSB4KQo+IGluc3Rh bmNlIEFwcGx5IChTMSB4KSB5IChTMiB4IHkpCgo+IGluc3RhbmNlIEFwcGx5 IEkgeCB4Cj4gaW5zdGFuY2UgQXBwbHkgViB4IFYKCj4gLS0gVGhlIHVuZGVj aWRhYmxlIHBhcnQgCj4gaW5zdGFuY2UgRXZhbCAoQXBwIChBcHAgeCB6KSAo QXBwIHkgeikpIHQgPT4gQXBwbHkgKFMyIHggeSkgeiB0Cgo= --0-681966285-1016732266=:42373-- From icalp2002@informatica.uma.es Thu Mar 21 18:19:43 2002 From: icalp2002@informatica.uma.es (icalp2002@informatica.uma.es) Date: Thu, 21 Mar 2002 19:19:43 +0100 Subject: ICALP2002: accepted papers and preliminary program Message-ID: This is a multi-part message in MIME format. --------------9F1656E3A2720904ECEA2E70 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Dear Sir/Madam, I'm sending you the following information: -the list of accepted papers for ICALP'2002 (an HTML table with two columns; authors and title) -the preliminary program of ICALP'2002 is available on http://sirius.lcc.uma.es/ICALP2002/PreliminarySchedule.html (and on the "news" of ICALP2002 pages: http://www.lcc.uma.es/ICALP2002) -the preliminary program of the satellite event "Global Computing" (in the same link). I consider that this conference can be of your interest. The registration will be open in a few days. Best regards, Rafael Morales --------------9F1656E3A2720904ECEA2E70 Content-Type: text/html; charset=us-ascii; name="tableAceptICALP2002.htm" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tableAceptICALP2002.htm" Track A

Track A

 

Peter Hertling;

A Banach-Mazur Computable but not Markov Computable Function on the Computable Real Numbers

Seth Pettie;

A Faster All-pairs Shortest Path Algorithm for Real-weighted Sparse Graphs

Juhani Karhumäki; Leonid P. Lisovik;

A surprising undecidability result: The equivalence problem for finite substitutions on $ab^*c$

Doerr Benjamin;

Antirandomizing the Wrong Game

Piotr Berman; Marek Karpinski; Yakov Nekrich;

Approximating Huffman Codes in Parallel

Marek Karpinski; Piotr Berman;

Approximation Hardness of Bounded Degree MIN-CSP and MIN-BISECTION

Nathan Segerlind;

Bounded Depth Frege with Counting Principles Polynomially Simulates Nullstellensatz Refutations

Rolf Fagerberg; Gerth Stølting Brodal;

Cache Oblivious Distribution Sweeping

Udo Adamy;

Call Control in Rings

Jurdzinski Tomasz;

Church-Rosser Languages vs. UCFL

Vincenzo Liberatore;

Circular Arrangements

Victor Dalmau;

Constraint Satisfaction Problems in Non-Deterministic Logarithmic Space

Joseph (Seffi) Naor;

Control Message Aggregation in Group Communication Protocols

John Hitchcock;

Correspondence Principles for Effective Dimensions

Aggelos Kiayias; Moti Yung;

Cryptographic Hardness based on the Decoding of Reed-Solomon Codes

Colin Stirling;

Deciding DPDA equivalence is primitive recursive

Yoshiharu Kohayakawa; Brendan Nagle; Vojtech Rodl;

Efficient testing of hypergraphs

Peter Sanders; Rene Beier; Naveen Sivadasan; Edgar Ramos;

Energy Optimal Routing in Radio Networks Using Geometric Data Structures

Dima Grigoriev; Edward A. Hirsch; Dmitrii V. Pasechnik;

Exponential Lower Bound for Static Semi-Algebraic Proofs

Rajeev Raman;

Exponential structures for cache-oblivious algorithms

Karhan Akcoglu;

Fast Universalization of Investment Strategies with Provably Good Relative Returns

Moses Charikar; Kevin Chen; Martin Farach-Colton;

Finding Frequent Items in Data Streams

Thore Husfeldt;

Finding a Path of Superlogarithmic Length

Xiaotie Deng; Guojun Li; Zimao Li; Bin ma; Lusheng Wang;

Genetic Design of Drug without Side-effect

Leszek Gasieniec; Andrzej Lingas;

Gossiping with bounded size messages in unknown ad-hoc radio networks

Elias Koutsoupias; Christos Papadimitriou; Alex Fabrikant;

Heuristically Optimized Trade-offs: A New Paradigm for Power Laws in the Internet

Martin Strauss; Sudipto Guha; Piotr Indyk; Muthu Muthukrishnan;

Histogramming Data Streams with Fast Per-Item Processing

Papazian Christophe;

Hyperbolic Recognition by Cellular Automata

Camil Demetrescu; Giuseppe F. Italiano;

Improved Bounds and New Trade-Offs for Dynamic All Pairs Shortest Paths

Jonas Holmerin;

Improved Inapproximability Results for Vertex Cover on k-regular Hyper-graphs

V.S. Anil Kumar Kumar;

Improved Results for Stackelberg Scheduling Strategies

Tomasz Radzik;

Improving time bounds on maximum generalised flow computation

Lars Engebretsen; Jonas Holmerin; Alexander Russell;

Inapproximability Results for Equations Over Finite Groups

Sebastian Bala;

Intersection of Regular Language and Star Hierarchy

Ryuhei Uehara;

Linear Time Algorithms on Chordal Bipartite and Strongly Chordal Graphs

Moses Charikar; Piotr Indyk; Rina Panigrahy;

New Algorithms for Subset Query, Partial Match, Orthogonal Range Searching and Related Problems

Steve Seiden; Leah Epstein; Rob van Stee;

New Bounds for Variable-Sized and Resource Augmented Online Bin Packing

Nicola Galesi; Juan Luis Esteban; Jochen Messner;

On the Complexity of Resolution with Bounded Conjunctions

Conrado Martinez; Amalia Duch;

On the average performance of orthogonal range search in multidimensional data structures

Sylvain Lombardy;

On the construction of reversible automata for reversible languages

Rasmus Pagh; Anna Östlin;

One-Probe Search

Xiaodong Wu; Danny Chen;

Optimal Net Surface Problems with Applications

Andreas Jakoby; Maciej Liskiewicz;

Paths Problems in Symmetric Logarithmic Space

Eyal Kushilevitz; Yuval Ishai;

Perfect Constant-Round Secure Computation via Perfect Randomizing Polynomials

Andrzej Lingas; Artur Czumaj; Hairong Zhao;

Polynomial-Time Approximation Schemes for the Euclidean Survivable Network Design Problem

Marek Chrobak; Leah Epstein; John Noga; Jiri Sgall; Rob van Stee; Tomas Tichy; Nodari Vakhania;

Preemptive Scheduling in Overloaded Systems

Amr Elmasry;

Priority queues, pairing and adaptive sorting

Chris Pollett; Farid Ablayev; Cris Moore;

Quantum and Stochastic Branching Programs of Bounded Width

Philippe Flajolet;

Random Sampling from Boltzmann Principles

Vasco Brattka;

Random numbers and an incomplete immune recursive set

Harald Räcke; Micah Adler; Naveen Sivadasan; Christian Sohler; Berthold Vöcking;

Randomized Pursuit-Evasion in Graphs

Kazuo Iwama;

Removable On-Line Knapsack Problems

Peter Damaschke;

Scheduling search procedures

Carlo Fantozzi; Andrea Pietracaprina; Geppino Pucci;

Seamless Integration of Parallelism and Memory Hierarchy

Gerth Stølting Brodal; Rune Bang Lyngsø; Anna Östlin; Christian N. S. Pedersen;

Solving the String Statistics Problem in Time $O(n\log n)$

Ugo Vaccaro; Pavol Hell; Ladislav Stacho; Luisa Gargano;

Spanning trees with bounded number of branch vertices

Wolfgang Merkle;

The Kolmogorov-Loveland stochastic sequences are not closed under selecting subsequences

Robert A. Hearn; Erik D. Demaine;

The Nondeterministic Constraint Logic Model of Computation: Reductions and Applications

Ollinger Nicolas;

The Quest for Small Universal Cellular Automata

Dimitrios Fotakis; Spyros Kontogiannis; Elias Koutsoupias; Marios Mavronicolas; Paul Spirakis;

The Structure and Complexity of Nash Equilibria for a Selfish Routing Game

Noam Nisan;

The communication complexity of approximate set packing and covering

Mikolaj Bojanczyk;

Two-Way Alternating Automata and Finite Models

Mohamed Mosbah; Nicolas Bonichon; Bertrand Le Saec;

Wagner's theorem on Realizers

John Hitchcock; Jack Lutz;

Why Computational Complexity Requires Stricter Martingales

 

 

 

 

Track B

 

Philippa Gardner;

A Spatial Logic for Querying Graphs

Rosu Grigore;

A Total Approach to Partial Algebraic Specification

Paul Gastin;

An Elementary Expressively Complete Temporal Logic for Mazurkiewicz Traces

Lohrey Markus;

Axiomatising Divergence

Marco Kick;

Bialgebraic Modelling of Timed Processes

Alex Simpson;

Comparing functional paradigms for exact real-number computation

Bharat Adsul; Milind Sohoni;

Expressively Complete Tractable Linear Time Temporal Logics over Traces

Luke Ong;

Games Characterizing Levy-Longo Trees

Zeitoun Marc; muscholl anca; genest blaise; seidl helmut;

Infinite-state High-Level MSCs: Model-Checking and Realizability

James Worrell; Keye Martin; Mike Mislove;

Measuring the Probabilistic Powerdomain

Michal Bielecki; Hidders Jan; Jan Paredaens; Jerzy Tyszkiewicz; Jan Van den Bussche;

Navigating with a Browser

Colcombet Thomas;

On Families of Graphs Having a Decidable First Order Theory with Reachability

Dietrich Kuske; Markus Lohrey;

On the theory of one-step rewriting in trace monoids

Jiri Srba;

Strong Bisimilarity and Regularity of Basic Process Algebra is PSPACE-Hard

Thierry Cachat;

Symbolic Strategy Synthesis for Games on Pushdown Graphs

Franck van Breugel;

Testing Labelled Markov Processes

J. B. Wells Wells;

The Essence of Principal Typings

Freddy Mang; Thomas A. Henzinger; Orna Kupferman; Sriram Krishnan;

The Synthesis of Uninitialized Systems

Klaus Wich;

Universal Inherence of cycle-free context-free Ambiguity Functions

--------------9F1656E3A2720904ECEA2E70-- From post@volker-wysk.de Thu Mar 21 23:31:35 2002 From: post@volker-wysk.de (Volker Wysk) Date: Fri, 22 Mar 2002 00:31:35 +0100 (CET) Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: Message-ID: Hi On 21 Mar 2002, Jens Petersen wrote: > Volker Wysk writes: > > POpen-1.0.0 contains the same bug which I made. It doesn't ensure that > > the values which are needed after the call of forkProcess, before that > > of executeFile, are fully evaluated. So, if they are read lazily from a > > stream, the newly spawned child process reads data from a stream which > > it shares with its parent, making it disappear from the parent's input. > > In this situation, this sure isn't intended. > > Perhaps you could give an explicit example? I haven't tried it, but it's exactly the same thing. > > Inserting the following lines just before the line "pid <- forkProcess", > > in POpen.hs, would force the corresponding values to be evaluated, so no > > data will be lost. > > > > seq (length path) $ seq (sum (map length args)) $ return () > > when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) > > (fromJust env))) $ return () > > when (isJust dir) $ seq (length (fromJust dir)) $ return () > > Hmmm, I don't really see why this is necessary. Don't the > lazy values of "path", "env" and "dir" just get evaluated > when they're needed here as normal? (If what you say is > true though it would be simpler just to use "$!" or "!"s for > strict evaluation I guess.) Yes, and that's *after* forkProcess. So when they are computed from the lazily read contents of a stream, the newly spawned child will read data from a stream which it shares with its parent. > > I'm also not sure what this part is supposed to do: > > > > inr <- if (isJust inpt) then > > do > > (inr', inw) <- createPipe > > hin <- fdToHandle inw > > hPutStr hin $ fromJust inpt > > hClose hin > > return $ Just inr' > > else > > return Nothing > > It returns the output end of a pipe containing the input > string if one is given. > > > Doesn't it write the input data to a pipe which no process reads > > from..?? > > Nope, "doTheBusiness" dup2's it to the stdin of the subprocess: [...] But hPutStr, followed by hClose, won't complete until all the input string has been written, while no process is listening. Volker From bhuffman@galois.com Fri Mar 22 00:21:43 2002 From: bhuffman@galois.com (Brian Huffman) Date: Thu, 21 Mar 2002 16:21:43 -0800 Subject: catch (fail "...") Message-ID: <200203220021.g2M0LiX09437@localhost.localdomain> Hi, Here is a problem I came across recently, revealing a difference between ghci and Hugs: hugs> catch (error "not ok") (\e -> putStrLn "ok") Program error: not ok ghci> catch (error "not ok") (\e -> putStrLn "ok") *** Exception: not ok hugs> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") ok ghci> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") ok hugs> catch (fail "not ok") (\e -> putStrLn "ok") Program error: not ok ghci> catch (fail "not ok") (\e -> putStrLn "ok") ok As I expected, neither of them can catch "error", and both of them can catch "ioError". But only ghci can catch the "fail". It seems to me that ghc has made a convenient choice here, because if I need to raise an IO exception, it is easier to type "fail s" than "ioError (userError s)". However, the online Haskell report says that for IO, fail s = error s, which is what Hugs does. (http://www.haskell.org/onlinereport/standard-prelude.html#$iMonad$$IO) Does anyone know the reasoning behind the design choice made in the report, or why the ghc implementation is different? I am mainly concerned about portability issues: particularly, is it a good idea to use fail for raising IO exceptions? Thanks - Brian Huffman From senganb@ia.nsc.com Fri Mar 22 03:10:14 2002 From: senganb@ia.nsc.com (senganb@ia.nsc.com) Date: Thu, 21 Mar 2002 22:10:14 -0500 Subject: Haskell slicing tool? In-Reply-To: <3C986787.830C8F9B@cs.york.ac.uk> References: <20020319132039.37e63d70.senganb@ia.nsc.com> <3C986787.830C8F9B@cs.york.ac.uk> Message-ID: <20020321221014.6c7b7fdb.senganb@ia.nsc.com> On Wed, 20 Mar 2002 10:42:15 +0000 "Olaf Chitil" wrote: > Sengan.Baring-Gould@nsc.com wrote: > > > > > Are there any tools to perform program slicing on Haskell? > > > > I often find myself wanting to find all "fromJusts" invoked > > > > from the current function, or all functions that use a > > > > particular member of my monad's ADT. > > > Actually I was hoping for a static tool. > > I'd be interested to learn for what purpose you want this kind of > information and also more precisely what you would like such a static > tool to do for you. > > Olaf I looked at for what I use the "#" command in vim over the last 2 days, and when it becomes insufficient: * Upwards slicing: - to see what parameters a function is actually given (can be quite a long way from where the parameter is actually constructed, versus simply passed around). - to find dead code (function results that are never used) * Downwards slicing - to debug code (which head failed? One of those under function f, but what are they?) - which instance of (>>=) is it that I'm using here? * Complex queries: A := set of all functions refered to by f1's definition B := set of all functions refered to by f2's definition C := set of functions I'm interested in D := intersection of A, B and C D would then be the functions used both by A and B of the set I'm interested in C. In general the answer is to understand, debug and refactor code in larger projects (my current project weighs 4500 lines of Haskell for instance). Sengan From hallgren@cse.ogi.edu Fri Mar 22 04:09:25 2002 From: hallgren@cse.ogi.edu (Thomas Hallgren) Date: Thu, 21 Mar 2002 20:09:25 -0800 Subject: stripcomments 1.0 References: Message-ID: <3C9AAE75.1000508@cse.ogi.edu> Hi, There now is a program that strips comments and blank lines properly. You can get the Haskell source code from: http://www.cse.ogi.edu/~hallgren/stripcomments/ How hard it is to do a real job of course depends on what you start from. I happened to have a lexer for Haskell, that was really easy to reuse for this purpose! Regards, Thomas Hallgren Nicholas Nethercote wrote: >On Mon, 18 Mar 2002, Kevin Glynn wrote: > >> > Are there any programs to strip comments and blank lines from a Haskell >> > source file, that work on normal and literate programs? >> >>Doing a real job is 'hard' >> >I'm surprised there aren't programs out there that do this properly. > From kyagrd@bawi.org Fri Mar 22 04:24:35 2002 From: kyagrd@bawi.org (Ahn Ki-yung) Date: Fri, 22 Mar 2002 13:24:35 +0900 Subject: Typo: Hugs Bug ! >> it was + References: <3C999F3F.97BF994D@bawi.org> Message-ID: <3C9AB203.C6916529@bawi.org> Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!} Prelude> f 1 where f x = x + f x ==================== in unix/linux proper error msg comes out and back to interpreter. ERROR - Control stack overflow =========== but in windows 2000 Then suddnly interpreter fails and the red (X) popup window pops up. hugs.exe - application programm error unknown software exception (0xc000fd) ... blabla From petersen@redhat.com Fri Mar 22 05:37:00 2002 From: petersen@redhat.com (Jens Petersen) Date: 22 Mar 2002 14:37:00 +0900 Subject: popen lazy args and input pipe In-Reply-To: References: Message-ID: Volker Wysk writes: > On 21 Mar 2002, Jens Petersen wrote: > > Volker Wysk writes: > > > POpen-1.0.0 contains the same bug which I made. It doesn't ensure that > > > the values which are needed after the call of forkProcess, before that > > > of executeFile, are fully evaluated. So, if they are read lazily from a > > > stream, the newly spawned child process reads data from a stream which > > > it shares with its parent, making it disappear from the parent's input. > > > In this situation, this sure isn't intended. Ok, I agree this is a potential if unlikely problem. I can't really think of any useful examples though. I guess using "$!"s in the call to popen would solve this part. > > Perhaps you could give an explicit example? > > I haven't tried it, but it's exactly the same thing. Well, an explicit example using your "pipeto" or popen would be helpful. > > > Inserting the following lines just before the line "pid <- forkProcess", > > > in POpen.hs, would force the corresponding values to be evaluated, so no > > > data will be lost. > > > > > > seq (length path) $ seq (sum (map length args)) $ return () > > > when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) > > > (fromJust env))) $ return () > > > when (isJust dir) $ seq (length (fromJust dir)) $ return () I would prefer not to add strict evaluation to POpen unless it's absolutely necessary. I guess I really need a testcase for this problem. If you have one please send it to me. I should really add some unit tests to popenhs. > > Hmmm, I don't really see why this is necessary. Don't the > > lazy values of "path", "env" and "dir" just get evaluated > > when they're needed here as normal? (If what you say is > > true though it would be simpler just to use "$!" or "!"s for > > strict evaluation I guess.) > > Yes, and that's *after* forkProcess. So when they are computed from > the lazily read contents of a stream, the newly spawned child will read > data from a stream which it shares with its parent. Btw I guess one can say that popen inherits this problem from "Posix.runProcess". But usually "path", "env" and "dir" are not streams, just strings, right? Even for args I feel pushed to think of a real example where it could be a problem. Something like "xargs" taking a long stream of arguments from stdin, but arguments instead?? (Most shells have restrictions on the size of argv I think though.) Are you're referring to these comments from Posix.lhs, or you've rediscovered them? -- ***NOTE***: make sure you completely force the evaluation of the path -- and arguments to the child before calling runProcess. If you don't do -- this *and* the arguments from runProcess are read in from a file lazily, -- be prepared for some rather weird parent-child file I/O behaviour. -- -- [If you don't force the args, consider the case where the -- arguments emanate from a file that is read lazily, using -- hGetContents or some such. Since a child of a fork() -- inherits the opened files of the parent, the child can -- force the evaluation of the arguments and read them off the -- file without any problems. The problem is that while the -- child share a file table with the parent, it has separate -- buffers, so a child may fill up its (copy of) the buffer, -- but only read it partially. When the *parent* tries to read -- from the shared file again, the (shared) file offset will -- have been stepped on by whatever number of chars that was -- copied into the file buffer of the child. i.e., the unused -- parts of the buffer will *not* be seen, resulting in -- random/unpredicatable results. -- -- Based on a true (, debugged :-) story. -- ] Reading this again I start to understand the problem you're describing a little better. Perhaps something does need to be done about it, as you say. ;-) > But hPutStr, followed by hClose, won't complete until all > the input string has been written, while no process is > listening. Oops, you're right! Indeed popen hangs on input greater than 4kB on my system. Thank you very much for reporting this. Jens From rjchaaft@cs.uu.nl Fri Mar 22 09:26:52 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Fri, 22 Mar 2002 10:26:52 +0100 Subject: Typo: Hugs Bug ! >> it was + In-Reply-To: <3C9AB203.C6916529@bawi.org> References: <3C999F3F.97BF994D@bawi.org> Message-ID: <4.3.0.20020322102518.00b380b8@pop.students.cs.uu.nl> Ahn Ki-yung wrote: >Prelude> f 1 where f x = x : f x >[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, >,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, >,1,1,{Interrupted!} > >Prelude> f 1 where f x = x + f x --> Immediate (!) crash Indeed, I could reproduce this on my computer (Win2000; Hugs Dec 2001 of last week). Rijk-Jan van Haaften From Keith.Wansbrough@cl.cam.ac.uk Fri Mar 22 09:34:08 2002 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Fri, 22 Mar 2002 09:34:08 +0000 Subject: Lambda over types. In-Reply-To: Your message of "Thu, 21 Mar 2002 08:35:27 PST." <20020321163527.92822.qmail@web14201.mail.yahoo.com> Message-ID: anatoli writes: > ghc -fglasgow-exts -fallow-undecidable-instances allows = > constructs which amount to lambda abstraction over types. = > I've written a small untyped lambda calculus interpreter = > in the Haskell class/instance sublanguage, just to prove > this point. (The terms are Haskell *types*.) Cool! Some time ago I wrote a Turing machine evaluator in Haskell types with un= decidable instances. It's described at http://www.chttp://www.cl.cam.ac.uk/~kw217/research/misc/undec.html Enjoy! --KW 8-) -- = Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. From simonpj@microsoft.com Fri Mar 22 10:29:22 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 22 Mar 2002 02:29:22 -0800 Subject: catch (fail "...") Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041BD4@RED-MSG-10.redmond.corp.microsoft.com> This is an inconsistency that was fixed in the revised Haskell98=20 report (Apr 2001). See http://research.microsoft.com/~simonpj/haskell98-revised In the bug list look for Page 90. It looks as though Hugs hasn't quite caught up with this change. Simon | -----Original Message----- | From: Brian Huffman [mailto:bhuffman@galois.com]=20 | Sent: 22 March 2002 00:22 | To: haskell@haskell.org | Subject: catch (fail "...") |=20 |=20 | Hi, |=20 | Here is a problem I came across recently, revealing a=20 | difference between ghci=20 | and Hugs: |=20 | hugs> catch (error "not ok") (\e -> putStrLn "ok") | Program error: not ok | ghci> catch (error "not ok") (\e -> putStrLn "ok") | *** Exception: not ok |=20 | hugs> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") | ok | ghci> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") | ok |=20 | hugs> catch (fail "not ok") (\e -> putStrLn "ok") | Program error: not ok | ghci> catch (fail "not ok") (\e -> putStrLn "ok") | ok |=20 | As I expected, neither of them can catch "error", and both of=20 | them can catch=20 | "ioError". But only ghci can catch the "fail". It seems to me=20 | that ghc has=20 | made a convenient choice here, because if I need to raise an=20 | IO exception, it=20 | is easier to type "fail s" than "ioError (userError s)". |=20 | However, the online Haskell report says that for IO, fail=A0s=A0=3D=A0 | error=A0s, which=20 | is what Hugs does.=20 | (http://www.haskell.org/onlinereport/standard-prelude.html#$iM onad$$IO) Does anyone know the reasoning behind the design choice made in the = report,=20 or why the ghc implementation is different? I am mainly concerned about=20 portability issues: particularly, is it a good idea to use fail for = raising=20 IO exceptions? Thanks - Brian Huffman _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell From reid@cs.utah.edu Fri Mar 22 16:48:56 2002 From: reid@cs.utah.edu (Alastair Reid) Date: 22 Mar 2002 16:48:56 +0000 Subject: Hugs Bug ! In-Reply-To: <3C999F3F.97BF994D@bawi.org> References: <3C999F3F.97BF994D@bawi.org> Message-ID: Ahn Ki-yung reports: > {Apparently inessential details of program supressed] > > in unix/linux proper error msg comes out and back to interpreter. > > ERROR - Control stack overflow > > =========== > but in windows 2000 > > Then suddnly interpreter fails and > the red (X) popup window pops up. > > hugs.exe - application programm error > > unknown software exception (0xc000fd) ... blabla This is a known problem in Hugs to do with overflows of the C stack. The problem is: - Hugs evaluation is done on the C stack and so some kinds of evaluation can cause stack overflows. - OSs and C are pretty poor at detecting or avoiding stack overflows. The reason you didn't see this in Unix is: - Unix apparently assigns a different stack-size limit to Hugs. (I think you can tune stack size in Windows but forget how.) - Hugs uses a 2nd stack 'the control stack' during evaluation. This is a normal C array which Hugs knows the size of so it can detect overflow in that stack. Often, when you run out of C stack space, you were about to run out of control stack space anyway and when you run out of control stack space you were about to run out of C stack space. (In other words, running out of either usually indicates a problem in your program which will not be solved by tweaking stack sizes.) Hope this helps. -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/ From mark.wogahn@yale.edu Fri Mar 22 19:43:19 2002 From: mark.wogahn@yale.edu (Mark Wogahn) Date: Fri, 22 Mar 2002 14:43:19 -0500 Subject: Haskell server switchover Message-ID: <3C9B8957.5070901@yale.edu> Hi All, I will be bringing the haskell server down tomorrow morning (Sat Mar 23 ) between 08:00 and 8:30 to do some needed service. It should be back online no later than 9:00. Sorry for any inconvenience. -Mark -- Mark Wogahn / mark.wogahn@yale.edu Workstation Support Services (WSS) Department of Computer Science 51 Prospect Street, New Haven, CT 06520 Phone: (203) 432-1264 Fax: (203) 432-0593 -------------------------------------------------------- "Nothing is static, everything is falling apart" Chuck Palahniuk - "Fight Club" From tom-list-haskell@moertel.com Fri Mar 22 23:38:00 2002 From: tom-list-haskell@moertel.com (Tom Moertel) Date: Fri, 22 Mar 2002 18:38:00 -0500 Subject: ANNOUNCE: Red Hat RPMs of Haskell Mode for Emacs Message-ID: <3C9BC058.F19E08DB@moertel.com> I have packaged the Haskell Mode for Emacs at http://www.haskell.org/haskell-mode/ into RPMs for Red Hat Linux 7.2 (and similar platforms). Once the packages are installed, Haskell Mode is automatically enabled when you start up Emacs. Integration with Hugs is the default, but a quick change to your .emacs file will cause Haskell Mode to use GHCi instead. You can find the RPMs here: http://www.moertel.com/~thor/emacs-haskell-mode/ Cheers, Tom P.S. I have also made the RPM .spec file available. If somebody can add it to the official haskell-mode tarball on haskell.org, people can build RPMs directly from the tarball using "rpm -ta haskell-mode-(VERS).tar.gz". From gkamsteeg@freeler.nl Sat Mar 23 16:01:21 2002 From: gkamsteeg@freeler.nl (Gertjan Kamsteeg) Date: Sat, 23 Mar 2002 17:01:21 +0100 Subject: using less stack References: <3C98D8BB.5060001@aber.ac.uk> Message-ID: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> You don't have to define cpsfold explicitly recursively since it can be expressed in terms of foldr: cpsfold f a xs = foldr (\x k y -> f x y k) id xs a The following definition would even be better (but not equivalent): cpsfold' f a xs = foldr (\x k y -> f y x k) id xs a The list members are now 'consumed' left-to-right by f, with initial value a. So, answer4 = foldr (\x k a -> if x > a then k x else k a) id [1..500000] 0 also works without a crash or insufficient stack space. Gertjan ----- Original Message ----- From: "Amanda Clare" To: "C.Reinke" Cc: Sent: Wednesday, March 20, 2002 7:45 PM Subject: Re: using less stack > [cpsfold omitted] > > > Actually, and quite apart from it being cumbersome to use, I've got > > my doubts about whether this cpsfold really does the job (is that > > just me missing some point?-). > > It does the job for me! In practical terms I can see it works. I'm not > an expert - I may have this all wrong, but perhaps the point you're > looking for is that the arguments to f are brought to the very outside > of the expression, and hence available for evaluation. Imagine for > [x1,x2,x3,x4] > from foldr: f x1 (f x2 (f x3 (f x4 a))) > from foldl: f (f (f (f a x1) x2) x3) x4 > > Neither are available for immediate evaluation. In the case of foldr the > end of the list (x4) has to be reached before anything can be evaluated. > In the case of foldl the first function to be pulled upon is the > outermost f, which then can't do anything useful (in my case) without > evaluating its second argument, and so on. > > with the cpsfold I get > > f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4) > > so x1 and a are available immediately for f to use, and f x1 a is the > outermost expression so will be evaluated first. > > See for yourself with the following (difference can be seen in ghc with > standard 1M stack): > > > answer1 = foldr larger 0 [1..500000] > > answer2 = foldl larger 0 [1..500000] > > answer3 = cpsfold cpslarger 0 [1..500000] > > > larger x y = if x > y then x else y > > cpslarger x y k = if x > y then k x else k y > > > > > Also, I'm curious to know why the usual strict variant of foldl > > doesn't help in this case? > > > > foldl' f a [] = a > > foldl' f a (x:xs) = (foldl' f $! f a x) xs > > Because $! and seq only evaluates enough to make sure the answer is not > bottom, and if my f is complex then it doesn't do enough. > > Amanda > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From hdaume@ISI.EDU Sun Mar 24 00:35:18 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Sat, 23 Mar 2002 16:35:18 -0800 (PST) Subject: using less stack In-Reply-To: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> Message-ID: Hi, > You don't have to define cpsfold explicitly recursively since it can be > expressed in terms of foldr: Is this generally considered good design? That is, is it generally preferred to express functions in a nonrecursive style if that can be done using standard library functions like foldr and map and filter, etc? Okay, obviousloy everything *can* be done in that manner, so I guess my question is why should we write something using foldr when, imo, the explicitely recursive version is easier to parse (as a human). - Hal From reid@cs.utah.edu Sun Mar 24 02:58:49 2002 From: reid@cs.utah.edu (Alastair Reid) Date: 24 Mar 2002 02:58:49 +0000 Subject: using less stack In-Reply-To: References: Message-ID: Gertjan Kamsteeg writes: >> You don't have to define cpsfold explicitly recursively since it >> can be expressed in terms of foldr: Hal Daume III writes: > Is this generally considered good design? [...] Three different attempts at an answer: As with all code-factoring it's in the eye of the beholder. If what you want to do is trace execution in detail, the less factored code is easier to understand. If what you want to do is understand the difference between 5 different recursive traversals of a list, then isolating those differences (by suppressing the invariant fact of recursion) is better. More concretely, some prefer to avoid the recursive formulations because: 1) It is trickier to reason about. Functional programmers (especially Squiggol afficianados) have all kinds of cunning ways to reason about programs written using standard library functions such as foldr. The techniques for reasoning directly about recursive functions are somewhat cruder and harder. 2) The ability to recursivly invoke the function from _anywhere_ in the function body has been compared (with some justification) to the use of goto in unstructured programming. If you buy into this line of reasoning then foldr, scanr, map, etc. are to functional programming as while, repeat and for are to structured programming. [These two points are connected!] And, finally, my personal preference is: - use explicit recursion when I don't understand what I'm doing well enough to know which standard recursive pattern it fits into (because it normally always fits a standard pattern). - use higher-order functions when I know what I'm doing or where setting up the infrastructure for the recursion costs more than coding it directly. -- Alastair Reid Reid Consulting (UK) Ltd From Christine Hall Sun Mar 24 13:37:49 2002 From: Christine Hall (Christine Hall) Date: Sun, 24 Mar 2002 21:37:49 +0800 (CST) Subject: http://haskell.org Message-ID: <37CR1000016979@emaserver.trafficmagnet.net> --16881215.1016977069281.JavaMail.SYSTEM.emaserver Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi I visited http://haskell.org, and noticed that you're not listed on some search engines! I think we can offer you a service which can help you increase traffic and the number of visitors to your website. I would like to introduce you to TrafficMagnet.net. We offer a unique technology that will submit your website to over 300,000 search engines and directories every month. You'll be surprised by the low cost, and by how effective this website promotion method can be. To find out more about TrafficMagnet and the cost for submitting your website to over 300,000 search engines and directories, visit www.TrafficMagnet.net. I would love to hear from you. Best Regards, Christine Hall Sales and Marketing E-mail: christine@trafficmagnet.net http://www.TrafficMagnet.net This email was sent to haskell@haskell.org. I understand that you may NOT wish to receive information from me by email. To be removed from this and other offers, simply go to the link below: http://emaserver.trafficmagnet.net/trafficmagnet/www/optoutredirect?UC=Lead&UI=199707 --16881215.1016977069281.JavaMail.SYSTEM.emaserver Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Hi

I visited http://haskell.org, and noticed that you're not listed on some search engines! I think we can offer you a service which can help you increase traffic and the number of visitors to your website.

I would like to introduce you to TrafficMagnet.net. We offer a unique technology that will submit your website to over 300,000 search engines and directories every month.


You'll be surprised by the low cost, and by how effective this website promotion method can be.

To find out more about TrafficMagnet and the cost for submitting your website to over 300,000 search engines and directories, visit www.TrafficMagnet.net.

I would love to hear from you.


Best Regards,

Christine Hall
Sales and Marketing
E-mail: christine@trafficmagnet.net
http://www.TrafficMagnet.net

 

This email was sent to haskell@haskell.org.
I understand that you may NOT wish to receive information from me by email.
To be removed from this and other offers, simply click here.
. --16881215.1016977069281.JavaMail.SYSTEM.emaserver-- From gkamsteeg@freeler.nl Sun Mar 24 13:38:44 2002 From: gkamsteeg@freeler.nl (Gertjan Kamsteeg) Date: Sun, 24 Mar 2002 14:38:44 +0100 Subject: using less stack References: Message-ID: <002e01c1d339$582cc450$2797153e@gertjan1> From: "Alastair Reid" > > Gertjan Kamsteeg writes: > >> You don't have to define cpsfold explicitly recursively since it > >> can be expressed in terms of foldr: > > Hal Daume III writes: > > Is this generally considered good design? [...] > > Three different attempts at an answer: > > As with all code-factoring it's in the eye of the beholder. > > If what you want to do is trace execution in detail, the less factored > code is easier to understand. > > If what you want to do is understand the difference between 5 > different recursive traversals of a list, then isolating those > differences (by suppressing the invariant fact of recursion) is > better. > I agree. However, although *functionally* every list traversing function should be expressible in terms of foldr (because foldr represents the type theoretical elimination rule for lists in most type systems with inductive types (and without element depending types)), it's not just a matter of taste. Execution clearly *does* depend on how things are defined. When I said 'can be expressed', I meant extensionally equivalent, including behavior w.r.t. reductions. For example, if, in the Prelude, foldr had been defined in terms of foldl: foldr f a xs = foldl (\h x y -> h (f x y)) id xs a my definition of cpsfold in terms of foldr wouldn't go through. That is, some stack would again overflow. What I wanted to say is that the fact that Amanda's answer1 (maximum in terms of foldr) didn't work wasn't caused by the definition of foldr in the Prelude. Besides, (re)factoring is fun. So, here's another one (foldl in terms of foldr): foldl f a xs = foldr (\x h y -> h (f y x)) id xs a BTW, there may be another reason for expressing list traversing functions in terms of foldr: if one uses only functions representing 'standard' elimination rules, it is guaranteed that all reduction sequences eventually terminate. Gertjan From ru@river.org Sun Mar 24 20:23:23 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sun, 24 Mar 2002 12:23:23 -0800 Subject: using less stack In-Reply-To: References: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> Message-ID: Hal Daume III writes: >> You don't have to define cpsfold explicitly recursively since it can be >> expressed in terms of foldr: > >Is this generally considered good design? That is, is it generally >preferred to express functions in a nonrecursive style if that can be done >using standard library functions like foldr and map and filter, >etc? One answer that Alastair Reid did not mention is that the nonrecursive style usually benefits from the deforestation optimization whereas IIUC the explicitly recursive style never does in contemporary compilers. Another answer, which I give because the factor does not enter enough into the thinking of academic language designers, is that the nonrecursive style inhibits adoption of Haskell by making it slightly more difficult for the average programmer or programmer-wannabe to learn --"slightly" because with recursion, lists and monadic interfaces Haskell already has a lot of significant learning barriers to adoption, and the nonrecursive style of definition is easier to learn (get used to) than any one of those last 3. -- Richard Uhtenwoldt From ru@river.org Sun Mar 24 20:59:50 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sun, 24 Mar 2002 12:59:50 -0800 Subject: a survey of language popularity In-Reply-To: References: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> Message-ID: So, how popular is Haskell compared to other languages? Here are some Google search results that suggest how many web pages are devoted to particular langauges. (Google tells you how many pages match your query.) A better survey of language popularity would include newsgroup and mailing list traffic, but no time, no time. In this modest survey, Haskell is a little more popular than O'Caml, a little less popular than Eiffel (an OOPL) 5 to 6 times less popular than Smalltalk; 8 to 10 times less popular than Python, which is itself at least 2 and a half or 3 times less popular than Perl. On second thought, Eiffel and Smalltalk might be considerably more popular than suggested by page counts because the other languages surveyed have 100% open-source documentation. eg, in the GHC results I saw lots of duplicates of essentially the same document. This is characteristic of open-source-code-licensed content. In contrast, Eiffel and Smalltalk have commercial vendors, whose documentation is (I would think) underrepresented in this modest survey because of having licenses that restrict copying. perl 9,600,000 perl language OR program OR variable OR object 1,490,000. python -monty -snake -venom 809,000 python program OR language OR variable OR object 630,000 smalltalk 361,000 (say 10% false hits. 325,000 real.) lisp cmucl OR "common lisp" OR heap OR cdr OR cons OR lambda OR closure OR scheme 188,000 eiffel object OR program OR variable OR string -tower 74,700 (I say there's a few false hits there. 71,000 real hits.) ghc haskell OR compiler 63,100 ghc haskell OR compiler OR functional OR fp 66,800 haskell fp OR "programming" OR monad OR monadic OR functional OR lambda 63,600 haskell "programming" OR monad OR monadic OR functional OR lambda 55,500 (I say 63,000 is the most accurate) caml 88,700 (I can see some false hits) "objective caml" OR ocaml OR o'caml 41,700. (42,000) note that there is at least one open-source Linux package, unison, a file sync utility, written in O'Caml. no Linux packages written in Haskell except for Haskell compilers. other info useful for measuring language popularity.
  • sloc in various RedHat 7.2 packages
  • lines of code in Debian
  • Counting Debian //
  • [E-Lang] popularity of programming languages among open source hackers // weak survey, of Sourceforge projects. see also Oct 2001 e-lang. -- Richard Uhtenwoldt From A.Simon@ukc.ac.uk Mon Mar 25 00:04:11 2002 From: A.Simon@ukc.ac.uk (Axel Simon) Date: Mon, 25 Mar 2002 00:04:11 +0000 (GMT) Subject: Announce: Gtk2Hs - A Haskell binding for Gtk2 Message-ID: Note: This is not gtk+hs. Gtk2Hs is a rewrite of gtk+hs. It is a binding to the recently released version of Gtk2 with a couple of improvements over gtk+hs: - Automatic memory management. - Nearly complete coverage of widget functions and their signals, including the new text and list widgets. - The convenience wrapper MoGuL (Monad Gui Library) makes it possible to create and lookup named widgets in a type safe way. - Unicode support. - Object-oriented calling convention for widget functions. - Pragmatically uses both c2hs and hsc acquire information about the C files. Automatically generates callback handlers and the widget type hierarchy. - Needs ghc version 5.00 or later, makes use of the --make flag and complies quite quickly (12 mins). I am currently only providing CVS access to the sources. Find them at: https://sourceforge.net/cvs/?group_id=49207 At the moment it does not compile on Solaris due to the 4 parameter restriction of GHC for dynamic callbacks. Feedback is very welcome, a good place to send it to is: gtk2hs-users@lists.sourceforge.net Share and enjoy, Axel. From svb@doc.ic.ac.uk Mon Mar 25 13:28:15 2002 From: svb@doc.ic.ac.uk (Steffen van Bakel) Date: Mon, 25 Mar 2002 13:28:15 +0000 Subject: ITRS'02 call for papers Message-ID: <0203251328.AA157444@Schiele> --PopOver-2.0.150-1017062895-3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline (Apologies for multiple copies) (Second) Call for Papers Workshop on Intersection Types and Related Systems (ITRS '02) Copenhagen, Denmark Friday, July 26 2002 http://www.doc.ic.ac.uk/~itrs02/ Co-located with FLoC '02, the third Federated Logic Conference to be held in Copenhagen, Denmark (July 22 to August 1 2002) http://floc02.diku.dk/ IMPORTANT DATES/DEADLINES: Submission of papers: Sunday, April 7 2002 Notification of acceptance: Thursday, April 25 2002 Workshop: Friday, July 26 2002 OVERALL TOPIC AND FORMAT OF WORKSHOP: Intersection type disciplines originated in 1980 to overcome the limitations of Curry's type assignment system and to provide a characterisation of the strongly normalising terms of the Lambda Calculus. Since then, intersection types disciplines were used in a series of papers for characterising evaluation properties and semantics. Types also support reliable reasoning in many areas such as logic, programming languages, linguistics, etc. A _polymorphic_ type stands for some number of instance types, and the use of type systems for non-trivial purposes generally requires polymorphic types. In this context, roughly speaking, intersection types could be seen as to provide type polymorphism by listing type instances. This differs from the more widely used ("forall") quantified types, which provide type polymorphism by giving a type scheme that can be instantiated into various type instances. (A similar relationship holds between union types and existential types, the duals of intersection types and universal types.) Although intersection types were initially intended for use in analyzing and/or synthesizing lambda models as well as in analyzing normalization properties, over the last twenty years the scope of theoretical research on intersection types has broadened. Recently, there have been a number of breakthroughs in the use of intersection types (and similar technology) for practical purposes such as program analysis. The ITRS '02 workshop will be held to bring together researchers working on both the theory and practice of systems with intersection types and related systems (e.g., union types, refinement types, etc.). The workshop will last one full day and will contain a long talk by each invited speaker, a panel discussion, and a short (approx. 25 minutes) talk for each accepted paper. POSSIBLE TOPICS FOR SUBMITTED PAPERS: Researchers are invited to submit original papers on topics in the spirit of the workshop. Possible topics for submitted papers include, but are not limited to: * Formal properties of systems with intersection types: principal typings, normalization properties (for normal forms, head-normal forms, weak head-normal forms, etc.), type inference algorithms. * Results for clearly related systems, e.g., systems with union types, refinement types, or singleton types. * Connections with not-so-clearly related approaches such as abstract interpretation and constraints. * Applications to lambda calculus and similar systems, e.g., denotational semantics, analysis/synthesis of lambda models (domains), characterization of operational properties, etc. * Applications for programming languages, e.g., program analysis (flow, strictness, totality, etc.), accurate type error messages, increased flexibility with static typing, separate compilation and modularity, optimizing transformations, types for objects, etc. * Applications for other areas, e.g., database query languages, program extraction from proofs, type systems for natural languages. INVITED SPEAKER (confirmed) Frank Pfenning (Carnegie Mellon University, USA) REGISTRATION FEE 50 Euro for the workshop; an additional 80 Euro will be charged to participants who haven't registered for one of the main FLoC conferences (but only once, not per workshop) PROGRAM COMMITTEE: Steffen van Bakel (Chair) (Imperial College, London, UK) Franco Barbanera (Universita` di Catania, Italia) Mario Coppo (Universita` di Torino, Italia) Luca Roversi (Universita` di Torino, Italia) Lyn Turbak (Wellesley College (MA) USA) Pawel Urzyczyn (Uniwersytet Warszawski, Polska) Joe Wells (Heriot-Watt University, Edinburgh, Scotland) SUBMISSION INSTRUCTIONS: TOPIC: A submitted paper must describe work that does not substantially overlap with work that has been previously published or is currently being considered elsewhere (e.g., another workshop, conference, or journal). Feel free to consult the program chair on the appropriateness of a topic or the possibility of conflict with another publication. PRINTED APPEARANCE: The paper must be written in English. The paper (including bibliography) should not exceed 15 pages. The paper should a font size no smaller than 11pt and standard TeX spacing. It is recommended to include full proofs of any theorems in appendices if they will not fit in 15 pages. However, any appendices beyond the 15-page limit should not be needed for judging the paper and will not be included in the proceedings. PAPER ELECTRONIC FORMAT: The paper should be in PostScript or PDF. Every effort should be made to ensure that only portable PostScript features are used (e.g., avoid using non-standard built-in fonts). For other formats, ask the program chair well in advance of the deadline. For TeX, the class file itrspaper.cls is recommended for use (available at http://www.doc.ic.ac.uk/~itrs02/itrspaper.cls). ADMINISTRATIVE INFORMATION: The first page of the paper should include (1) the title, (2) the list of authors, (3) a brief abstract (fewer than 200 words), (4) a short list of key words/topics, and (5) the name, e-mail address, and postal address of the corresponding author. This information should be repeated at the Paper Submission Page available at the workshop's website =3D = (http://www.doc.ic.ac.uk/~itrs02/). SUBMISSION: Papers can be submitted electronically via the Paper Submission Page available at the workshop's website =3D = (http://www.doc.ic.ac.uk/~itrs02/). VENUE: The workshop is colocated with the FLoC '02 conference, which will be held in Copenhagen, Denmark. CONTACT INFORMATION: Web: http://www.doc.ic.ac.uk/~itrs02/ Program chair: Steffen van Bakel e-mail: itrs02@doc.ic.ac..uk telephone: +44 20 7495 8263 fax: +44 20 7581 8024 postal: Department of Computing Imperial College 180 Queens's Gate London SW7 2BZ, UK --PopOver-2.0.150-1017062895-3 Content-Type: text/enriched; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Courier(Apologies for multiple copies) (Second) Call for Papers Workshop on Intersection Types and Related Systems (ITRS '02) Copenhagen, Denmark Friday, July 26 2002 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/ Co-located with FLoC '02, the third Federated Logic Conference to be held in Copenhagen, Denmark (July 22 to August 1 2002) 0000,0000,ffff= http://floc02.diku.dk/ IMPORTANT DATES/DEADLINES: Submission of papers: Sunday, April 7 2002 Notification of acceptance: Thursday, April 25 2002 Workshop: Friday, July 26 2002 OVERALL TOPIC AND FORMAT OF WORKSHOP: Intersection type disciplines originated in 1980 to overcome the limitations of Curry's type assignment system and to provide a characterisation of the strongly normalising terms of the Lambda Calculus. Since then, intersection types disciplines were used in a series of papers for characterising evaluation properties and semantics. Types also support reliable reasoning in many areas such as logic, programming languages, linguistics, etc. A _polymorphic_ type stands for some number of instance types, and the use of type systems for non-trivial purposes generally requires polymorphic types. In this context, roughly speaking, intersection types could be seen as to provide type polymorphism by listing type instances. This differs from the more widely used ("forall") quantified types, which provide type polymorphism by giving a type scheme that can be instantiated into various type instances. (A similar relationship holds between union types and existential types, the duals of intersection types and universal types.) Although intersection types were initially intended for use in analyzing and/or synthesizing lambda models as well as in analyzing normalization properties, over the last twenty years the scope of theoretical research on intersection types has broadened. Recently, there have been a number of breakthroughs in the use of intersection types (and similar technology) for practical purposes such as program analysis. The ITRS '02 workshop will be held to bring together researchers working on both the theory and practice of systems with intersection types and related systems (e.g., union types, refinement types, etc.). The workshop will last one full day and will contain a long talk by each invited speaker, a panel discussion, and a short (approx. 25 minutes) talk for each accepted paper. POSSIBLE TOPICS FOR SUBMITTED PAPERS: Researchers are invited to submit original papers on topics in the spirit of the workshop. Possible topics for submitted papers include, but are not limited to: * Formal properties of systems with intersection types: principal typings, normalization properties (for normal forms, head-normal forms, weak head-normal forms, etc.), type inference algorithms. * Results for clearly related systems, e.g., systems with union types, refinement types, or singleton types. * Connections with not-so-clearly related approaches such as abstract interpretation and constraints. * Applications to lambda calculus and similar systems, e.g., denotational semantics, analysis/synthesis of lambda models (domains), characterization of operational properties, etc. * Applications for programming languages, e.g., program analysis (flow, strictness, totality, etc.), accurate type error messages, increased flexibility with static typing, separate compilation and modularity, optimizing transformations, types for objects, etc. * Applications for other areas, e.g., database query languages, program extraction from proofs, type systems for natural languages. INVITED SPEAKER (confirmed) Frank Pfenning (Carnegie Mellon University, USA) REGISTRATION FEE 50 Euro for the workshop; an additional 80 Euro will be charged to participants who haven't registered for one of the main FLoC conferences (but only once, not per workshop) PROGRAM COMMITTEE: Steffen van Bakel (Chair) (Imperial College, London, UK) Franco Barbanera (Universita` di Catania, Italia) Mario Coppo (Universita` di Torino, Italia) Luca Roversi (Universita` di Torino, Italia) Lyn Turbak (Wellesley College (MA) USA) Pawel Urzyczyn (Uniwersytet Warszawski, Polska) Joe Wells (Heriot-Watt University, Edinburgh, Scotland) SUBMISSION INSTRUCTIONS: TOPIC: A submitted paper must describe work that does not substantially overlap with work that has been previously published or is currently being considered elsewhere (e.g., another workshop, conference, or journal). Feel free to consult the program chair on the appropriateness of a topic or the possibility of conflict with another publication. PRINTED APPEARANCE: The paper must be written in English. The paper (including bibliography) should not exceed 15 pages. The paper should a font size no smaller than 11pt and standard TeX spacing. It is recommended to include full proofs of any theorems in appendices if they will not fit in 15 pages. However, any appendices beyond the 15-page limit should not be needed for judging the paper and will not be included in the proceedings. PAPER ELECTRONIC FORMAT: The paper should be in PostScript or PDF. Every effort should be made to ensure that only portable PostScript features are used (e.g., avoid using non-standard built-in fonts). For other formats, ask the program chair well in advance of the deadline. For TeX, the class file itrspaper.cls is recommended for use (available at 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/itrspaper.cls). ADMINISTRATIVE INFORMATION: The first page of the paper should include (1) the title, (2) the list of authors, (3) a brief abstract (fewer than 200 words), (4) a short list of key words/topics, and (5) the name, e-mail address, and postal address of the corresponding author. This information should be repeated at the Paper Submission Page available at the workshop's website =3D (= 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/). SUBMISSION: Papers can be submitted electronically via the Paper Submission Page available at the workshop's website =3D (= 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/). VENUE: The workshop is colocated with the FLoC '02 conference, which will be held in Copenhagen, Denmark. CONTACT INFORMATION: Web: 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/ Program chair: Steffen van Bakel e-mail: 0000,0000,ffff= itrs02@doc.ic.ac..uk telephone: +44 20 7495 8263 fax: +44 20 7581 8024 postal: Department of Computing Imperial College 180 Queens's Gate London SW7 2BZ, UK --PopOver-2.0.150-1017062895-3-- From heringto@cs.unc.edu Mon Mar 25 20:00:58 2002 From: heringto@cs.unc.edu (Dean Herington) Date: Mon, 25 Mar 2002 15:00:58 -0500 Subject: instance Read Dynamic ? Message-ID: <3C9F81FA.833184A6@cs.unc.edu> The type `Dynamic` is an instance of `Show` but not of `Read`. Is there some reason `Dynamic` could not be made an instance of `Read`? Has anyone extended `Dynamic` in that way? Dean Herington From bhuffman@galois.com Mon Mar 25 20:55:48 2002 From: bhuffman@galois.com (Brian Huffman) Date: Mon, 25 Mar 2002 12:55:48 -0800 Subject: instance Read Dynamic ? In-Reply-To: <3C9F81FA.833184A6@cs.unc.edu> References: <3C9F81FA.833184A6@cs.unc.edu> Message-ID: <200203252055.g2PKtmF02271@localhost.localdomain> On Monday 25 March 2002 12:00 pm, Dean Herington wrote: > The type `Dynamic` is an instance of `Show` but not of `Read`. Is there > some reason `Dynamic` could not be made an instance of `Read`? Has > anyone extended `Dynamic` in that way? Here is a snippet of code from the GHC Dynamic library; you will notice that Dynamic objects contain a TypeRep and a data object, but the data object is ignored by show (as it must be, since the Obj could be anything, showable or not): data Dynamic = Dynamic TypeRep Obj instance Show Dynamic where -- the instance just prints the type representation. showsPrec _ (Dynamic t _) = showString "<<" . showsPrec 0 t . showString ">>" It is impossible to make a matching Read instance, because you lose information when you show a Dynamic object; there is no way a read function can reconstruct the data object's value. It probably wouldn't be too difficult to make a readable version of Dynamic, but it would only be able to hold datatypes that were instances of Read and Show. I'd be interested to see if anyone else has implemented anything like this; it seems like it could be pretty useful. - Brian Huffman From ºÃÉÌÎñ Tue Mar 26 02:29:02 2002 From: ºÃÉÌÎñ (ºÃÉÌÎñ) Date: Tue,26 Mar 2002 15:27:50 +0800 Subject: »¶Ó­¹âÁÙ¡°ºÃÉÌÎñ¡±ÆóÒµÍø Message-ID: <20020326072848.C2E6F4220CB@www.haskell.org> ------=_Mail_Part_PPP_SMTP_01C11A5B.CEFD965 Content-Type: multipart/alternative; boundary="----=_Mail_Part_PPP_POP3_01C11A8E.4ECE36A0" ------=_Mail_Part_PPP_POP3_01C11A8E.4ECE36A0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: 8bit »¶Ó­µÇ½

    »¶Ó­µÇ½¡°ºÃÉÌÎñ¡±ÆóÒµÍøÕ¾(www.good35.com)

    ×ð¾´µÄÅóÓÑ£º

        ÄúºÃ£¡

         ¡°ºÃÉÌÎñ¡±ÆóÒµÍøÕ¾--ÖйúÆóÒµÉÌÎñÐÅÏ¢Íø¡£ÒÔ¡°ÎªÆóÒµ´´ÔìÐ§Òæ¡±Îª¾­ÓªÀíÄ×ÅÁ¦ÓÚÆóÒµµÄÍøÉÏÐû´«¡¢ÓªÏúºÍ¹ÜÀíµÈ¹¤×÷µÄÈ«Ãæ·¢Õ¹¡£ËüÒÔ¸ü±ã½ÝµÄÐÅÏ¢¹µÍ¨£¬¸üµÍÁ®µÄ¼Û¸ñ£¬¸üÓÅÖʵķþÎñ£¬¸üÇ÷ÓÚ¸öÐÔ»¯µÄ¹ÜÀí£¬Á¦Õù³ÉΪÆóÒµÉÏÍøµÄÊ×ѡƽ̨¡£

        ¡°ºÃÉÌÎñ¡±ÎªÆóÒµÌṩ¶àÖÖ¼¼Êõ·þÎñºÍÈí¡¢Ó²¼þÖ§³Ö£¬ÎªÆóÒµÌṩ¶àÖÖµÄÍøÕ¾Éè¼ÆÄ£°å£¬Ìṩ¶àÀàÃâ·ÑCGI³ÌÐò£¬¿ÉÉêÇëÃâ·Ñ¶þ¼¶ÓòÃû£¬ÀûÓÃ×ÔÖúÍøÕ¾Éú³Éϵͳ£¬Ê¹ÆóÒµ½¨Õ¾¸üÇáËÉ¡£¡°ºÃÉÌÎñ¡±ÒÀÍеçÐŹ«ÓÃÊý¾ÝͨÐÅÆ½Ì¨£¬ÎªÆóÒµ¿Í»§ÌṩÊý¾ÝÏß·¡¢ÍøÂç½ÓÈëºÍÍøÂçÓ¦ÓõȶàÖÖ·þÎñ¡£¡°ºÃÉÌÎñ¡±ÖصãÍ»³öÍøÉÏÓªÏú£¬Í¨¹ýÐÂÆ·Õ¹Ê¾¡¢¾«Æ·ÈÈÂô¡¢ÍøÉϳ¬ÊС¢ÍøÉÏרÂôµê¡¢¹©ÇóÐÅÏ¢·¢²¼ÒÔ¼°ÏîÄ¿ÕÐͶ±ê¡¢ÕÐÉÌÒý×Ê¡¢È˲ÅÊг¡µÈÀ¸Ä¿µÄÍÆ³ö£¬Ê¹ÍøÂçÓªÏú¸ü¾«²Ê¡£

        ¡°ºÃÉÌÎñ¡±µÄÒ»Çлù±¾¹¦Äܶ¼½«Ãâ·ÑΪÄú¿ª·Å£¬Ï£ÍûÄܽ衰ºÃÉÌÎñ¡±×¨ÒµÉÌÎñƽ̨£¬Îª¹ó¹«Ë¾µÄ·¢Õ¹ÖúÒ»±ÛÖ®Á¦¡£µ±È»£¬ÄúÒ²¿ÉÒÔÑ¡Óá°ºÃÉÌÎñ¡±µÄÇ¿´óÑÓÉì·þÎñ£¬¹¦ÄܸüÈ«£¬¼Û¸ñ¸üÓÅ¡£¡°ºÃÉÌÎñ¡±£¬ÎªÆóÒµ´´ÔìÐ§Òæ¡£

        ÎÒÃdzÏÖ¿µØÑûÇë¹ó¹«Ë¾¼ÓÃË¡°ºÃÉÌÎñ¡±£¬ÇëµÇ½www.good35.com£¬ÉêÇëÄãµÄÕʺźͿռ䡣Ը¹ó¹«Ë¾ÔÚ¡°ºÃÉÌÎñ¡±µÄЭÖúÏ£¬Äܹ»ÔÚÍøÉÏÓªÏúÁìÓò´óÕ¹ºêͼ¡£

        ºÃÉÌÎñ£¬ÆóÒµµÄºÃ°ïÊÖ£¡

         ¡°ºÃÉÌÎñ¡±ÆóÒµÍøwww.good35.com

            

                                                                     

    ¡¡

    ¡¡

    ¡¡

    ¡¡

    ------=_Mail_Part_PPP_POP3_01C11A8E.4ECE36A0-- ------=_Mail_Part_PPP_SMTP_01C11A5B.CEFD965-- From ºÃÉÌÎñ Tue Mar 26 02:29:02 2002 From: ºÃÉÌÎñ (ºÃÉÌÎñ) Date: Tue,26 Mar 2002 15:27:50 +0800 Subject: »¶Ó­¹âÁÙ¡°ºÃÉÌÎñ¡±ÆóÒµÍø Message-ID: <20020326072851.DB86C42223A@www.haskell.org> ------=_Mail_Part_PPP_SMTP_01C11A5B.CEFD965 Content-Type: multipart/alternative; boundary="----=_Mail_Part_PPP_POP3_01C11A8E.4ECE36A0" ------=_Mail_Part_PPP_POP3_01C11A8E.4ECE36A0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: 8bit »¶Ó­µÇ½

    »¶Ó­µÇ½¡°ºÃÉÌÎñ¡±ÆóÒµÍøÕ¾(www.good35.com)

    ×ð¾´µÄÅóÓÑ£º

        ÄúºÃ£¡

         ¡°ºÃÉÌÎñ¡±ÆóÒµÍøÕ¾--ÖйúÆóÒµÉÌÎñÐÅÏ¢Íø¡£ÒÔ¡°ÎªÆóÒµ´´ÔìÐ§Òæ¡±Îª¾­ÓªÀíÄ×ÅÁ¦ÓÚÆóÒµµÄÍøÉÏÐû´«¡¢ÓªÏúºÍ¹ÜÀíµÈ¹¤×÷µÄÈ«Ãæ·¢Õ¹¡£ËüÒÔ¸ü±ã½ÝµÄÐÅÏ¢¹µÍ¨£¬¸üµÍÁ®µÄ¼Û¸ñ£¬¸üÓÅÖʵķþÎñ£¬¸üÇ÷ÓÚ¸öÐÔ»¯µÄ¹ÜÀí£¬Á¦Õù³ÉΪÆóÒµÉÏÍøµÄÊ×ѡƽ̨¡£

        ¡°ºÃÉÌÎñ¡±ÎªÆóÒµÌṩ¶àÖÖ¼¼Êõ·þÎñºÍÈí¡¢Ó²¼þÖ§³Ö£¬ÎªÆóÒµÌṩ¶àÖÖµÄÍøÕ¾Éè¼ÆÄ£°å£¬Ìṩ¶àÀàÃâ·ÑCGI³ÌÐò£¬¿ÉÉêÇëÃâ·Ñ¶þ¼¶ÓòÃû£¬ÀûÓÃ×ÔÖúÍøÕ¾Éú³Éϵͳ£¬Ê¹ÆóÒµ½¨Õ¾¸üÇáËÉ¡£¡°ºÃÉÌÎñ¡±ÒÀÍеçÐŹ«ÓÃÊý¾ÝͨÐÅÆ½Ì¨£¬ÎªÆóÒµ¿Í»§ÌṩÊý¾ÝÏß·¡¢ÍøÂç½ÓÈëºÍÍøÂçÓ¦ÓõȶàÖÖ·þÎñ¡£¡°ºÃÉÌÎñ¡±ÖصãÍ»³öÍøÉÏÓªÏú£¬Í¨¹ýÐÂÆ·Õ¹Ê¾¡¢¾«Æ·ÈÈÂô¡¢ÍøÉϳ¬ÊС¢ÍøÉÏרÂôµê¡¢¹©ÇóÐÅÏ¢·¢²¼ÒÔ¼°ÏîÄ¿ÕÐͶ±ê¡¢ÕÐÉÌÒý×Ê¡¢È˲ÅÊг¡µÈÀ¸Ä¿µÄÍÆ³ö£¬Ê¹ÍøÂçÓªÏú¸ü¾«²Ê¡£

        ¡°ºÃÉÌÎñ¡±µÄÒ»Çлù±¾¹¦Äܶ¼½«Ãâ·ÑΪÄú¿ª·Å£¬Ï£ÍûÄܽ衰ºÃÉÌÎñ¡±×¨ÒµÉÌÎñƽ̨£¬Îª¹ó¹«Ë¾µÄ·¢Õ¹ÖúÒ»±ÛÖ®Á¦¡£µ±È»£¬ÄúÒ²¿ÉÒÔÑ¡Óá°ºÃÉÌÎñ¡±µÄÇ¿´óÑÓÉì·þÎñ£¬¹¦ÄܸüÈ«£¬¼Û¸ñ¸üÓÅ¡£¡°ºÃÉÌÎñ¡±£¬ÎªÆóÒµ´´ÔìÐ§Òæ¡£

        ÎÒÃdzÏÖ¿µØÑûÇë¹ó¹«Ë¾¼ÓÃË¡°ºÃÉÌÎñ¡±£¬ÇëµÇ½www.good35.com£¬ÉêÇëÄãµÄÕʺźͿռ䡣Ը¹ó¹«Ë¾ÔÚ¡°ºÃÉÌÎñ¡±µÄЭÖúÏ£¬Äܹ»ÔÚÍøÉÏÓªÏúÁìÓò´óÕ¹ºêͼ¡£

        ºÃÉÌÎñ£¬ÆóÒµµÄºÃ°ïÊÖ£¡

         ¡°ºÃÉÌÎñ¡±ÆóÒµÍøwww.good35.com

            

                                                                     

    ¡¡

    ¡¡

    ¡¡

    ¡¡

    ------=_Mail_Part_PPP_POP3_01C11A8E.4ECE36A0-- ------=_Mail_Part_PPP_SMTP_01C11A5B.CEFD965-- From bahadirsevinc@firat.edu.tr Tue Mar 26 10:44:35 2002 From: bahadirsevinc@firat.edu.tr (=?iso-8859-9?B?QmFoYWT9ciBTRVbdTsc=?=) Date: Tue, 26 Mar 2002 12:44:35 +0200 Subject: Little problem Message-ID: Hello I have little problem. I want to solve this equation f(n-1) = f(n)+n f(6)=6 => f(2)=? Can anybody help me please ? Best regards.. Bahadýr SEVÝNÇ From bahadirsevinc@firat.edu.tr Tue Mar 26 13:51:21 2002 From: bahadirsevinc@firat.edu.tr (=?iso-8859-9?B?QmFoYWT9ciBTRVbdTsc=?=) Date: Tue, 26 Mar 2002 15:51:21 +0200 Subject: I need some help Message-ID: Hello I am writing a whole program which is analyz a elegtromagnetic wave. This is ok but in the program I use a lot of constant for example pi,epsilon etc. I want to ask that how I use a constant in Haskell ? However the user of the program give some argument then program is starting. And I want to use this arguments for example at the end of the program. What will I do. Thanks Baha Electrical & Electronics Engineer Bahadýr SEVÝNÇ Fýrat University Informatics Department & Computer Center Elazýð / Türkiye 23169 Tlf: +90 424 2370000-5011 From jadrian@mat.uc.pt Tue Mar 26 15:46:13 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Tue, 26 Mar 2002 15:46:13 +0000 Subject: I need some help In-Reply-To: References: Message-ID: <20020326154911.A7B2A422221@www.haskell.org> [Obs: moving to haskell cafe] [beware, huge answer follows] > Hello > I am writing a whole program which is analyz a elegtromagnetic wave. This > is ok but in the program I use a lot of constant for example pi,epsilon > etc. I want to ask that > how I use a constant in Haskell ? Defining constants it's easy, examples. -- with no type signature epsilon = 3.1 -- with explicit type signature epsilon2 :: Double epsilon2 = 3.1 -- specifying the type but no type signature epsilon3 = 3.1 :: Double (by the way, wouldn't it make sense not to get a warning about missing type signature in this last case. I know there is no signature there but still...) > However the user of the program give some argument then program is > starting. And I want to use this arguments for example at the end of the > program. What will I do. Good question. I've had a bad time with this, some in this list proably got tired of me saying the same thing over and over again... those of you might want to skip the rest of my mail :-) If you want the user to be able to chose those values, then they are NOT constants, period. Yes their values won't chnage during the rest of the algorithm, but that doesn't makes it constants, so you can't declare them that way. What *can* you do. 1. One *awfull* option is to pass thos values as arguments to all your functions. Yes signatures will get monstruous, it will complicate the developing process etc, 2. Instead of passing all those variables, group them in a record - data type with named fields - and pass that record arround. (http://www.haskell.org/onlinereport/exps.html#sect3.15) Signatures will get better. It's kind of weird though, to always have to pass around that record. Things can get quite messy, IMO. -- foo f :: Double -> Double -> Double f x y = eta*x - epsilon^2*y -- foo2 f :: Options -> Double -> Double -> Double f opt x y = (eta opt)* (epsilon opt)^2*y And this is just a very simple example, it can get much worst. 3. Implicit parameters. (At least in Ghc, what about others?) Now this is the closest to an elegant solution. *Read both*: http://citeseer.nj.nec.com/246042.html http://www.cs.chalmers.se/~rjmh/Globals.ps f :: (?eta::Double, ?epsilon::Double)=> Double -> Double -> Double f x y = ?eta*x - ?epsilon^2*y Now you don't have to specify eta and epsilon in the type signature itself, but in the context - no passing around extra (not natural) parameters. It makes an huge diference IMO when developing your algorithms. Still signatures wil get even bigger than if you just passed them as parameters, you can't even type the context like: (?eta, ?epsilon::Double) So that is just awfull! Once again records will help. f :: (?opt::Options)=> Double -> Double -> Double f x y = (eta ?opt) *x - (epsilon ?opt)^2*y It still lokes quite bad. I *hate* the field projection functions, and I hate the '?'!! So you could simply rename you data opt fields and declare, eta :: (?opt:: Options) => Double eta = etaF ?opt epsilon :: (?opt:: Options) => Double epsilon = epsilonF ?opt Now f could be written like: f :: (?opt::Options)=> Double -> Double -> Double f x y = eta*x - epsilon^2*y Which differs from the first f function only in the context. It is *almost* good enough for me :-) "Why the almost?" you ask... Well, implicit parameters are not only non-standard features, but also experimental features (right?), so you they can change anytime. -------------------------------------------------------------------------------------- NOTE: some of you might wanna quit reading here, I keep complaining about this stuff, you are probably tired of it :-) -------------------------------------------------------------------------------------- In a couple of days you will also want to use more than one record, because grouping certain constants together doesn't feel right, and contexts will get bigger. Also, you will want to use global variables and instead of a record you will use an STRef to a record, and very small signatures will have in they're context something like: (?opt :: STRef s Opt). And then you will need to update some option fields, and you will want to use modifySTRef, and you will need to create an applyField function to every damn field of the record... So you will start asking 1. (when) will we have implicit contexts available? 2. wouldn't it be good to have, besides the data projection functions, some update and apply field functions, automaticly derived when declaring the data type? [yes am actually *asking* if *anyone agrees* with me? haven't had any feedback on this one, so I don't no wether it is a good or just plain dumb idea] IMVHO, it is of extreme importance and *urgent* to get implicit parameters right. This question about how to use this 'user difined constants' is a *simple* question and should have a *very simple* and standard answer. The same goes to global variables. We need them in certain situations and it is supposed to be, and it can be from my experience, *simple*. J.A. From feuer@his.com Tue Mar 26 17:31:44 2002 From: feuer@his.com (Feuer) Date: Tue, 26 Mar 2002 12:31:44 -0500 Subject: first-class modules Message-ID: <3CA0B080.F9E26CB9@his.com> A number of people have discussed the use of implicit parameters to mimic global variables in Haskell. I am wondering if any have done the same for a first-class module system such as that proposed by Shields and Jones. It seems to make a tremendous amount of sense to do it that way: 1. semi-constant values: Things that are calculated or input at the beginning of the program could be handled by Main.main, which would pass the results to the Second module, whose main function it could then call. This seems much more natural than the implicit parameter approach for this purpose. 2. others: whenever a group of functions are likely to share a particular argument, they can be grouped in a module for greater convenience. For example, a library of mathematical functions that should all share a certain precision indicator could be grouped in a module: the user of the module could instantiate it once with the right precision and then use all the functions at that precision. David Feuer (please reply to dfeuer@cs.brown.edu) From Jon.Fairbairn@cl.cam.ac.uk Tue Mar 26 18:07:36 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Tue, 26 Mar 2002 18:07:36 +0000 Subject: first-class modules In-Reply-To: Your message of "Tue, 26 Mar 2002 12:31:44 EST." <3CA0B080.F9E26CB9@his.com> Message-ID: <19893.1017166056@cl.cam.ac.uk> David Feuer wrote: > A number of people have discussed the use of implicit parameters to > mimic global variables in Haskell. I am wondering if any have done the= > same for a first-class module system such as that proposed by Shields > and Jones. It seems to make a tremendous amount of sense to do it that= > way: > = > 1. semi-constant values: Things that are calculated aren't a problem unless they depend on something that's input at run-time. > or input at the beginning of the program could be handled > by Main.main, which would pass the results to the Second > module, whose main function it could then call. This > seems much more natural than the implicit parameter > approach for this purpose. This approach could also solve the "here document" question. If we allow modules that define a value rather than names and are in a range of different syntaxes, we can import the value at the point of use. Having foreign values in files would allow things such as the import of a font metric file as a constant, which would be much nicer than reading it from a file and having to pass it around. J=F3n From lmp@di.fct.unl.pt Tue Mar 26 18:00:02 2002 From: lmp@di.fct.unl.pt (Luis Moniz Pereira) Date: Tue, 26 Mar 2002 18:00:02 +0000 Subject: Postdoc positions at CENTRIA Message-ID: <3CA0B722.3C22958B@di.fct.unl.pt> Please post The Research Center for Artificial Intelligence (CENTRIA) at the Universidade Nova de Lisboa (UNL) offers as of now several post-doctoral research positions, in the areas of: Machine Learning. Neural Networks. Data Mining. Text Mining. each for nine months to a year (yearly extensions possible), starting immediately or within the next few months. Candidates must hold a doctoral degree and may apply by sending us their CV and other relevant information, namely regarding availability date and duration of stay AS SOON AS POSSIBLE. Salaries are negotiable, starting at 1,500 Euros net per month, up to 2,000 Euros. Further information at: http://centria.di.fct.unl.pt/~nmm/PostDoc/ -- Professor Luis Moniz Pereira http://centria.di.fct.unl.pt/~lmp/ Director AI Centre CENTRIA http://centria.fct.unl.pt/ Departamento de Informatica Ph (+351) 21 294 8533 Fax 21 294 8541 Universidade Nova de Lisboa Secretary: (+351) 21 294 8536 2829-516 Caparica, Portugal Email: lmp@di.fct.unl.pt From jadrian@mat.uc.pt Tue Mar 26 20:02:59 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Tue, 26 Mar 2002 20:02:59 +0000 Subject: first-class modules In-Reply-To: <3CA0B080.F9E26CB9@his.com> References: <3CA0B080.F9E26CB9@his.com> Message-ID: <20020326200610.AD2844220B5@www.haskell.org> > On Tuesday 26 March 2002 17:31, you wrote: > A number of people have discussed the use of implicit parameters to > mimic global variables in Haskell.  I am wondering if any have done the > same for a first-class module system such as that proposed by Shields > and Jones.  It seems to make a tremendous amount of sense to do it that > way: > > 1.  semi-constant values:  Things that are calculated or input at the > beginning of the program could be handled by Main.main, which would pass > the results to the Second module, whose main function it could then > call.  This seems much more natural than the implicit parameter approach > for this purpose. It seems nice for that *specific* purpose. What I like about implicit parameters is the fact that they are a more general approach, and that is IMO very important. You, might for instance, decide that maybe it would be a good idea to, under certain specific conditions, change one of those "semi-constant" values. Imagine some AI algortithm, you iterate some learning function 'learnF' over and over again. Now you realize that under certain conditions maybe the learning rate (used in learnF) should be changed. Chaging your implementation would be easy with implicit parameters. J.A. From mpool02@multiparadigm.org Wed Mar 27 07:07:29 2002 From: mpool02@multiparadigm.org (MPOOL 2002) Date: Wed, 27 Mar 2002 08:07:29 +0100 Subject: MPOOL 2002 - FINAL CALL FOR PAPERS Message-ID: <3CA16FB1.52B0189E@multiparadigm.org> We apologize if you have received this CfP multiple times. -------------------------------------------------------------------- CALL FOR PARTICIPATION Workshop on MULTIPARADIGM PROGRAMMING WITH OO LANGUAGES (MPOOL 2002, June 11) at the EUROPEAN CONFERENCE ON OBJECT-ORIENTED PROGRAMMING (ECOOP 2002, Malaga, Spain, June 10-14) While OO has become ubiquitously employed for design, implementation, and even conceptualization, many practitioners recognize the concomitant need for other programming paradigms according to problem domain. We seek answers to the question of how to address the need for other programming paradigms in the general context of OO languages. Specific areas of interest include, but are not limited to: * non-OO programming with OO languages; * merging functional/logic/OO/other programs (language crossbinding); * non-OO programming at the meta level (e.g. template metaprogramming) * module systems vs. object systems * OO design patterns and their relation to functional patterns * type system relationships across languages * theoretical foundations of multiparadigm programming with OO languages The deadline for the submission of a 5+ pages abstract is 8 April 2002 Prospective authors are invited to submit abstracts in PDF or postscript. Any common encoding (MIME or uuencode) or compression (zip, gzip) is acceptable. Authors of accepted papers are responsible for submitting the final version using the Springer LNCS LaTeX template (http://www.springer.de/comp/lncs/authors.html) by May 2, to ensure prompt printing of the proceedings. Submission and email correspondence to mpool02@multiparadigm.org. ORGANIZATION This workshop is a joint organization by the John von Neumann Institute for Computing (NIC) at Research Centre Juelich, Los Alamos National Laboratory, and the Georgia Institute of Technology. PROGRAM COMMITTEE Gerald Baumgartner (Ohio State University, Ohio, USA) Kei Davis (Los Alamos National Laboratory, New Mexico, USA) Jaakko Jaervi (Indiana University, Indiana, USA) Peter Van Roy (Universite catholique de Louvain, Belgium) Yannis Smaragdakis (Georgia Institute of Technology, Georgia, USA) Joerg Striegnitz (John von Neumann Institute for Computing, Germany) FURTHER INFORMATION MPOOL'2002: http://www.multiparadigm.org/mpool2002 ECOOP'2002: http://ecoop2002.lcc.uma.es From romildo@uber.com.br Wed Mar 27 15:30:05 2002 From: romildo@uber.com.br (=?iso-8859-1?Q?Jos=E9?= Romildo Malaquias) Date: Wed, 27 Mar 2002 12:30:05 -0300 Subject: Mutable arrays in Haskell 98 Message-ID: <20020327153005.GA14181@darling.home.br> Hello. I would like to use muttable arrays in Haskell 98, with the GHC _and_ NHC98 compilers. By muttable arrays I mean arrays with in-place updates, as with the MArray arrays (which are not Haskell 98 conformant) found in GHC. Is such array implmentation available? Regards. Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br From Malcolm.Wallace@cs.york.ac.uk Wed Mar 27 15:58:46 2002 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Wed, 27 Mar 2002 15:58:46 +0000 Subject: Mutable arrays in Haskell 98 In-Reply-To: <20020327153005.GA14181@darling.home.br> References: <20020327153005.GA14181@darling.home.br> Message-ID: <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> José Romildo Malaquias writes: > I would like to use muttable arrays in Haskell 98, with the GHC > _and_ NHC98 compilers. By muttable arrays I mean arrays with > in-place updates, as with the MArray arrays (which are not > Haskell 98 conformant) found in GHC. Is such array implmentation > available? Both compilers have libraries supporting the `IOArray' type, implemented with in-place update, although obviously the operations must be threaded through the IO monad. module IOExtras -- called IOExts in ghc ( ... , IOArray -- data IOArray ix elt -- mutable arrays , newIOArray -- :: Ix ix => (ix,ix) -> elt -> IO (IOArray ix elt) , boundsIOArray -- :: Ix ix => IOArray ix elt -> (ix, ix) , readIOArray -- :: Ix ix => IOArray ix elt -> ix -> IO elt , writeIOArray -- :: Ix ix => IOArray ix elt -> ix -> elt -> IO () , freezeIOArray -- :: Ix ix => IOArray ix elt -> IO (Array ix elt) , module Ix -- re-export Ix for the benefit of IOArrays -- instance Eq (IOArray ix elt) ) Regards, Malcolm From jadrian@mat.uc.pt Wed Mar 27 16:29:59 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Wed, 27 Mar 2002 16:29:59 +0000 Subject: Little problem In-Reply-To: References: Message-ID: <20020327163346.0ABEA42221A@www.haskell.org> [moving to haskell-cafe] > Hello > I have little problem. I want to solve this equation > > f(n-1) = f(n)+n > f(6)=6 This is a simple recursive definition.. By the way, are you sure you didn't meant: f(n-1)=f(n)+(n-1) > => f(2)=? Not exactly sure what you're after here. You could simply do: f(2) =f(3)+3 =f(4)+4+3 =f(5)+5+4+3 =f(6)+6+5+4+3 =6+6+5+4+3 =24 anyway it's simple to see, or even prove by induction, that f(n) = (\sum_{i=n+1}^{7} i) -1 = (n+8)(7-n)/2 - 1 If I'm rigth and you're formula is suposed to be f(n-1) = f(n)+n it is even easier. J.A. From romildo@uber.com.br Wed Mar 27 23:16:44 2002 From: romildo@uber.com.br (=?iso-8859-1?Q?Jos=E9?= Romildo Malaquias) Date: Wed, 27 Mar 2002 20:16:44 -0300 Subject: Mutable arrays in Haskell 98 In-Reply-To: <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> References: <20020327153005.GA14181@darling.home.br> <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <20020327231644.GA8755@darling.home.br> On Wed, Mar 27, 2002 at 03:58:46PM +0000, Malcolm Wallace wrote: > José Romildo Malaquias writes: > > > I would like to use muttable arrays in Haskell 98, with the GHC > > _and_ NHC98 compilers. By muttable arrays I mean arrays with > > in-place updates, as with the MArray arrays (which are not > > Haskell 98 conformant) found in GHC. Is such array implmentation > > available? > > Both compilers have libraries supporting the `IOArray' type, > implemented with in-place update, although obviously the operations > must be threaded through the IO monad. > > module IOExtras -- called IOExts in ghc > ( ... > , IOArray -- data IOArray ix elt -- mutable arrays > , newIOArray -- :: Ix ix => (ix,ix) -> elt -> IO (IOArray ix elt) > , boundsIOArray -- :: Ix ix => IOArray ix elt -> (ix, ix) > , readIOArray -- :: Ix ix => IOArray ix elt -> ix -> IO elt > , writeIOArray -- :: Ix ix => IOArray ix elt -> ix -> elt -> IO () > , freezeIOArray -- :: Ix ix => IOArray ix elt -> IO (Array ix elt) > > , module Ix -- re-export Ix for the benefit of IOArrays > -- instance Eq (IOArray ix elt) > ) I am having difficults in defining a map function over an IOArray object. My attempt was mapIOArray :: Ix ix => (a -> b) -> IOArray ix a -> IO (IOArray ix b) mapIOArray f v = do w <- newIOArray bounds ???????????? mapping w (range bounds) where bounds = boundsIOArray v mapping w (i:is) = do x <- readIOArray v i writeIOArray w i (f x) mapping w is mapping w [] = return w But I do not know what to use to replace the ????????????. Is there a polymorphic value in Haskell that can be of any type? Is it indeed possible to have such function without resorting to another intermediate data structure (like a list)? Regards, Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br From mtullsen@cse.ogi.edu Wed Mar 27 23:41:52 2002 From: mtullsen@cse.ogi.edu (Mark Tullsen) Date: Wed, 27 Mar 2002 15:41:52 -0800 Subject: Mutable arrays in Haskell 98 References: <20020327153005.GA14181@darling.home.br> <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> <20020327231644.GA8755@darling.home.br> Message-ID: <3CA258C0.9E53EBF6@cse.ogi.edu> José Romildo Malaquias wrote: > ... > My attempt was > > mapIOArray :: Ix ix => (a -> b) -> IOArray ix a -> IO (IOArray ix b) > mapIOArray f v = do w <- newIOArray bounds ???????????? > mapping w (range bounds) > where > bounds = boundsIOArray v > mapping w (i:is) = do x <- readIOArray v i > writeIOArray w i (f x) > mapping w is > mapping w [] = return w > > But I do not know what to use to replace the ????????????. Is there > a polymorphic value in Haskell that can be of any type? > Yes, use "undefined" from the Prelude: undefined :: a undefined | False = undefined - Mark From sas02@clip.dia.fi.upm.es Thu Mar 28 01:30:07 2002 From: sas02@clip.dia.fi.upm.es (sas02@clip.dia.fi.upm.es) Date: Thu, 28 Mar 2002 02:30:07 +0100 Subject: 2002 Static Analysis Symposium (SAS'02) Call for Papers Message-ID: <200203280130.g2S1U7B30799@clip.dia.fi.upm.es> (Apologies for multiple postings) ---------------------------------------------------------------------- CALL FOR PAPERS (SAS'02) The 9th International Static Analysis Symposium September 17 - 20 2002, Madrid, Spain http://clip.dia.fi.upm.es/SAS02 Submission deadline: May 5, 2002 ---------------------------------------------------------------------- Static Analysis is increasingly recognized as a fundamental tool for high performance implementations and verification systems of high-level programming languages. The series of Static Analysis Symposia has served as the primary venue for presentation of theoretical, practical, and application advances in the area. The Ninth International Static Analysis Symposium (SAS'02) will be held at the Technical University of Madrid, do-located with Logic-based Program Development and Transformation (LOPSTR'02) and the APPIA-GULP-PRODE Joint Conference on Declarative Programming (AGP'02). Previous symposia were held in Paris, Santa Barbara, Venice, Pisa, Paris, Aachen, Glasgow and Namur. The technical program for SAS'02 will consist of invited lectures, tutorials, panels, presentations of refereed papers, and software demonstrations. Contributions are welcome on all aspects of Static Analysis, including, but not limited to: * abstract interpretation, * data flow analysis, * verification systems, * program specialization, * abstract domains, * optimizing compilers, * theoretical frameworks, * type inference, * abstract model checking, * complexity analysis, * abstract testing, * security analysis. Submissions can address any programming paradigm, including concurrent, constraint, functional, imperative, logic and object-oriented programming. Survey papers that present some aspect of the above topics with a new coherence are also welcome. Papers must describe original work, be written and presented in English, and must not substantially overlap with papers that have been published or that are simultaneously submitted to a journal or a conference with refereed proceedings. Submission Instructions ----------------------- All submissions must be performed electronically at http://clip.dia.fi.upm.es/SAS02/submission.html. Submitted papers should be at most 15 pages excluding bibliography and well-marked appendices. Program committee members are not required to read the appendices, and thus papers should be intelligible without them. The proceedings will be published by Springer-Verlag in the Lecture Notes in Computer Science series (see http://www.springer.de/comp/lncs/authors.html for the LNCS author instructions). Thus, adhering to that style already in the submission is strongly encouraged. Papers should be submitted either in PostScript or PDF format and they should be interpretable by Ghostscript or Acrobat Reader. Papers must be printable on either A4 paper or US letter, and preferably on both. Important Dates --------------- May 5, 2002 Submission deadline June 10, 2002 Notification June 30, 2002 Final version Sept 17-20, 2002 SAS'02 Program Committee ----------------- Manuel Hermenegildo (Chair) Technical University of Madrid, Spain German Puebla (Co-chair) Technical University of Madrid, Spain Radhia Cousot Ecole Polytechnique, France Saumya Debray The University of Arizona, USA Manuel Fahndrich Microsoft Research, USA Roberto Giacobazzi Univerity of Verona, Italy Chris Hankin Imperial College, UK Giorgio Levi Univerity of Pisa, Italy Kim Marriott Monash University, Australia Alan Mycroft Cambridge University, United Kingdom Ganesan Ramalingam IBM T.J. Watson Research Center, USA Martin Rinard Massachusetts Institute of Technology, USA Shmuel Sagiv Tel-Aviv Univerisity, Israel Reinhard Wilhelm Universitat des Saarlandes, Germany Contact Info ------------ Email: sas02@clip.dia.fi.upm.es Fax: + 34 91 352 4819 Phone: + 34 91 336 7448 Post: Manuel Hermenegildo (Ref.: SAS'02) Facultad de Informatica Universidad Politecnica de Madrid 28660 Boadilla del Monte Madrid, Spain ---------------------------------------------------------------------- -- From whitejbiii@ornl.gov Thu Mar 28 15:37:48 2002 From: whitejbiii@ornl.gov (James B. White III (Trey)) Date: Thu, 28 Mar 2002 10:37:48 -0500 Subject: ">>" and "do" notation Message-ID: <3CA338CD.D807BA87@ornl.gov> I recently discovered that Hugs converts "do" notation as follows. do {e;stmts} = e >>= \_ -> do {stmts} To me, this is inconsistent with the definition given in the Haskell 98 Report. do {e;stmts} = e >> do {stmts} It "hard wires" the default definition of ">>" into "do" notation. If you provide your own definition of ">>", which is completely legal in Haskell, the "do" translation in Hugs disagrees with the definition in the Report. In other words, the following two statements produce different results. do {e;stmts} = e >>= \_ -> do {stmts} do {e;stmts} = e >> do {stmts} When I reported this as a bug, I got responses stating that the definition of "do {e;stmts}" in the Report is merely a suggestion, and that the default definition of ">>" in the "Monad" class is a law of Monads and should not be redefined in instances. I strongly disagree with these responses. I think the default definition of ">>" is just that, a default, and not a law. This view is consistent with every other default definition in a class; it is there for convenience but may be redefined. If it is a law, why are users given the power to change it! Also, I think that the Report *specifies* the translation of "do" to ">>", not merely suggests it. This is the only interpretation that makes sense to me. The above claims---that the contents of the Report are mere suggestions and that default definitions are laws---baffle me. I beg the community to reassure me or enlighten me. If my thoughts are wrong, then I assert that the Report needs revision. ">>" should no longer be a class function with a default value that can be changed; it should be syntactic sugar built into Haskell, like "do" notation. Let me just restate my argument for emphasis: a Monad instance should be able to define its own ">>" operator, and "do" notation should honor this redefinition! -- James B. White III (Trey) Center for Computational Sciences Oak Ridge National Laboratory whitejbiii@ornl.gov From simonpj@microsoft.com Thu Mar 28 15:28:46 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Thu, 28 Mar 2002 07:28:46 -0800 Subject: Do-notation Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> James White has noticed that the draft Haskell 98 report gives the following translation for do-notation: do {e} =3D e do {e;stmts} =3D e >> do {stmts}=20 do {p <- e; stmts} =3D let ok p =3D do {stmts} ok _ =3D fail "..." in e >>=3D ok =20 On the face of it, that makes do-notation depend on the definitions of both (>>) and (>>=3D) in the monad. This makes a difference if someone defines an instance of the Monad class in which (>>) is not defined to be (\x y -> x >>=3D \_ -> y). I am certain that was not the intention of the authors. So one possibility is to change the second line to read do {e;stmts} =3D e >>=3D (\ _ -> do {stmts}) and that is what I *propose* to do. =20 However, James implies that in his monad (>>) has a different meaning than its usual one, and Haskell 98 allows that because (>>) is one of the class operations (not a good design choice I think). I'm quite reluctant to make the meaning of do-notation dependent on such differences. James, can you convince us that doing so would be a good idea? Simon =20 From whitejbiii@ornl.gov Thu Mar 28 16:20:50 2002 From: whitejbiii@ornl.gov (James B. White III (Trey)) Date: Thu, 28 Mar 2002 11:20:50 -0500 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <3CA342E4.DDECC8E9@ornl.gov> Simon Peyton-Jones wrote: > However, James implies that in his monad (>>) has a different meaning > than its usual one, and Haskell 98 allows that because (>>) is one of > the class operations (not a good design choice I think). I'm quite > reluctant to make the meaning of do-notation dependent on such > differences. James, can you convince us that doing so would be a good > idea? I didn't see this before sending off my previous rant. My apologies. Having separate definitions for ">>=" and ">>" is more flexible. With the definition of a default for ">>" in the Monad class, having them separate is no less convenient. More flexible, no less convenient---where is the design flaw? I thought it was a design triumph, fully in the spirit of elegance I associate with Haskell. Are there Monad laws that this breaks? If not, why impose an unnecessary constraint? Let me describe my practical motivation for a separate definition for ">>". I am experimenting with using Haskell to build program generators for embedded domain-specific languages. The goal is to generate high-performance Fortran codes from high-level specifications. I am using a Monad to hold the state of the generation. One thing maintained in the state is a list of declared variables and a list of busy, or in-scope, variables. The generator automatically adds variable declarations as needed. By differentiating between monadic statements that return an argument (>>=) and those that don't (>>), the generator can easily determine when variables go out of scope. Within the definition of ">>", it can free these variables (in a logical, not physical, sense) to be reused. This is critical because it allows me to generate code using large temporary arrays efficiently. As far as I can tell, this use of ">>" breaks no monad laws. In Hugs, it works fine if I use ">>" directly instead of "do". For the aesthetic acceptance of my user base, I need it to work with "do" notation. -- James B. White III (Trey) Center for Computational Sciences Oak Ridge National Laboratory whitejbiii@ornl.gov From olaf@cs.york.ac.uk Thu Mar 28 16:27:19 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Thu, 28 Mar 2002 16:27:19 +0000 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <3CA34467.24B420F9@cs.york.ac.uk> > I am certain that was not the intention of the authors. So one > possibility is to change the second line to read > > do {e;stmts} = e >>= (\ _ -> do {stmts}) > > and that is what I *propose* to do. > > However, James implies that in his monad (>>) has a different meaning > than its usual one, and Haskell 98 allows that because (>>) is one of > the class operations (not a good design choice I think). I'm quite > reluctant to make the meaning of do-notation dependent on such > differences. I disagree. Hugs should be changed, not the report. In my opinion (>>) is a class operation, because there may be more efficient implementations of (>>) than the default one (\x y -> x >>= \_ -> y). The do notation should profit from a more efficient implementation. I do think that James steps on very dangerous ground if his implementation of (>>) is semantically different from (\x y -> x >>= \_ -> y). This semantic equality is a law of the monad class, that users expect to hold. However, the language (implementation) cannot enforce it; in particular, compilers cannot use such laws for optimisations. The programmer has the freedom to break such laws. The situation is similar with classes such as Eq and Ord. You expect x /= y == not (x == y), but it is not enforced. Actually, the report currently doesn't say that the given default definitions are laws which are expected to hold (except where a comment says otherwise, see class Enum). I think such a statement should be added to the report. Happy Easter, Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From nilsson@cs.yale.edu Thu Mar 28 16:48:25 2002 From: nilsson@cs.yale.edu (nilsson@cs.yale.edu) Date: Thu, 28 Mar 2002 11:48:25 -0500 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> Message-ID: <3CA34959.81A5C949@cs.yale.edu> Olaf Chitil wrote: > > I am certain that was not the intention of the authors. So one > > possibility is to change the second line to read > > > > do {e;stmts} = e >>= (\ _ -> do {stmts}) > > > > and that is what I *propose* to do. > > > > However, James implies that in his monad (>>) has a different meaning > > than its usual one, and Haskell 98 allows that because (>>) is one of > > the class operations (not a good design choice I think). I'm quite > > reluctant to make the meaning of do-notation dependent on such > > differences. > > I disagree. Hugs should be changed, not the report. In my opinion (>>) > is a class operation, because there may be more efficient > implementations of (>>) than the default one (\x y -> x >>= \_ -> y). > The do notation should profit from a more efficient implementation. I agree with Olaf (and James). Incidentally, similar concerns occur in the context of the arrows framework. Ross Paterson, in response to a request from us at Yale, recently changed some derived arrow combinators into default methods of the arrow classes in his implementation of the framework to allow more efficient, instance specific, implementations of these combinators. Our request was prompted by our work of (A)FRP, an embedded language. /Henrik -- Henrik Nilsson Yale University Department of Computer Science nilsson@cs.yale.edu From sof@galois.com Thu Mar 28 17:46:59 2002 From: sof@galois.com (Sigbjorn Finne) Date: Thu, 28 Mar 2002 09:46:59 -0800 Subject: catch (fail "...") Message-ID: <010b01c1d680$8f6ce180$8132a8c0@sofxp> Simon Peyton-Jones simonpj@microsoft.com writes: > > This is an inconsistency that was fixed in the revised Haskell98=20 > report (Apr 2001). See > http://research.microsoft.com/~simonpj/haskell98-revised > > In the bug list look for Page 90. > > It looks as though Hugs hasn't quite caught up with this change. Yes, the Feb 2001 release (which Brian was/is using) unfortunately didn't foresee the future change to the Report :-) The current release, Dec 2001, does the prescribed thing. --sigbjorn From ross@soi.city.ac.uk Thu Mar 28 18:44:39 2002 From: ross@soi.city.ac.uk (Ross Paterson) Date: Thu, 28 Mar 2002 18:44:39 +0000 Subject: Do-notation In-Reply-To: <3CA34959.81A5C949@cs.yale.edu> References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> <3CA34959.81A5C949@cs.yale.edu> Message-ID: <20020328184438.GA2702@soi.city.ac.uk> On Thu, Mar 28, 2002 at 11:48:25AM -0500, nilsson@cs.yale.edu wrote: > Incidentally, similar concerns occur in the context of the arrows framework. > Ross Paterson, in response to a request from us at Yale, recently changed > some derived arrow combinators into default methods of the arrow classes in > his implementation of the framework to allow more efficient, instance > specific, implementations of these combinators. Our request was prompted > by our work of (A)FRP, an embedded language. Yes, but in that case the specific implementations are required to be denotationally equal to the default versions. And surely that was the original intention here. Section 6.3.6 of the Report needs an additional equation: m >> k = m >>= \_ -> k Then Hugs and GHC would be correct but suboptimal. There's a similar glitch in the claim in section 3.5 of the Report that (+ (- exp)) is a substitute for (\x -> x - exp), which is true only if x - y = x + negate y In that case the claim could be simply dropped. From olaf@cs.york.ac.uk Thu Mar 28 19:10:54 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Thu, 28 Mar 2002 19:10:54 +0000 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> <3CA34959.81A5C949@cs.yale.edu> <20020328184438.GA2702@soi.city.ac.uk> Message-ID: <3CA36ABE.B5D61A5F@cs.york.ac.uk> Ross Paterson wrote: > Yes, but in that case the specific implementations are required to be > denotationally equal to the default versions. And surely that was > the original intention here. Section 6.3.6 of the Report needs an > additional equation: > > m >> k = m >>= \_ -> k > > Then Hugs and GHC would be correct but suboptimal. I agree that this equation should be in the report, but note that there is no *requirement* that the monad laws hold for user defined instances. The report merely states that they *should* hold. Maybe we should be more clear what this word *should* means. I understand it as meaning that the term "monad" suggests that these laws hold, that a programmer should have very good reasons for breaking any of them and if a law is broken a big warning should be attached to the code, because any user of a monad expects it to fulfill the laws. However, because the laws cannot be checked by an implementation, no implementation is allowed to make use of them. In particular, the laws may accidentally have been broken and if an implementation makes use of the laws, then the behaviour of the resulting computation may be completely incomprehensible. (Just to make clear that I don't advocate breaking these laws; but then I'm not a fan of monads anyway...) Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From nilsson@cs.yale.edu Thu Mar 28 19:15:20 2002 From: nilsson@cs.yale.edu (nilsson@cs.yale.edu) Date: Thu, 28 Mar 2002 14:15:20 -0500 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> <3CA34959.81A5C949@cs.yale.edu> <20020328184438.GA2702@soi.city.ac.uk> Message-ID: <3CA36BC8.FE6C8B7F@cs.yale.edu> > Yes, but in that case the specific implementations are required to be > denotationally equal to the default versions. Yes, obviously. My only point was that I believe (>>) should remain a class operation. /Henrik -- Henrik Nilsson Yale University Department of Computer Science nilsson@cs.yale.edu From hdaume@ISI.EDU Thu Mar 28 21:27:42 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Thu, 28 Mar 2002 13:27:42 -0800 (PST) Subject: Z_n in Haskell Message-ID: Suppose I want to define integers modulo n, I could do this something like: data Zn = Zn Integer Integer -- modulus, number instance Num Zn where (Zn m1 n1) + (Zn m2 n2) | m1 == m2 = Zn m1 (n1 + n2 `mod` m1) | otherwise= error "differing moduli" ...etc... However, I'd really like it if, say, addition on Zn-s of different "n" values were caught by the typechecker and disallowed. One solution to this problem would be to do something like: class Modulus m where modulus :: T m -> Integer data Zn m = Zn (T m) Integer instance Modulus m => Num (Zn m) where (Zn m1 n1) + (Zn m2 n2) = (Zn m1 ((n1 + n2) `mod` (modulus m1))) data T a = T data Mod5 data Mod7 instance Modulus (Mod5) where modulus _ = 5 instance Modulus (Mod7) where modulus _ = 7 then we get: Modulus> (Zn (T :: T Mod5) 3) + (Zn (T :: T Mod5) 4) 2 but it fails when the moduli are different: Modulus> (Zn (T :: T Mod5) 3) + (Zn (T :: T Mod7) 4) Ambiguous type variable(s) `a' in the constraint `Show a' arising from use of `print' at In a 'do' expression pattern binding: print it :1: Couldn't match `Mod7' against `Mod5' Expected type: T Mod7 Inferred type: T Mod5 In an expression with a type signature: T :: T Mod7 In the first argument of `Zn', namely `(T :: T Mod7)' Unfortunately, this solution isn't very pretty. We have to define a new datatype for each modulus and make it an instance of Modulus. Is there a better way to do this? - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume From ken@digitas.harvard.edu Thu Mar 28 21:43:59 2002 From: ken@digitas.harvard.edu (Ken Shan) Date: Thu, 28 Mar 2002 13:43:59 -0800 Subject: Z_n in Haskell In-Reply-To: References: Message-ID: <20020328214359.GB2215@ccshan.stanford.edu> --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2002-03-28T13:27:42-0800, Hal Daume III wrote: > Suppose I want to define integers modulo n, I could do this something Check out the message "Modular arithmetic" earlier on haskell-cafe (http://www.haskell.org/pipermail/haskell-cafe/2001-August/002132.html) and its followup... --=20 Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig Dyer Honeycutt 3192 Anchor Drive Southside, AL 35907-0866 --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8o46ezjAc4f+uuBURAvKwAJ9Dv6zigbDbu9B3eOoTwoi7msW9MACgj+l2 POwnhFy8vC7jJuXpLFQ+MU0= =9+XM -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ-- From wolfgang@jeltsch.net Thu Mar 28 23:19:14 2002 From: wolfgang@jeltsch.net (Wolfgang Jeltsch) Date: Fri, 29 Mar 2002 00:19:14 +0100 Subject: ">>" and "do" notation In-Reply-To: =?iso-8859-1?Q?=3C20020329000911=2EA1832?= =?iso-8859-1?Q?=40localhost=3E=3B_from_wolfgang=40jeltsch=2Enet_on_Fre=2C?= =?iso-8859-1?Q?_M=E4r?= 29, 2002 at 00:09:11 +0100 References: <3CA338CD.D807BA87@ornl.gov> <20020329000911.A1832@localhost> Message-ID: <20020329001914.C1832@localhost> On Thursday, March 28, 2002, 16:37 CET James B. White III wrote: > [...] > I think the default definition of ">>" is just that, a default, and not a > law. I suppose, a >> b = a >>= \_ -> b is intended to be a law. This would mean that every redefined (>>) would have to obey this law. > [...] > If it is a law, why are users given the power to change it! For performance reasons, I would suppose. > Also, I think that the Report *specifies* the translation of "do" to ">>", > not merely suggests it. The report specifies certain identities and suggests to use these identities for translations into the kernel. If it is also a law that a >> b and a >>= \_ -> b are identical even with respect to laziness then, I think, a conforming Haskell implementation could use the latter instead of the former to realize do expressions. But I would prefer implementations using (>>). > [...] > ">>" should no longer be a class function with a default value that can be > changed; it should be syntactic sugar built into Haskell, like "do" > notation. It shouldn't be syntactic suger but at most an operator which does not belong to the monad class. One could define (>>) just as an ordinary function instead of a class member. > [...] By the way, why uses the report the complicated looking \_ -> b instead of just const b. Wolfgang From oleg@pobox.com Fri Mar 29 04:28:28 2002 From: oleg@pobox.com (oleg@pobox.com) Date: Thu, 28 Mar 2002 20:28:28 -0800 (PST) Subject: Z_n in Haskell Message-ID: <200203290428.UAA89829@adric.cs.nps.navy.mil> The Z_n problem doesn't seem to be different from the problem of arrays or bitvectors of a statically-checkable size. If you prefer a decimal specification of the modulus, you may find the following articles relevant. Implementation of fixed-precision decimal types: Main> BV D1 0 Bitvector of width 1 and value 0 Main> BV (D1,D2) 123 Bitvector of width 12 and value 123 Main> BV (D5,D7,D9) 31415 Bitvector of width 579 and value 31415 It appears that modulus in the Z_n problem plays the same role as the bitvector width in the bitvector problem. An attempt to perform an operation on bitvectors of different sizes results in a compiler error: Main> (BV (D1,D0) 10) `b_and` (BV (D1,D1) 7) ERROR - Type error in application *** Expression : b_and (BV (D1,D0) 10) (BV (D1,D1) 7) *** Term : BV (D1,D0) 10 *** Type : BitVector (D1,D0) *** Does not match : BitVector (D1,D1) http://groups.google.com/groups?selm=7eb8ac3e.0202201753.473a5cb2%40posting.google.com Arbitrary precision decimal types, e.g.: Main> BV (D1 $ D2 $ D3 $ D4 $ D5 $ D6 $ D7 $ D8 $ D9 $ D0 $ D9 $ D8 $ D7 $ D6 $ D5 $ D4 $ D3 $ D2 $ D1 $ Dim) 1234567879 Bitvector of width 1234567890987654321 and value 1234567879 which are slightly more general and less convenient, are described in: http://groups.google.com/groups?selm=7eb8ac3e.0202230221.62d98db8%40posting.google.com Both implementations work in any Haskell-98 system. Multi-parameter classes, existential types or other extensions are not needed. From Jon.Fairbairn@cl.cam.ac.uk Fri Mar 29 10:28:34 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Fri, 29 Mar 2002 10:28:34 +0000 Subject: ">>" and "do" notation In-Reply-To: Your message of "Fri, 29 Mar 2002 00:19:14 +0100." <20020329001914.C1832@localhost> Message-ID: <8102.1017397714@cl.cam.ac.uk> Wolfgang Jeltsch wrote: > It shouldn't be syntactic suger but at most an operator which does not = belong > to the monad class. One could define (>>) just as an ordinary function > instead of a class member. That sounds to me like the best idea so far. = If (as a human reader of a programme) I see do a <- thing1 and I notice (perhaps after some modifications) that a is not present in , then I /really/ don't want a change to do thing1 to change the meaning of the programme. J=F3n From rjljr2@yahoo.com Fri Mar 29 13:43:40 2002 From: rjljr2@yahoo.com (Ronald Legere) Date: Fri, 29 Mar 2002 05:43:40 -0800 (PST) Subject: Type extensions Message-ID: <20020329134340.69879.qmail@web10005.mail.yahoo.com> Greetings. I have decided to try and understand the type system of haskell with extensions. As far as I can tell, the following set of extensions has been included, for example in ghc: multiparameter type classes constructor classes existential types explicit universal quantification scoped type signatures funtional dep?? Etc There is probably some overlap, and probably missed a few, as i do not understand what all these things do! ! My question: How do you get started learning all this? which of these is the most important? Is there a paper out there that explains most or all of these extensions and why you would want them and HOW the heck they work together? Ron Legere __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ From wolfgang@jeltsch.net Fri Mar 29 16:25:13 2002 From: wolfgang@jeltsch.net (Wolfgang Jeltsch) Date: Fri, 29 Mar 2002 17:25:13 +0100 Subject: Type extensions In-Reply-To: =?iso-8859-1?Q?=3C20020329134340=2E69879?= =?iso-8859-1?Q?=2Eqmail=40web10005=2Email=2Eyahoo=2Ecom=3E=3B_from_rjljr2?= =?iso-8859-1?Q?=40yahoo=2Ecom_on_Fre=2C_M=E4r?= 29, 2002 at 14:43:40 +0100 References: <20020329134340.69879.qmail@web10005.mail.yahoo.com> Message-ID: <20020329172513.A2308@localhost> On Friday, March 29, 2002, 14:43 CET Ronald Legere wrote: > [...] > As far as I can tell, the following set of extensions has been included, > for example in ghc: > multiparameter type classes > constructor classes Type classes can be seen as a specific kind of constructor classes because a type can be seen as a type constructor with zero arguments. So the constructor class concept is more general than the type class concept. Constructor classes aren't an extension but belong to the Haskell 98 standard. They didn't belong to some older versions of the standard, however. Normally, a type or constructor class has one parameter --- a type or a type constructor respectively. The multi-parameter type class concept extends the ordinary *type* class concept such that classes can have multiple parameters but these arguments have to be types. The multi-parameter constructor class concept allows mulitple class parameters which may be arbitrary type constructors. I think GHC used to implement only multi-parameter type classes while Hugs implemented multi-parameter constructor classes. The newer GHC versions implement multi-parameter constructor classes as well. > [...] > Is there a paper out there that explains most or all of these extensions > and why you would want them and HOW the heck they work together? I don't know of such a paper. There is several information distributed over several documents. Concerning (single-parameter) constructor classes, you may consult some Haskell 98 document, for instance the Gentle introduction to Haskell or the Haskell report. Concerning the other things, you may, for example, have a look at Simon Peyton Jones' Haskell stuff, referenced on http://research.microsoft.com/users/simonpj/. > [...] Wolfgang From whitejbiii@ornl.gov Sat Mar 30 05:39:59 2002 From: whitejbiii@ornl.gov (James B. White III (Trey)) Date: Sat, 30 Mar 2002 00:39:59 -0500 Subject: Unbind ">>"! (was Do-notation) Message-ID: <3CA3CD21@webmail> Here's my short manifesto on ">>" and "do" notation. It is based on the precedent set with "negate", a precedent that I also support. ">>" should be a member of the "Monad" class, just as "negate" is a member of the "Num" class! Users should have the power to override the default definition of ">>", just as they have the power to override the default definition of "negate"! Haskell compilers should honor user definitions for ">>" and not hard-wire ">>= \_ ->", just as they should honor user definitions for "negate" and do not hardwire "0 - x"! I have fixed the December 2001 release of Hugs to follow these principles for ">>". (I haven't tested the fix exhaustively. It works on my programs. Corrections appreciated!) Here are the "diffs", before the fix followed by after: connect.h: 74c74 < extern Name nameReturn, nameBind; /* for translating monad comps */ --- > extern Name nameReturn, nameBind, nameSequence; /* for translating monad comps */ type.c: 85c85 < Name nameReturn, nameBind; /* for translating monad comps */ --- > Name nameReturn, nameBind, nameSequence; /* for translating monad comps */ 3267a3268 > nameSequence = linkName(">>"); compiler.c: 397c397 < * do { e; qs } => LETREC _h _ = [ e | qs ] in bind m exp _h --- > * do { e; qs } => sequence m e qs 433,442c433,436 < case DOQUAL : { Cell hVar = inventVar(); < Cell ld = cons(pair(singleton(WILDCARD), < transDo(m,e,qs1)), < NIL); < return ap(LETREC, < pair(singleton(pair(hVar,ld)), < ap(ap(ap(nameBind, < m), < translate(snd(q))), < hVar))); --- > case DOQUAL : { > return ap(ap(ap(nameSequence, m), > translate(snd(q))), > transDo(m,e,qs1)); --- James B. White III (Trey) Center for Computational Sciences Oak Ridge National Laboratory whitejbiii@ornl.gov From ru@river.org Sun Mar 31 07:34:05 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sat, 30 Mar 2002 23:34:05 -0800 Subject: ">>" and "do" notation In-Reply-To: <8102.1017397714@cl.cam.ac.uk> References: <20020329001914.C1832@localhost> <8102.1017397714@cl.cam.ac.uk> Message-ID: >If (as a human reader of a programme) I see > >do a <- thing1 > > >and I notice (perhaps after some modifications) that a is >not present in , then I /really/ don't want a >change to > >do thing1 > > >to change the meaning of the programme. That's understandable, just like it's understandable that a programmer does not want to read a program that redefines id or const or map to something with a completely different meaning. But is that any reason for the language standard to *disallow* redefinition of id or const or map? And if the answer is yes, where does this proscriptive zeal stop? Should the language standard, eg, disallow functions whose name ends in 'M' but do not have monads in their signature? No: the individual programmer should be free to decide to override conventions if doing that is expedient. After all, there is no danger that what James wants to do will become common or widespread; it's just an expediency to deal with a rare situation. The bottom line is a social one: language communities compete fiercely for programmers. There is no shortage of languages with open-sourced implementations in which James could have written his program. (Er, actually James is embedding a DSL in Haskell, which brings many programmers to Haskell.) If we want Haskell to grow, we must make it as easy as possible for programmers to solve their problems in Haskell. Of course there are some things that are essential to Haskell that we should not compromise on. Those who describe a >> b = a >>= \_ -> b as a law might maintain that it is one of those essential things. Well, to them I ask, are id x = x and const x y = y laws, too? How about fix f = f (fix f)? swap (a,b) = (b,a)? mirror (Right a) = Left a mirror (Left a) = Right a? etc, etc. From tony@raeline.net Sun Mar 31 11:19:02 2002 From: tony@raeline.net (tony) Date: Sun, 31 Mar 2002 06:19:02 -0500 (EST) Subject: ѰÇóºÏ×÷ Message-ID: <20020331111902.C10764220B5@www.haskell.org> Ç×°®µÄÅóÓÑ£º ¡¡¡¡ÄúºÃ£¡ ¡¡¡¡ÕâÊÇÀ´×ÔÈðÀ´ÍøÂ磨ÏÃÃÅ£©ÓÐÏÞ¹«Ë¾µÄÎʺ¸ÐлÄúÊÕ¿´Õâ·âÓʼþ¡£ÎÒÃÇÕæ³ÏµÄÏ£ÍûÄúÄܳÉΪÎÒÃÇÔÚ¹ó µØÇøµÄÖØÒª»ï°é¡£ÎÒÃÇÊÇÒ»¼Ò²ÉÓÃÊÀ½ç¸ßм¼Êõ½á¾§£¬Ñо¿¡¢ÍƹãºÍ·¢Õ¹Ð¼¼Êõ£¬ÖÂÁ¦ÓÚ»¥ÁªÍøÐÅÏ¢·þÎñ¡¢µç ×ÓÉÌÎñ·þÎñºÍÆóÒµÓ¦Ó÷þÎñµÄ¸ßм¼ÊõÆóÒµ¡£ÏêÇéÇëä¯ÀÀ:http://www.raeline.net email:webmaster@raeline.net лл£¡ ¡¡¡¡¹«Ë¾×Ô2000ÄêÆðÈ«Á¦½ø¾ü¹ú¼Ê»¥ÁªÍø·þÎñÁìÓò£¬ÕûºÏÍÆ³öÁËÒÔϲúÆ·£¬È«ÃæÂú×ãÄúµÄÐèÇó¡£Õ⽫»áÊÇÄú³¬ ÖµµÄÑ¡Ôñ¡£ ¡¡¡¡1.30M¿Õ¼ä£«50MÆóÒµÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû£¬¹¦ÄÜÈ«Ãæ£¬½öÊÛ198Ôª/Äê¡£ ¡¡¡¡2.50M¿Õ¼ä£«100MÆóÒµÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû£¬¹¦ÄÜÈ«Ãæ£¬½öÊÛ248Ôª/Äê¡£ ¡¡¡¡3.100M¿Õ¼ä£«100MÆóÒµÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû£¬¹¦ÄÜÈ«Ãæ£¬½öÊÛ318Ôª/Äê¡£ ¡¡¡¡4.100M¿Õ¼ä+100MÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû+¸÷ÖÖ·ç¸ñÄ£°åÍøÕ¾+´óÐÍÍøÕ¾Ãâ·ÑÐû´«ÆóÒµÐÅÏ¢ ½öÊÛ1000Ôª ¡£ ¡¡¡¡¾¡¹ÜÎÒÃǾ¡Á¦ÎªÄúÌṩ×îºÃµÄ·þÎñ¡££¬µ«²»Åųý³öÏÖʧÎó¡£Èç¹ûÊÇÕâÑù£¬ÎÒÃÇÄþÔ¸½ÓÊÜÍ˿Ҳ²»»áÒòΪ ÄÄÅÂÒ»µãµãµÄ²»ÂúÒâ¶øÈÃÄú²»¿ªÐÄ¡£ËùÒÔÎÒÃdzÐŵ£ºÖ÷»ú²»ÂúÒⰴʵ¼ÊÓà¶îÍ˿ ¡¡¡¡×££º¿ªÐÄ£¡Ë³Àû£¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡webmaster of raeline.net webmaster@raeline.net ÈðÀ´ÍøÂ磨ÏÃÃÅ£©ÓÐÏÞ¹«Ë¾¡¡¡¡ --------------------------------------------------------------- ·ÐµãȺ·¢Óʼþ,À´×ÔÈí¼þ¹¤³Ìר¼ÒÍø(http://www.21cmm.com) ½øCMMÍøÐ£(http://www.21cmm.com)£¬³ÉÏîÄ¿¹ÜÀíר¼Ò From oleg@pobox.com Sun Mar 31 21:48:28 2002 From: oleg@pobox.com (oleg@pobox.com) Date: Sun, 31 Mar 2002 13:48:28 -0800 (PST) Subject: Lambda over types. References: Message-ID: <200203312148.NAA97652@adric.cs.nps.navy.mil> anatoli wrote: > Attached are two interpreters: one for untyped lambda calculus, I'm afraid the attached interpreter can't be an implementation of the lambda calculus. For one thing, it lacks the hygiene of substitutions: Lambda> :t lambdaEval (A (L X (L Y (A X Y))) T) lambdaEval (A (L X (L Y (A X Y))) T) :: L Y (A T Y) That's OK. However, Lambda> :t lambdaEval (A (L X (L Y (A X Y))) Y) lambdaEval (A (L X (L Y (A X Y))) Y) :: L Y (A Y Y) That is wrong! The correct answer is: L Yfresh (A Y Yfresh) The interpreter in question doesn't appear to be able to manufacture fresh identifiers (i.e., fresh types). Without an ability to expand the set of available identifiers, the capture-free substitution is impossible. Furthermore, some terms fail to evaluate: Lambda> :t lambdaEval (A (L X (A X X)) T) lambdaEval (A (L X (A X X)) T) :: Eval (A (L X (A X X)) T) a => a Lambda> :t lambdaEval (A (A (L X X) T) Y) lambdaEval (A (A (L X X) T) Y) :: Eval (A (A (L X X) T) Y) a => a which is not the result one would've expected. Finally, the interpreter doesn't actually find the normal form. The rule > instance Eval (L v e) (L v e) prevents any reductions under lambda. True, call-by-name or call-by-value interpreters stop short of reducing the body of a lambda form. Normal or applicative order interpreters however -- in order to find the beta-eta-normal form -- should seek and attempt any reduction. The hygienic substitution (with alpha-conversion if necessary) and the repeated identification of the leftmost outermost redex are actually quite challenging. We can guarantee the hygienic substitution if we implement the de Bruijin notation for lambda terms. Another, related technique is coloring of existing identifiers. A macro-expander of R5RS Scheme macros implements the coloring to ensure the hygiene of macro expansions. The macro-expander can be cajoled into painting identifiers on our demand, which has been used in a macro-expand-time lambda calculator. In Haskell, we have to paint manually. A variable in a typechecker-time lambda-calculator has to be represented by a type like Vr (Succ (Succ (Succ Zero))) X. The latter component is the "name" and the former is the color. The Eval and Subst relations should be extended with color_in and color_out type parameters (perhaps with a dependency: term color_in -> color_out). The only non-trivial use of colors is in doing a substitution (L var body)[exp/var']. The bound variable has to be repainted before the substitution in the body. The beta-substitutor itself can do the repainting. From sk@cs.brown.edu Sun Mar 31 17:41:48 2002 From: sk@cs.brown.edu (Shriram Krishnamurthi) Date: Sun, 31 Mar 2002 12:41:48 -0500 (EST) Subject: PLAN-X: Programming Language Technologies for XML Message-ID: <200203311741.MAA27285@bosch.cs.brown.edu> PLAN-X: PROGRAMMING LANGUAGE TECHNOLOGIES FOR XML Oct 3, 2002 Pittsburgh, PA (Co-located with PLI) CALL FOR PAPERS Submission deadline: May 1, 2002 XML has emerged as the de facto standard for data interchange on the web. The use of XML as a common format for representation, interchange, and transformation of data poses new challenges to programming languages, applications, and database systems. During the last few years, the database research community has devoted a lot of attention to XML's data representation challenges, as evidenced by the number of XML-related publications in premier database conferences and journals. In contrast, the attention devoted to XML by the programming language research community has been minimal. This is unfortunate, since the robustness of current and future programming standards and tools for XML will depend on the strength of their foundations in core programming technologies e.g., XML parsing (parsing theory and incremental parsing), XML schemas (type systems), XPATH expressions and XSLT programs (pattern-matching languages and their optimization), XSLT debuggers (dynamic program analysis and slicing). Since XML is a new domain, core programming technologies developed in past research cannot be used unchanged; instead, novel research is required to address the unique challenges posed by XML and its use in web applications and standalone applications. This workshop aims to bring together researchers from the programming languages and XML communities, a) to foster novel research to address unique challenges being posed by XML on current and future programming technologies; b) to exchange information on early research experiences with XML-related programming systems, tools, and languages; and c) to expose the PLI community to XML technologies and the potential impact of these technologies on future software. SUBMISSION PROCEDURE We solicit submissions on original research not previously published or currently submitted for publication elsewhere, in the form of extended abstracts. These extended abstracts should not exceed 5000 words (approximately 10 pages). Detailed submission instructions will be posted at http://www.research.avayalabs.com/user/wadler/planx by early April. PROCEEDINGS There will be no formal proceedings. An informal proceedings will be distributed at the workshop. IMPORTANT DATES Paper submission deadline May 1 Notification of acceptance June 21 Final papers due for informal proceedings Sep 4 WEB PAGE: http://www.research.avayalabs.com/user/wadler/planx/ GENERAL CHAIR: Vivek Sarkar, IBM PROGRAM COMMITTEE: Allen Brown (Microsoft) Peter Buneman (Edinburgh) Sophie Cluet (Xyleme / INRIA) Mary Fernandez (AT&T Labs) Shriram Krishnamurthi (Brown) Makoto Murata (IBM Japan) Benjamin Pierce (University of Pennsylvania), co-chair Michael Schwartzbach (Aarhus) Dan Suciu (University of Washington) Philip Wadler (Avaya Labs), co-chair INVITED SPEAKER: James Clark From rowan@corben.fslife.co.uk Fri Mar 1 00:52:51 2002 From: rowan@corben.fslife.co.uk (Rowan Corben) Date: Fri, 1 Mar 2002 00:52:51 -0000 Subject: help a lost soul Message-ID: <000801c1c0bb$6b6fc930$b72387d9@youriruau5ak0q> This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C1C0BB.6A5D95E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable sir, i have been set an assignment by my university....we are so badly taught = that i have absolutley no idea how to do it! I would be more than happy = to post payment for however much you feel your time is worth... Please,please help: ex.1) Extend to the library database to include category of loan for = overnight + 4 week loans-you should use the following data types.The = TIME and DATE are the due time and date for books.You should provide = enough data to reasonably test your code. data LoanType =3D Overnight Date Time | FourWeek Date deriving (Show,Read) data Time =3DTime (Hours,Minutes) deriving (show,Read) data Date =3DDate (Year,Month,DayNum) deriving (Show,Read) type Hours =3D Integer type Minutes =3DInteger type Year =3D Integer type DayNum =3DInteger data Month =3D = January|Februrary|March|April|May|June|July|August|September|October|Nove= mber|December deriving (Eq,Ord,Enum,Show,Read) overdue books are fined at the following rates: OVERNIGHT the due time is 24 hours from the time borrowed to the nearest = hour above (for example,a book borrowed at 12.35 would be due back at = 13.00 the next day).Overdue books are fined at 0.1p per minute rounded = to the nearest penny. FOURWEEK the due date is four weeks from the borrowing date.Overdue = books are fined at 10p per day ex.2) To calculate fines you will need to impliment functions over = DATE and TIME.You will also need a data type to represent time periods: data TimePeriod =3D TimePeriod (Days,Hours,Minutes) deriving (Eq,Ord,Show,Read) type Days =3D Integer *afterTime which takes two times and returns True if the first is = after the second. *beforeTime which takes two times and returns True if the first is = before the 2nd = =20 *timeBetween which takes two times and returns the time between the = first and the 2nd *timeIncr which takes a time and a time period and returns a new time = (time should be represented as a 24 hour clock *timeTo24String which takes a tim eand displays it as a string in = 24hr format *timeTo12String which takes a time and displays it as a string = in 12 hour format ex.3) Make DATE and TIME instances of the type classes Eq and Ord ex.4) For overnight books most fines are on the same day-write a = function that takes a book and a time and calculates the fine on the = book (assuming it is returned on the due date but after the due time). If you could help i will be extreamly = gratefull!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! haskinsgreg@hotmail.com =20 ------=_NextPart_000_0005_01C1C0BB.6A5D95E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
    sir,
    i have been set an assignment by my=20 university....we are so badly taught that i have absolutley no idea how = to do=20 it! I would be more than happy to post payment for however much you feel = your=20 time is worth...
     
    Please,please help:
     
    ex.1)    Extend to the = library=20 database to include category of loan for overnight + 4 week loans-you = should use=20 the following data types.The TIME and DATE are the due time and date for = books.You should provide enough data to reasonably test your = code.
     
    data LoanType   =3D Overnight = Date Time |=20 FourWeek Date
              &nbs= p;            = ;    =20 deriving (Show,Read)
    data=20 Time         =3DTime=20 (Hours,Minutes)
              &nbs= p;            = ;       =20 deriving (show,Read)
    data=20 Date           =3DDate = (Year,Month,DayNum)
              &nbs= p;            = ;        =20 deriving (Show,Read)
    type=20 Hours        =3D Integer
    type Minutes    =20 =3DInteger
    type = Year      =20 =3D   Integer
    type DayNum    = =3DInteger
    data Month    =3D=20 January|Februrary|March|April|May|June|July|August|September|October|Nove= mber|December
               = deriving=20 (Eq,Ord,Enum,Show,Read)
     
    overdue books are fined at the = following=20 rates:
     
    OVERNIGHT the due time is 24 hours from = the time=20 borrowed to the nearest hour above (for example,a book borrowed at 12.35 = would=20 be due back at 13.00 the next day).Overdue books are fined at 0.1p per = minute=20 rounded to the nearest penny.
     
    FOURWEEK the due date is four weeks = from the=20 borrowing date.Overdue books are fined at 10p per day
     
     
     
    ex.2)   To calculate fines = you will need=20 to impliment functions over DATE and TIME.You will also need a data type = to=20 represent time periods:
     
          data=20 TimePeriod  =3D TimePeriod (Days,Hours,Minutes)
              &nbs= p;            = ;      =20      deriving (Eq,Ord,Show,Read)
          type=20 Days            = =3D=20 Integer
     
    *afterTime      which=20 takes two times and returns True if the first is after the = second.
    *beforeTime      which=20 takes two times and returns True if the first is before=20 the 2nd          &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =          
    *timeBetween      which=20 takes two times and returns the time between the first and=20 the 2nd
    *timeIncr    which takes = a time and=20 a time period and returns a new time (time should be represented as a 24 = hour=20 clock
    *timeTo24String      =20 which takes a tim eand displays it as a string in 24hr = format
    *timeTo12String         = which=20 takes a time and displays it as a string in 12 hour format
     
     
    ex.3)    Make DATE and = TIME=20 instances of the type classes Eq and Ord
     
    ex.4)    For overnight = books most=20 fines are on the same day-write a function that takes a book and a time = and=20 calculates the fine on the book (assuming it is returned on the due date = but=20 after the due time).
     
     
    If you could help i will be extreamly=20 gratefull!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    haskinsgreg@hotmail.com       = ;            =             &= nbsp;      =20
    ------=_NextPart_000_0005_01C1C0BB.6A5D95E0-- From ashley@semantic.org Fri Mar 1 03:13:32 2002 From: ashley@semantic.org (Ashley Yakeley) Date: Thu, 28 Feb 2002 19:13:32 -0800 Subject: FW: Haskell 98 lexical syntax again Message-ID: <200203010313.TAA25478@mail4.halcyon.com> At 2002-02-28 07:18, Simon Peyton-Jones wrote: > whitechar -> newline | vertab | space | tab | uniWhite > newline -> return linefeed | return | linefeed | formfeed > return -> a carriage return > linefeed -> a line feed > >This means that CR, LF, or CRLF, are all valid 'newline' separators, >and the same sequence of characters should therefore work on any >Haskell implementation. Good. While you're fiddling with it, I recommend this: newline -> return linefeed | return | linefeed | formfeed | uniLineSep | uniParaSep uniLineSep -> any char of General Category Zl uniParaSep -> any char of General Category Zp Unicode defines two codepoints that unambiguously mean 'line separator' (\u2028) and 'paragraph separator' (\u2029). As it happens, they are the only codepoints in General Categories Zl and Zp. There are other paragraph separators (e.g. Georgian and Urdu), but they are actual marks rather than being whitespace and are not in GC Zp -- much like the pilcrow. uniWhite -> any UNIcode character defined as whitespace This is fine. But note that whitespace is an 'extended property', it can't be derived from General Category: -- Ashley Yakeley, Seattle WA From contact@weaver.com.cn Fri Mar 1 03:52:28 2002 From: contact@weaver.com.cn (contact@weaver.com.cn) Date: Fri, 1 Mar 2002 11:52:28 +0800 (CST) Subject: =?GBK?B?VG86aGFza2VsbCy3us6i0K3NrMnMzvHPtc2zvPK96Q==?= Message-ID: <443451.1014954748046.JavaMail.Administrator@liuyu> =B7=BA=CE=A2=D0=AD=CD=AC=C9=CC=CE=F1=CF=B5=CD=B3 =20 =20 =20 =20 =20
     
    haskell=A3=AC=C4=FA=BA=C3=A3=A1
      =20 =20
    =20

    =B7=BA=CE=A2=D0=AD=CD=AC=C9=CC=CE=F1=CF=B5= =CD=B3=A3=A8E-Synergy=A3=A9=CE=AA=C4=FA=BD=E2=BE=F6=A3=BA

    =A1=A4 =D0=C5=CF= =A2=B5=C4=C5=F2=D5=CD=A1=A4 =D0=C5=CF=A2=B5=C4=B9=C2=B5=BA=A1=A4 =D0=C5=CF= =A2=B5=C4=B7=C7=BD=E1=B9=B9=BB=AF=A1=A4=20 =D0=C5=CF=A2=B5=C4=B7=C7=B8=F6=D0=D4=BB=AF=A1=A4 = =20

    =B7=BA=CE=A2=CD=F8=C2=E7=D3=D0=CF=DE=B9= =AB=CB=BE=CD=C6=B3=F6=BB=F9=D3=DAE-Synergy=B5=C4=D0=AD=CD=AC=C9=CC=CE=F1=BD=E2=BE=F6=B7=BD=B0=B8=A1= =A3e-Synergy=CA=C7=D2=BB=CC=D7=BC=E6=BE=DF=C6=F3=D2=B5=D0=C5=CF=A2=C3=C5=BB= =A7=A1=A2=D6=AA=CA=B6=B9=DC=C0=ED=A1=A2=B9=A4=D7=F7=C1=F7=B9=DC=C0=ED=A1=A2= =C8=CB=C1=A6=D7=CA=D4=B4=B9=DC=C0=ED=A1=A2=BF=CD=BB=A7=D3=EB=BA=CF=D7=F7=BB= =EF=B0=E9=B9=DC=C0=ED=A1=A2=CF=EE=C4=BF=B9=DC=C0=ED=A1=A2=B2=C6=CE=F1=B9=DC= =C0=ED=A1=A2=D7=CA=B2=FA=B9=DC=C0=ED=B9=A6=C4=DC=B5=C4=C7=B0=CC=A8=CF=B5=CD= =B3=A1=A3=CD=AC=CA=B1=A3=ACe-Synergy=BF=C9=D2=D4=D3=EB=BA=F3=CC=A8=B5=C4ERP= =C8=ED=BC=FE=BC=AF=B3=C9=D4=DA=D2=BB=C6=F0=A3=AC=BD=AB=CB=F9=D3=D0=C0=FB=D2= =E6=CF=E0=B9=D8=D5=DF=A1=A2=C6=F3=D2=B5=B2=BF=C3=C5=A1=A2=B2=BB=CD=AC=D3=A6= =D3=C3=CF=B5=CD=B3=B5=C4=D0=C5=CF=A2=D5=FB=BA=CF=B5=BD=CD=B3=D2=BB=B5=C4=C7= =FE=B5=C0=A3=AC=B2=A2=CC=E1=B9=A9=CD=B3=D2=BB=B5=C4=BD=E7=C3=E6=B8=F8=D3=C3= =BB=A7=B2=D9=D7=F7=BA=CD=BB=F1=C8=A1=D0=C5=CF=A2=A3=AC=B4=D3=B6=F8=CA=B5=CF= =D6=D2=B5=CE=F1=B4=A6=C0=ED=BA=CD=D0=C5=CF=A2=BB=F1=C8=A1=D3=EB=B9=B2=CF=ED= =B5=C4=D2=BB=CC=E5=BB=AF=A3=AC=B4=EF=B5=BD=C4=DA=B2=BF=D0=AD=CD=AC=D3=EB=CD= =E2=B2=BF=D0=AD=CD=AC=A1=A3


    =CE=D2=C3=C7= =B3=C6=D5=E2=D1=F9=B5=C4=D2=BB=CC=D7=BC=AF=B3=C9=B5=C4=CF=B5=CD=B3=CE=AA=A1= =B0=D0=AD=CD=AC=C9=CC=CE=F1=A1=B1=A1=A3=BA=C1=CE=DE=D2=C9=CE=CA=A3=AC=D0=AD= =CD=AC=C9=CC=CE=F1=CA=C7=C6=F3=D2=B5=D0=C5=CF=A2=BB=AF=B7=A2=D5=B9=B5=C4=B7= =BD=CF=F2=A1=A3

    =20
    =20
    =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
    =20
    =B7=BA=CE=A2= =D0=AD=CD=AC=C9=CC=CE=F1=CF=B5=CD=B3=CE=AA=C4=FA=CC=E1=B9=A9=C8=E7=CF=C2=C4= =A3=BF=E9=A3=BA
    =D6=AA= =CA=B6=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Documents=A3=A9=A3=BA
    =D4=DA=D2=BB=B8=F6=CA=FD=BE=DD=BF= =E2=D6=D0=B4=E6=B4=A2=BA=CD=B9=DC=C0=ED=B8=F7=D6=D6=D0=C5=CF=A2=BA=CD=A3=A8= =CF=D6=D3=D0=A3=A9=D2=B5=CE=F1=A1=A3e-Documents=CA=C7=B4=E6=B4=A2=C6=F3=D2= =B5=B5=E7=D7=D3=CA=FD=BE=DD=B5=C4=BB=F9=B4=A1=A1=A3=CD=A8=B9=FDeDocuments,= =BF=C9=C9=E8=BC=C6=C1=E9=BB=EE=B6=E0=D1=F9=B5=C4=D4=B1=B9=A4=A1=A2=BF=CD=BB= =A7=A1=A2=B9=A9=D3=A6=C9=CC=BA=CD=B7=D6=CF=FA=C9=CC=C3=C5=BB=A7=A1=A3=A3=A8= =CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA= =CE=A2=CD=F8=D5=BE=A3=A9
    =20
    =BF=CD= =BB=A7=B9=D8=CF=B5=B9=DC=C0=ED=C4=A3=BF=E9=A3=A8e-CRM=A3=A9=A3=BA
    =BC=AF=B3=C9=B5=C4=B7=C3=CE=CA=BF=CD=BB=A7=D0= =C5=CF=A2=A3=AC=D5=E2=B0=FC=BA=AC=C1=CB=B4=AB=CD=B3=B5=C4CRM=B2=FA=C6=B7=B5= =C4=C8=AB=B2=BF=B7=B6=CE=A7=A1=A3=BD=AB=BF=CD=BB=A7=BC=AF=B3=C9=B5=BD=B7=FE= =CE=F1=A1=A2=CF=FA=CA=DB=A1=A2=B2=FA=C6=B7=BA=CD=B2=C6=CE=F1=D7=E9=D6=AF=D6= =D0=A3=AC=D5=E6=D5=FD=BB=F1=B5=C3=B6=D4=BF=CD=BB=A7360=B6=C8=B5=C4=B9=DB=B2= =EC=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE=A3=A9
    =20
    =B2=FA= =C6=B7=A3=AC=D7=CA=B2=FA=B9=DC=C0=ED=C4=A3=BF=E9=A3=A8e-Logistics=A3=A9=A3=BA
    =B9=D8=D7=A2=B2=FA=C6=B7=A1=A2=B7=FE=CE=F1=BA=CD=BC=DB=B8= =F1=B5=C4=B9=DC=C0=ED=A1=A3=B2=A2=CD=A8=B9=FDIntranet=BA=CDInternet=B9=B2= =CF=ED=D0=C5=CF=A2=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE= =A3=A9
    =20
    =CF=EE= =C4=BF=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Project=A3=A9=A3=BA
    =B9=DC=C0=ED=D3=EB=CF=EE=C4=BF=CF=E0=B9=D8=B5=C4=BB=EE=B6= =AF=A3=AC=B2=A2=B4=D3=BE=D8=D5=F3=CA=D3=CD=BC=B9=DB=B2=EC=D7=E9=D6=AF=B5=C4= =D0=A7=C4=DC=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE=A3=A9<= /font>
    =20
    =C8=CB= =C1=A6=D7=CA=D4=B4=B9=DC=C0=ED=C4=A3=BF=E9=A3=A8e-HRM=A3=A9=A3=BA
    =B3=FD=C1=CB=B4=AB=CD=B3=B5=C4HRM=B9=DC=C0=ED=B5= =C4=B9=A6=C4=DC=A3=ACe-HRM=BB=B9=BE=DF=D3=D0=B6=D4=D3=EB=BD=C7=C9=AB=BA=CD= =B0=B2=C8=AB=C8=A8=CF=DE=CF=E0=B9=D8=B5=C4=D4=B1=B9=A4=BA=CD=D0=C5=CF=A2=B5= =C4=CE=AC=BB=A4=B9=A6=C4=DC=A1=A3e-HRM=CA=C7=B5=E7=D7=D3=C9=CC=CE=F1=C1=F7= =B3=CC=B9=DC=C0=ED=B5=C4=BB=F9=B4=A1=A1=A3=A3=A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE= =A2=CD=F8=D5=BE=A3=A9
    =20
    =C1=F7= =B3=CC=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Procurement=A3=A9=A3=BA
    e-Procurement=D3=EBeHRM=CF=E0=BD=E1=BA=CF=A3= =AC=BD=AB=BF=C9=D2=D4=B1=A3=D6=A4=C8=AB=B2=BF=B5=C4=C4=DA=B2=BF=BA=CD=CD=E2= =B2=BF=C9=CC=CE=F1=C1=F7=B3=CC=B5=C4=B5=E7=D7=D3=B9=DC=C0=ED=A1=A3=B0=FC=C0= =A8=D2=BB=B0=E3=B5=C4=B9=AB=CE=C4=C1=F7=D7=AA=BA=CD=B0=EC=B9=AB=C1=F7=B3=CC= =A1=A3=A3=A8= =CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7=BA=CE=A2=CD=F8=D5=BE=A3=A9
    =20
    =B2=C6= =CE=F1=B9=DC=C0=ED=C4=A3=BF=E9= =A3=A8e-Financials=A3=A9=A3=BA
    =CD=A8=B9=FDIntranet =BA=CDInternet =D7=D4=B6=AF=BD=F8=D0= =D0=CA=FD=BE=DD=B5=C4=CA=D5=BC=AF=BA=CD=B4=A6=C0=ED=A1=A3=C4=DC=D4=DA=CF=DF= =B7=D6=CE=F6=D7=E9=D6=AF=B5=C4=D0=A7=C4=DC=A1=A3=A3= =A8=CF=EA=C7=E9=C7=EB=E4=AF=C0=C0=B7= =BA=CE=A2=CD=F8=D5=BE=A3=A9
    =20

    =D3=FB=C1=CB=BD=E2=CF=EA=CF=B8=B9=A6=C4=DC=BD=E9=C9=DC= =A3=AC=C7=EB=D6=C2=B5=E7=B7=BA=CE=A2=CD=F8=C2=E7=D3=D0=CF=DE=B9=AB=CB=BE=BB= =F2=D5=DF=BD=F8=C8=EB=B7=BA=CE=A2=CD=F8=D5=BE=A3=BAwww.weaver.com.cn

    =20 =20
    ERP=CF=B5=CD=B3 =B5=E7=D7=D3=C9=CC=CE=F1=BD=A8=C9=E8 =BB=F9=D3=DAWEB=B5=C4OA=B0=EC=B9=AB=CF=B5=CD= =B3
           
    =20
    =B5=E7=BB=B0=A3=BA021-63539330=A3=AC0= 21-63533667=A3=AC021-63177399
    =B5=E7=D3=CA=A3=BA contact@weaver.com.cn= =20
    =CD=F8=D5=BE=A3=BAwww.weaver.com.cn=20
    =B5=D8=D6=B7=A3=BA=C9=CF=BA=A3= =CC=EC=C4=BF=CE=F7=C2=B7218=BA=C5=BC=CE=C0=EF=B2=BB=D2=B9=B3=C72=D7=F92902= =CA=D2

     

      <= a href=3D"http://www.weaver.com.cn" target=3D"_blank">
    =
    =
    From liyang@nerv.cx Fri Mar 1 04:48:57 2002 From: liyang@nerv.cx (Liyang Hu) Date: Fri, 1 Mar 2002 04:48:57 +0000 Subject: help a lost soul In-Reply-To: <000801c1c0bb$6b6fc930$b72387d9@youriruau5ak0q> References: <000801c1c0bb$6b6fc930$b72387d9@youriruau5ak0q> Message-ID: <20020301044857.GE11808@cam.ac.uk> On Fri, Mar 01, 2002 at 12:52:51AM -0000, Rowan Corben wrote: > i have been set an assignment by my university....we are so badly > taught that i have absolutley no idea how to do it! I would be > more than happy to post payment for however much you feel your > time is worth... How about this: 1) I forward this email to your lecturers: Phil Molyneux Dan Russell 2) and you go and /learn/ how to do your own assignments? Programming is meant to be /fun/, dammit. Cheers, /Liyang -- .--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--. | Real computer scientists don't write in assembler. | | They don't write in anything less portable than a number two pencil. | From opielee1114@msn.com Fri Mar 1 08:54:01 2002 From: opielee1114@msn.com (RONALD HASKELL) Date: Fri, 1 Mar 2002 03:54:01 -0500 Subject: who's name my name Message-ID: ------=_NextPart_001_0000_01C1C0D4.B94CC360 Content-Type: text/plain; charset="iso-8859-1" ------=_NextPart_001_0000_01C1C0D4.B94CC360 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable


    = ------=_NextPart_001_0000_01C1C0D4.B94CC360-- From cwitty@newtonlabs.com Fri Mar 1 19:24:42 2002 From: cwitty@newtonlabs.com (Carl R. Witty) Date: 01 Mar 2002 11:24:42 -0800 Subject: H98 Report: expression syntax glitch In-Reply-To: "Simon Peyton-Jones"'s message of "Tue, 26 Feb 2002 08:23:03 -0800" References: <1113DDB24D4A2841951BFDF86665EE193749EE@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: "Simon Peyton-Jones" writes: > I didn't phrase it right. I meant that a let/lambda/if always > extends to the next relevant (not part of a smaller expression) > punctuation symbol; and if that phrase parses as an exp > that's fine, otherwise it's a parse error. So I should not really > speak in terms of 'ambiguity'. > > Perhaps we can simply say that > let .. in exp > is legal only if the phrase is followed by one of the punctuation > symbols. That's nice, because we don't need to talk of > "not part of a smaller expression". > > So (let x = 10 in x `div`) would be rejected because > x `div` > isn't a exp. If you're going to modify the syntax in the report to match what implementors actually implement, you may also want to change the "illegal lexeme" definition for closing implicit layout. I believe that do a == b == c is (according to the Standard) legal syntax that means (do {a == b}) == c but I'll bet that most if not all Haskell parsers would get it wrong. Carl Witty From igloo@earth.li Fri Mar 1 19:42:40 2002 From: igloo@earth.li (Ian Lynagh) Date: Fri, 1 Mar 2002 19:42:40 +0000 Subject: FW: Haskell 98 lexical syntax again In-Reply-To: <200203010313.TAA25478@mail4.halcyon.com> References: <200203010313.TAA25478@mail4.halcyon.com> Message-ID: <20020301194240.GA12774@stu163.keble.ox.ac.uk> On Thu, Feb 28, 2002 at 07:13:32PM -0800, Ashley Yakeley wrote: > At 2002-02-28 07:18, Simon Peyton-Jones wrote: > > > whitechar -> newline | vertab | space | tab | uniWhite > > newline -> return linefeed | return | linefeed | formfeed > > return -> a carriage return > > linefeed -> a line feed > > > >This means that CR, LF, or CRLF, are all valid 'newline' separators, > >and the same sequence of characters should therefore work on any > >Haskell implementation. > > Good. > > While you're fiddling with it, I recommend this: > > newline -> return linefeed | return | linefeed | formfeed | > uniLineSep | uniParaSep > uniLineSep -> any char of General Category Zl > uniParaSep -> any char of General Category Zp If this happens then * The characters newline, return, linefeed, and formfeed, all start a new line. in "B.3 Layout" should also be updated. In fact I think it should be changed to * The token newline starts a new line regardless, although that kind of reminds me the "May contain nuts" warning on nut packets. Ian From ashley@semantic.org Sat Mar 2 06:23:26 2002 From: ashley@semantic.org (Ashley Yakeley) Date: Fri, 1 Mar 2002 22:23:26 -0800 Subject: foralls in class assertions Message-ID: <200203020623.WAA10003@mail4.halcyon.com> At 2002-02-20 13:15, Simon Peyton-Jones wrote: >I have not implemented, yet. As always my implementation >priorities are strongly influenced by my perception of whether >some enhancement would be used. Maybe you can outline >why such a change would be useful to you? I only have the >example in our paper as motivation so far. I just came across one. I want to create a class for refs, such that they are in Eq: class (forall a. Eq (r a)) => Ref m r where { newRef :: a -> m (r a); ... etc. } -- Ashley Yakeley, Seattle WA From till@tzi.de Sat Mar 2 12:31:55 2002 From: till@tzi.de (Till Mossakowski) Date: Sat, 02 Mar 2002 13:31:55 +0100 Subject: multiparameter generic classes References: <20020301035600.9186F422378@www.haskell.org> Message-ID: <3C80C63B.2027BC59@tzi.de> We are using multiparameter classes with fundeps in the project MULTIPLE, which is about heterogeneous specification in multi-logic frameworks. See http://www.tzi.de/cofi/projects/multiple.html The interesting challenge is not only genericity (over an arbitray logic), but also heterogeneity (i.e. coexistence and communication of several logics, coded as instances of the multiparameter class). A paper describing the implementation is not available yet, but in preparation. Till Mossakowski > are there any papers/webpages/implementations/etc. of using multiparameter > classes in a generic framework, with or without dependencies? > > thanks! > > - hal > > -- > Hal Daume III -- Till Mossakowski Phone +49-421-218-4683 Dept. of Computer Science Fax +49-421-218-3054 University of Bremen till@tzi.de P.O.Box 330440, D-28334 Bremen http://www.tzi.de/~till From claus.reinke@talk21.com Sun Mar 3 01:14:01 2002 From: claus.reinke@talk21.com (Claus Reinke) Date: Sun, 3 Mar 2002 01:14:01 -0000 Subject: Research Opportunity: Refactoring Functional Programs (UKC) Message-ID: <007801c1c250$b5768460$ae1ffea9@Standard> Job opportunity for postdoc / graduate Research Associate in Refactoring Functional Programs at University of Kent. Please bring to the attention of suitable candidates / forward as appropriate. ----------------------------------------------- ad follows Research Associate in Refactoring Functional Programs Applications are invited for a three year Research Associate position at the University of Kent at Canterbury, to work under the direction of Professor Simon Thompson and Dr Claus Reinke on an EPSRC funded project entitled "Refactoring Functional Programs". Applications are welcomed from candidates with a doctorate or a very good first degree; in the latter case a successful candidate will have the opportunity of registering to study for a PhD. Refactoring is the process of redesigning existing code without changing its functionality. In our project we will explore refactoring for functional programs and in particular we will construct a catalogue of functional refactorings, and build a prototype tool in Haskell to support refactoring of Haskell programs. Applicants should be able to demonstrate strong experience of programming in a functional programming language, preferably Haskell, and have good communication skills. The appointment will be made within the salary ranges of £17,278-£26,229 p.a. on the Research IA scale. Please telephone the Personnel Office for further particulars on 01227 827837 (24 hours) or email: Personnel@ukc.ac.uk, quoting the reference number R02/24. Text phone users please telephone 01227 823674. The closing date is Friday 22 March 2002. Informal enquires can be directed to either Simon or Claus: {S.J.Thompson,C.Reinke}@ukc.ac.uk. More details of the project and further particulars for the position can be found at: http://www.cs.ukc.ac.uk/people/staff/sjt/Refactor/ Simon and Claus From dominic.j.steinitz@britishairways.com Sun Mar 3 07:15:50 2002 From: dominic.j.steinitz@britishairways.com (dominic.j.steinitz@britishairways.com) Date: Sun, 3 Mar 2002 07:15:50 +0000 Subject: getProtocolByName Message-ID: Here's my test program. TCP is a valid protocol. But I get the following when I run it. I'm running under W98 by the way. I have two questions: 1) Why do I get an error? 2) Even if this is a valid error why doesn't the function tell me so that I can handle it rather than terminating? Dominic. C:\Dom\haskell\ping>main Fail: does not exist Action: getProtocolByName Reason: no such protocol entry C:\Dom\haskell\ping>version C:\Dom\haskell\ping>"c:\program files\glasgow haskell compiler\ghc-5.02\bin\ghc" --version The Glorious Glasgow Haskell Compilation System, version 5.02 module Main(main) where import BSD main = do protocolEntry <- getProtocolByName "TCP" {- The documentation gives no clue as to what constitutes an error condition. Looking at the C equivalent in http://www.opengroup.org/onlinepubs/7908799/xns/endprotoent.html, this gives a null pointer to the data structure. Assume for now that the Haskell equivalent returns a null protocol name. -} if protoName protocolEntry == "" then putStrLn "Error" else putStrLn ("Protocol name: " ++ (protoName protocolEntry)) From finnw@iname.com Sun Mar 3 09:30:31 2002 From: finnw@iname.com (Finn Wilcox) Date: Sun, 3 Mar 2002 09:30:31 +0000 (GMT) Subject: getProtocolByName In-Reply-To: Message-ID: On Sun, 3 Mar 2002 dominic.j.steinitz@britishairways.com wrote: > Here's my test program. TCP is a valid protocol. But I get the following > when I run it. I'm running under W98 by the way. I have two questions: > > 1) Why do I get an error? You want: > module Main(main) where > > import BSD import Socket (withSocketsDo) > > main = withSocketsDo $ > do protocolEntry <- getProtocolByName "TCP" ... > See http://www.haskell.org/ghc/docs/latest/set/socket.html#AEN14601 > 2) Even if this is a valid error why doesn't the function tell me so that I > can handle it rather than terminating? > It is a valid error. It is raising an exception which you can catch if you want. e.g. import IO (catch, isDoesNotExistError) ... catch (do protocolEntry <- getProtocolByName "TCP" putStrLn ("Protocol name:" ++ (protoName protocolEntry))) (\e -> if isDoesNotExistError e then putStrLn "Error" else ioError e) Finn. From Ralf.Laemmel@cwi.nl Sun Mar 3 11:10:23 2002 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Sun, 03 Mar 2002 12:10:23 +0100 Subject: multiparameter generic classes References: Message-ID: <3C82049F.CA919B1F@cwi.nl> Hal Daume III wrote: > > are there any papers/webpages/implementations/etc. of using multiparameter > classes in a generic framework, with or without dependencies? Maybe this is something for you. It uses 7 parameters and many functional dependencies. But it is a kind of trivial :-) And yes, it is about a generic framework, that is, a framework for generic refactoring. http://www.cwi.nl/~ralf/tgr/ The multi-parameter class is used to encode a form of signature morphism, namely the interface for language abstractions I deal with in the refactoring framework. Ralf > thanks! > > - hal > > -- > Hal Daume III > > "Computer science is no more about computers | hdaume@isi.edu > than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell -- Dr.-Ing. Ralf Laemmel CWI & VU, Amsterdam, The Netherlands http://www.cwi.nl/~ralf/ http://www.cs.vu.nl/~ralf/ From dominic.j.steinitz@britishairways.com Sun Mar 3 17:42:56 2002 From: dominic.j.steinitz@britishairways.com (Dominic Steinitz) Date: Sun, 3 Mar 2002 17:42:56 +0000 Subject: getProtocolByName Message-ID:

     Finn,

     

    Thanks for this.

    I thought since I= wasn't actually using the socket module I wouldn't have to use withSockets= Do.

    The documentation for BSD is a little spartan and a few explanato= ry words about how errors get handled wouldn't go amiss.

    Anyway, it n= ow works so I'll move on to the next bit.

    Dominic.

    Finn Wilcox <finnw@sucs.org>
    03/= 03/2002 09:30
    Please respond to finnw
    To: dominic.j.steinitz@britishairwa= ys.com
    cc: haskell@haskell.= org
    bcc:
    Subject: Re: getProtocolByName


    On Sun, 3 Mar 2002 dominic.j.steinitz@britishairway= s.com wrote:

    > Here's my = test program. TCP is a valid protocol. But I get the following
    > when= I run it. I'm running under W98 by the way. I have two questions:
    ><= BR>> 1) Why do I get an error?

    You want:
    > module Main(main) where
    >
    > import BSD<= BR>  import Socket (withSocketsDo)
    >
    > main =3D
     =   withSocketsDo $
    >    do protocolEntry <- getProt= ocolByName "TCP"
        ...
    >
    See http://www.h= askell.org/ghc/docs/latest/set/socket.html#AEN14601

    > 2) Even if this is a valid error why doesn= 't the function tell me so that I
    > can handle it rather than termina= ting?
    >
    It is a valid error.  It is raising an exception whic= h you can catch if you
    want. e.g.

    import IO (catch, isDoesNotExistError)
    ...
      catch (do= protocolEntry <- getProtocolByName "TCP"
        &n= bsp;       putStrLn ("Protocol name:" ++ (protoNam= e protocolEntry)))
            (\e -> if isDoesNotEx= istError e then
                   =   putStrLn "Error" else
            &nb= sp;         ioError e)

    Finn.

    = From isc80520@nus.edu.sg Mon Mar 4 01:55:06 2002 From: isc80520@nus.edu.sg (Nguyen Phan Dung) Date: Mon, 4 Mar 2002 09:55:06 +0800 Subject: Lazy Evaluation Message-ID: <000001c1c31f$9c204e90$947ba8c0@PhanDung> This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C1C362.AA438E90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, Sorry for asking such a silly question: Haskell is using lazy evaluation. So, it means we should be able to declare and use a list of billions elements without any trouble. So I declare my list as follow: mylist :: [Integer] mylist = [1..1000000000] In Hugs, I type mylist to print out all the elements inside. However, after printing about 22000 elements, the system crashs & outputs: "Garbage collection fails to reclaim sufficient memory" Would you please help me with this problem? Thank you very much, Phan Dung. ------=_NextPart_000_0001_01C1C362.AA438E90 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

     =

    Hello,=

     =

    Sorry for = asking such a silly question: Haskell is using lazy evaluation. So, it means we = should be able to declare and use a list of billions elements without any trouble. = So I declare my list as follow:

     =

    mylist :: = [Integer]

    mylist =3D [1..1000000000]

     =

    In Hugs, I = type mylist to print out all the elements inside. However, after printing about = 22000 elements, the system crashs & outputs: “Garbage collection = fails to reclaim sufficient memory”

     =

    Would you = please help me with this problem?

    Thank you = very much,

    Phan = Dung.

    ------=_NextPart_000_0001_01C1C362.AA438E90-- From Tom.Pledger@peace.com Mon Mar 4 03:04:54 2002 From: Tom.Pledger@peace.com (Tom Pledger) Date: Mon, 4 Mar 2002 16:04:54 +1300 Subject: Lazy Evaluation In-Reply-To: <000001c1c31f$9c204e90$947ba8c0@PhanDung> References: <000001c1c31f$9c204e90$947ba8c0@PhanDung> Message-ID: <15490.58454.607261.361196@waytogo.peace.co.nz> Nguyen Phan Dung writes: : | mylist :: [Integer] | mylist = [1..1000000000] | | In Hugs, I type mylist to print out all the elements inside. However, | after printing about 22000 elements, the system crashs & outputs: | "Garbage collection fails to reclaim sufficient memory" The declaration of mylist is a pattern binding, not a function binding - see section 4.4.3 of the Haskell 98 report. What that means in this particular case is that the system saves the result in case you want to use it again, rather than freeing the part of the list it's already printed. Try typing [1..1000000000] at the Hugs prompt instead. Regards, Tom From aciego@ctima.uma.es Mon Mar 4 10:48:23 2002 From: aciego@ctima.uma.es (Manuel Ojeda Aciego) Date: Mon, 4 Mar 2002 11:48:23 +0100 Subject: 2nd CFP: Unification in non-classical logics Message-ID: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D We apologize if you receive this more than once =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Second call for papers Unification in Non-Classical Logics --co-located with ICALP 2002-- July, 12-13, 2002, M=E1laga, Spain http://www.satd.uma.es/aciego/icalp-ws.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The workshop on Unification in Non-Classical Logics will be held in M=E1laga, as a workshop of the 29-th International Colloquium on Automata, Languages, and Programming (ICALP 2002), which is a very convenient forum for an open discussion of the subject of non-canonical unification, roughly depicted below. Aims and scope -------------- Unification in non-classical logics, with various approaches to handling generalised terms, has drawn more and more attention in recent years. It turns out to be among the most promising areas of research on non-classical logics and its applications. So far, most popular lines of research include fuzzy unification of (conventional) databases and the use of fuzzy concepts in information retrieval. Some international events based on these topics have been held so far, for instance, the 2nd Intl Workshop on Logic Programming and Soft Computing (LPSC'98), or the special session on Advances in Possibilistic Logic and Related Issues at the IFSA Congress in Vancouver, Canada (2001), have non-classical unification among their topics. This workshop at ICALP is conceived as a forum for the exchange of ideas relevant for the concept of unification in non-classical logics, including, but not limited to, the following topics (practical implementations and experiences as well as theoretical advances): * Unification in multiple-valued and fuzzy logic programming. * Unification based on similarities and fuzzy equivalence relations. * Categorical unification. * Practical use of non-classical unification, e.g. in expert systems and information retrieval. We expect potential participants from the following areas: multiple-valued logic, fuzzy logic, uncertainty in logic programming, categorical applications to computer science. The workshop will have a limited number of presentations and the organizers will apply a refereeing procedure accordingly. The format will be as a set of presentations followed by a round table discussion. As the number of participants is estimated not to be very large, time enough will be allocated for each presentation (between 30 and 40 minutes), thus helping to have a relaxed workshop atmosphere in which discussions are encouraged. Submission ---------- Authors are invited to submit an extended abstract of their papers, presenting original contributions to the workshop themes. The workshop proceedings will be published as an issue in the ENTCS series (Electronic Notes on Theoretical Computer Science). Submissions should be written in English and not exceed 15 pages using the ENTCS style, and sent to the organizers in either PS or PDF form, together with a text-only message containig: title, abstract and keywords, the author's full names, and address and e-mail for correspondence. Simultaneous submission to other meetings with published proceedings is not allowed. Important dates --------------- * 20.03.2002 Workshop paper submission deadline * 21.04.2002 Workshop paper acceptance notification * 10.05.2002 Workshop paper camera-ready deadline Organizing Committee -------------------- Patrik Eklund Manuel Ojeda-Aciego Dept. Computing Science Dept. Matematica Aplicada Umea University Universidad de Malaga mailto:peklund@cs.umu.se mailto:aciego@ctima.uma.es ---------------------------------------------------------- From jmj@info.fundp.ac.be Mon Mar 4 13:36:48 2002 From: jmj@info.fundp.ac.be (Jean-Marie JACQUET) Date: Mon, 4 Mar 2002 14:36:48 +0100 (MET) Subject: Flocasa: 1st Call for Paper Message-ID: <200203041336.g24DamB04309@backus.info.fundp.ac.be> [ Our apologies for multiple copies. ] ====================================================================== 1st International Workshop on Foundations of Coordination Languages and Software Architectures (Foclasa 2002) August 24, 2002, Brno, Czech Republic Workshop affiliated to CONCUR'2002, 20 - 23 August 2002. http://www.fi.muni.cz/concur2002/Foclasa ====================================================================== SCOPE AND TOPICS Modern information systems rely more and more on combining concurrent, distributed, mobile and heterogenous components. This move from old systems, typically conceived in isolation, induces the need for new languages and software architectures. In particular, coordination languages have been proposed to cleanly separate computational aspects and communication. On the other hand, software architects face the problem of specifying and reasoning on non-functional requirements. All these issues are widely perceived as fundamental to improve software productivity, enhance maintainability, advocate modularity, promote reusability, and lead to systems more tractable and more amenable to verification and global analysis. The aim of the workshop is to bring together researchers working on the foundations of component-based computing, coordination, and software architectures. Topics of interest include (but are not limited to): o Theoretical models for coordination (component composition, concurrency, dynamic aspects of coordination, semantics, expressiveness); o Specification, refinement, and analysis of software archi- tectures (patterns and styles, verification of functional and non-functional properties); o Coordination, architectural, and interface definition languages (implementation, interoperability, heterogeneity); o Agent-oriented languages (formal models for interacting agents); o Dynamic software architectures (mobile agents, configuration, reconfiguration); o Modeling of information systems (groupware, internet and the web, workflow management, CSCW and multimedia applications) o Coordination patterns (mobile computing, internet computing); o Tools and environments for the development of coordinated applications SUBMISSION GUIDELINES Papers describing original work are solicited as contributions to Foclasa. Submitted papers should be limited to 6 000 words, preferrably formatted according to the Fundamenta Informaticae style (available at http://fi.mimuw.edu.pl/submissions.html). They should be emailed as PostScript (PS) or Portable Document Format (PDF) files to jmj@info.fundp.ac.be. PROCEEDINGS The proceedings will be published as a technical report of the Institute of Informatics at the University of Namur, and will be available at the workshop. Selected papers will be published in a special issue of the Funda- menta Informaticae journal, with February 2003 as expected publi- cation time. IMPORTANT DATES: o May 25, 2002: Submission deadline. o June 30, 2002: Notification of acceptance. o August 1, 2002: Final version. o August 24, 2002: Meeting Date. LOCATION The workshop will be held in Brno in August 2002. It is a satellite workshop of CONCUR 2002. For venue and registration see the CONCUR web page at http://www.fi.muni.cz/concur2002/ WORKSHOP ORGANIZERS o Antonio Brogi (University of Pisa, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) PROGRAMME COMITTEE: o Antonio Brogi (University of Pisa, Italy) - Co-chair o Rocco De Nicola (University of Firenze, Italy) o Jos Luiz Fiadeiro (University of Lisbon, Portugal) o Roberto Gorrieri (Univerity of Bologna, Italy) o Paola Inverardi (Univerity L'Aquila, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) - Co-chair o Joost Kok (University of Leiden, The Netherlands) o Antonio Porto (New University of Lisbon, Portugal) From jmj@info.fundp.ac.be Mon Mar 4 13:39:27 2002 From: jmj@info.fundp.ac.be (Jean-Marie JACQUET) Date: Mon, 4 Mar 2002 14:39:27 +0100 (MET) Subject: Flocasa: 1st Call for Paper Message-ID: <200203041339.g24DdRv07236@backus.info.fundp.ac.be> [ Our apologies for multiple copies. ] ====================================================================== 1st International Workshop on Foundations of Coordination Languages and Software Architectures (Foclasa 2002) August 24, 2002, Brno, Czech Republic Workshop affiliated to CONCUR'2002, 20 - 23 August 2002. http://www.fi.muni.cz/concur2002/Foclasa ====================================================================== SCOPE AND TOPICS Modern information systems rely more and more on combining concurrent, distributed, mobile and heterogenous components. This move from old systems, typically conceived in isolation, induces the need for new languages and software architectures. In particular, coordination languages have been proposed to cleanly separate computational aspects and communication. On the other hand, software architects face the problem of specifying and reasoning on non-functional requirements. All these issues are widely perceived as fundamental to improve software productivity, enhance maintainability, advocate modularity, promote reusability, and lead to systems more tractable and more amenable to verification and global analysis. The aim of the workshop is to bring together researchers working on the foundations of component-based computing, coordination, and software architectures. Topics of interest include (but are not limited to): o Theoretical models for coordination (component composition, concurrency, dynamic aspects of coordination, semantics, expressiveness); o Specification, refinement, and analysis of software archi- tectures (patterns and styles, verification of functional and non-functional properties); o Coordination, architectural, and interface definition languages (implementation, interoperability, heterogeneity); o Agent-oriented languages (formal models for interacting agents); o Dynamic software architectures (mobile agents, configuration, reconfiguration); o Modeling of information systems (groupware, internet and the web, workflow management, CSCW and multimedia applications) o Coordination patterns (mobile computing, internet computing); o Tools and environments for the development of coordinated applications SUBMISSION GUIDELINES Papers describing original work are solicited as contributions to Foclasa. Submitted papers should be limited to 6 000 words, preferrably formatted according to the Fundamenta Informaticae style (available at http://fi.mimuw.edu.pl/submissions.html). They should be emailed as PostScript (PS) or Portable Document Format (PDF) files to jmj@info.fundp.ac.be. PROCEEDINGS The proceedings will be published as a technical report of the Institute of Informatics at the University of Namur, and will be available at the workshop. Selected papers will be published in a special issue of the Funda- menta Informaticae journal, with February 2003 as expected publi- cation time. IMPORTANT DATES: o May 25, 2002: Submission deadline. o June 30, 2002: Notification of acceptance. o August 1, 2002: Final version. o August 24, 2002: Meeting Date. LOCATION The workshop will be held in Brno in August 2002. It is a satellite workshop of CONCUR 2002. For venue and registration see the CONCUR web page at http://www.fi.muni.cz/concur2002/ WORKSHOP ORGANIZERS o Antonio Brogi (University of Pisa, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) PROGRAMME COMITTEE: o Antonio Brogi (University of Pisa, Italy) - Co-chair o Rocco De Nicola (University of Firenze, Italy) o Jos Luiz Fiadeiro (University of Lisbon, Portugal) o Roberto Gorrieri (Univerity of Bologna, Italy) o Paola Inverardi (Univerity L'Aquila, Italy) o Jean-Marie Jacquet (University of Namur, Belgium) - Co-chair o Joost Kok (University of Leiden, The Netherlands) o Antonio Porto (New University of Lisbon, Portugal) From antony@apocalypse.org Mon Mar 4 14:04:13 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 04 Mar 2002 09:04:13 -0500 Subject: ANNOUNCE: GCJNI, a Java Native Interface forHaskell Message-ID: <3C837EDD.2010200@apocalypse.org> I am pleased to announce release 1.1 of GCJNI. GCJNI is a library that allows Haskell to invoke Java code via the Java Native Interface (JNI). The implementation uses GreenCard to make the JNI (a C language interface) available to Haskell. GCJNI includes a few convenient features, such as: - Integration of the Haskell and Java garbage collectors, so that Java objects are garbage collected when they are no longer accessible from Haskell. - Type class based overloading, which makes it easy to pass common types (like Int, Float and String) to or from Java code. - A tool (GenBindings) which uses Java reflection on a set of compiled Java classes to generate a Haskell module with a simple, high-level, type-safe interface to the underlying Java code. GCJNI has been succesfully tested using both hugs98 and ghc under both Linux and Windows. The distribution includes a unified Makefile system and detailed release notes that makes it very easy to configure, compile and install for any supported combination of Haskell implementation and platform. More information (including pointers to the relevant distributions) is available from the GCJNI web page at: http://www.haskell.org/gcjni Bug reports and feedback should be sent to antony@apocalypse.org. Enjoy! -------- News: Release 1.1 (03-March-2002): * Substantial improvements to configuration and build process. Unified Makefile structure for Linux and Windows using Cygwin and GNU make. -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From antony@apocalypse.org Mon Mar 4 14:07:42 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 04 Mar 2002 09:07:42 -0500 Subject: ANNOUNCE: Haven - A Functional Vector Graphics Library Message-ID: <3C837FAE.6030702@apocalypse.org> I am pleased to announce an experimental release of Haven, a library for scalable vector graphics in Haskell. Haven provides a wealth of features, including: - Data types for common geometric shapes such as rectangles, ellipses and Bezier curves. - Composition of arbitrary shapes from sequences of straight and curved segments. - Intersection tests and bounds calculations on shapes. - Cropping of any image by any shape. - Affine transformations on images and paths. - Calculation of precise rectangular bounds of shapes and images. - High quality, anti-aliased rendering. - Scalable outline fonts. - Smooth blending of colors (gradients) - Alpha blending (transparency). - Fine-grained control of stroke width, join rules and end caps. - Constructive Area Geometry (CAG) for composing shapes using simple set-theoretic operations. Haven presents a purely functional API, but is implemented using the Java2D renderer. For more information on Haven, including examples and download instructions, please visit the haven web page at: http://www.haskell.org/haven Please send suggestions and bug reports to: antony@apocalypse.org Enjoy! -------- News: Release 1.1 (03-March-2002): * Substantial improvements to configuration and build process. Unified Makefile structure for Linux and Windows using Cygwin and GNU make. -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From rjchaaft@cs.uu.nl Mon Mar 4 14:09:03 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Mon, 04 Mar 2002 15:09:03 +0100 Subject: Why is this function type-correct Message-ID: <4.3.0.20020304144448.00b43af0@pop.students.cs.uu.nl> Hello, Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a -> b x = x 42 is equally well accepted, though I can't see why this type would be correct. (I'd expect it to be too general.) From rjchaaft@cs.uu.nl Mon Mar 4 14:11:15 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Mon, 04 Mar 2002 15:11:15 +0100 Subject: Why is this function type-correct Message-ID: <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> Hello, Recently, I wrote a function similar to x :: a x = x 42 which is type-correct (Hugs, Ghc, THIH). Still, from the expression it is clear that the type shoud have a function type. The definition x :: a -> b x = x 42 is equally well accepted, though I can't see why this type would be correct. (I'd expect it to be too general.) For what reasons are these types considered correct? Thanks, Rijk-Jan From webmaster@repositorio.com.br Mon Mar 4 14:03:55 2002 From: webmaster@repositorio.com.br (Fernando Henrique de Oliveira) Date: 4 Mar 2002 11:03:55 -0300 Subject: Convite Especial Message-ID: <019201c1c1a5$68f2ed00$0e03140a@netsinai.com> CONVITE ESPECIAL.=20 http://www.repositorio.com.br=20 Convidamos voc=EA a visitar o maior e mais completo site de = Inform=E1tica atualmente na Internet Brasileira.=20 S=E3o milhares de configura=E7=F5es, scripts, strings de modem, Linux, = Windows, Mac, Imac e outros ACESSO TOTALMENTE GRATUITO.=20 S=E3o mais de 150 categorias de busca com acesso a m=FAltiplas bases de = conhecimento.=20 Temos mais de 100Mb de perguntas e respostas em nosso banco de dados.=20 Fa=E7a como quase 2.000.000 de internautas, visite-nos.=20 N=C3O DEIXE DE NOS VISITAR.=20 Lembre-se, o acesso =E9 gratuito.=20 http://www.repositorio.com.br=20 Atenciosamente=20 Webmaster=20 De acordo com as diretivas aprovadas no 105o Congresso de Base = Normativas Internacionais sobre SPAM, Se=E7=E3o 301, Par=E1grafo (a) (2) = (c) Decreto S. 1618, T=EDtulo Terceiro, um E-mail n=E3o poder=E1 ser = considerado SPAM, enquanto inclua uma forma de ser removido.=20 Por isso se deseja ser exclu=EDdo da nossa lista responda esta mensagem = para remover@repositorio.com.br com o t=EDtulo "Remova". From simonmar@microsoft.com Mon Mar 4 14:23:17 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 4 Mar 2002 14:23:17 -0000 Subject: Why is this function type-correct Message-ID: <9584A4A864BD8548932F2F88EB30D1C60886F05A@TVP-MSG-01.europe.corp.microsoft.com> > Recently, I wrote a function similar to >=20 > x :: a > x =3D x 42 >=20 > which is type-correct (Hugs, Ghc, THIH). > Still, from the expression it is clear > that the type shoud have a function type. > The definition >=20 > x :: a -> b > x =3D x 42 >=20 > is equally well accepted, though I can't > see why this type would be correct. (I'd > expect it to be too general.) In two words: polymorphic recursion. You'll find that the compiler won't be able to derive a type for 'x' in either of the two examples you gave, but x has several types the most general of which is 'forall a. a' (ie. your first example). The fact that x has type 'forall a. a' is also a useful hint as to its behaviour - the only value that has such a type is bottom. Cheers, Simon From Jon.Fairbairn@cl.cam.ac.uk Mon Mar 4 14:25:00 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Mon, 04 Mar 2002 14:25:00 +0000 Subject: Why is this function type-correct In-Reply-To: Your message of "Mon, 04 Mar 2002 15:11:15 +0100." <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> Message-ID: <16162.1015251900@cl.cam.ac.uk> "Rijk J. C. van Haaften" wrote: > Recently, I wrote a function similar to > = > x :: a > x =3D x 42 > = > which is type-correct (Hugs, Ghc, THIH). > Still, from the expression it is clear > that the type shoud have a function type. > The definition > = > x :: a -> b > x =3D x 42 > = > is equally well accepted, though I can't > see why this type would be correct. (I'd > expect it to be too general.) > = > For what reasons are these types considered > correct? When you say x :: a you are asking that the compiler check that everything you say about x is consistent with x being acceptable where /any/ type is required. In the application x 42, it requires that x be a function, which is fine, because x has any type, and this includes functions. When you say x =3D x 42, this requires that the type returned from x 42 is the same as the type of x, again fine because if x::a, then x:: Integer -> a also, so x 42:: a. It works out in practise because x =3D x 42 gives x the value bottom, and bottom::a for all a. = J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From d95mback@dtek.chalmers.se Mon Mar 4 15:05:04 2002 From: d95mback@dtek.chalmers.se (Martin =?ISO-8859-1?Q?Norb=E4ck?=) Date: 04 Mar 2002 16:05:04 +0100 Subject: Why is this function type-correct In-Reply-To: <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> References: <4.3.0.20020304151042.00b356e8@pop.students.cs.uu.nl> Message-ID: <1015254305.27556.3.camel@caesar.safelogic.se> m=E5n 2002-03-04 klockan 15.11 skrev Rijk J. C. van Haaften: > Hello, >=20 > Recently, I wrote a function similar to >=20 > x :: a > x =3D x 42 >=20 > which is type-correct (Hugs, Ghc, THIH). > Still, from the expression it is clear > that the type shoud have a function type. It might interest you to know that this function is also type correct: x :: x x =3D x x x x x x I would like to see a compiler derive that type though... Regards, Martin --=20 [ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ] Opinions expressed above are mine, and not those of my future employees. SIGBORE: Signature boring error, core dumped From MarkoSchuetz@web.de Mon Mar 4 18:57:02 2002 From: MarkoSchuetz@web.de (Marko Schuetz) Date: Mon, 04 Mar 2002 19:57:02 +0100 Subject: ANNOUNCE: GCJNI, a Java Native Interface forHaskell In-Reply-To: <3C837EDD.2010200@apocalypse.org> References: <3C837EDD.2010200@apocalypse.org> Message-ID: <20020304195702E.marko@kinetic.ki.informatik.uni-frankfurt.de> Antony, at the given URI it says JDK 1.4 is required, do you know that there will be problems with 1.3 or is it expected to work with 1.3 also and just not tested? Thanks for your help Marko From Jon.Fairbairn@cl.cam.ac.uk Mon Mar 4 20:06:32 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Mon, 04 Mar 2002 20:06:32 +0000 Subject: Standard Library report: List union Message-ID: <17114.1015272392@cl.cam.ac.uk> The current library report defines unionBy like this: unionBy eq xs ys =3D xs ++ deleteFirstsBy eq (nubBy eq ys) xs why does it take the nub of ys, but not xs? I'd have expected unionBy eq xs ys =3D (nubBy eq xs) ++ deleteFirstsBy eq (nubBy eq ys) = xs J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From sqrtofone@yahoo.com Tue Mar 5 01:51:13 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Mon, 4 Mar 2002 19:51:13 -0600 (CST) Subject: Standard Library report: List union In-Reply-To: <17114.1015272392@cl.cam.ac.uk> Message-ID: On Mon, 4 Mar 2002, Jon Fairbairn wrote: > The current library report defines unionBy like this: > > unionBy eq xs ys = xs ++ deleteFirstsBy eq (nubBy eq ys) xs > > why does it take the nub of ys, but not xs? I'd have expected > > unionBy eq xs ys = (nubBy eq xs) ++ deleteFirstsBy eq (nubBy eq ys) xs > > Jón Pure guess, but... (no really!) For the sake of argument, lets define a ulist as a list where for all elements x in list l, there is no element n with index not equal to that of x (index being position of the element in the list) such that eq n x == True. In other words every element in a ulist appears only once. Suppose you (unionBy eq x y) to get a result. Suppose also that x is a ulist A. x is a ulist by argument. B. the result of (nubBy eq ys), lets call it z, is a ulist. C. the result of (deleteFirstsBye eq z xs) is a list which has no elements in common with xs). because (deleteFirstsBy eq) "deletes" elements and doesnt add,the result is a ulist. D. Adding new, unique, elements (elements not equal to a element in the ulist in question) to a ulist results in a ulist. E. Therefore (unionBy eq x y) is a ulist. Why should this be important? what if you wanted to fold the function (unionBy eq) over a list of lists to get a ulist? Assuming you start with an initial ulist, by your suggestion you'd be applying (nubBy eq) to a ulist (generated by the the repeated application (unionByeq), which would be the same as applying the identity function to a ulist. (meaning you have essentially one big nasty no-op)! However, in taking a look at unionBy, one might wonder why it isnt defined like so (assuming xs would be the accumulated ulist in the fold. unionBy eq xs ys = (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs or maybe better (to mirror (++)) unionBy' eq ys xs = (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs in using this definition, the number of conses with (:) should be linear (or less) with with the number of elements to be added to the first_ulist in the following folds. foldl (unionBy eq) first_ulist list_of_lists foldr (unionBy' eq) first_ulist list_of_lists So, is there aother reason I cannot think of? I'm sure I haven't covered all bases here. Thanks, Jay Cox From sqrtofone@yahoo.com Tue Mar 5 02:35:01 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Mon, 4 Mar 2002 20:35:01 -0600 (CST) Subject: Lazy Evaluation In-Reply-To: <15490.58454.607261.361196@waytogo.peace.co.nz> Message-ID: On Mon, 4 Mar 2002, Tom Pledger wrote: > Nguyen Phan Dung writes: > : > | mylist :: [Integer] > | mylist = [1..1000000000] > | > | In Hugs, I type mylist to print out all the elements inside. However, > | after printing about 22000 elements, the system crashs & outputs: > | "Garbage collection fails to reclaim sufficient memory" > > The declaration of mylist is a pattern binding, not a function binding > - see section 4.4.3 of the Haskell 98 report. > > What that means in this particular case is that the system saves the > result in case you want to use it again, rather than freeing the part > of the list it's already printed. > > Try typing [1..1000000000] at the Hugs prompt instead. So would wrapping such possibly fiendish entities as [1..] with the "const" function and replacing all references to the toplevel binding with "(binding ())" make sure that the first part of the list could be thrown away and re-computed if needed? Or does one need to NOINLINE it as well? Example to make myself clear: mylist = const [1..1000000000] main = print (mylist ()) It seems like we had a discussion about something very similar to this a few months ago on some haskell.org list. Thanks, Jay Cox From chak@cse.unsw.edu.au Tue Mar 5 07:50:09 2002 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Tue, 05 Mar 2002 18:50:09 +1100 Subject: CFP: 2002 Haskell Workshop Message-ID: <20020305185009O.chak@cse.unsw.edu.au> [My apologies if you receive multiple copies of this message] ------------------------------- C A L L F O R P A P E R S ------------------------------- ACM SIGPLAN 2002 Haskell Workshop Pittsburgh, PA, USA 3rd October 2002 (as part of PLI'02) =================================== The purpose of the Haskell Workshop is to discuss experience with Haskell, and possible future development of the language. The scope of the workshop includes all aspects of the design, semantics, theory, application, implementation, and teaching of Haskell. Previous Haskell Workshops have been held in La Jolla (1995), Amsterdam (1997), Paris (1999), Montreal (2000), and Firenze (2001). For detailed information please consult http://www.cse.unsw.edu.au/~chak/hw2002/ Submission deadline: *** 24th May 2002 *** ** P L E A S E N O T E ** * If there is sufficient demand, we will try to organise facilities for system demonstrations. If you are generally interested in demonstrating an application or tool written in Haskell, please contact the PC chair at your earliest convenience, so that we can judge demand. * Submission and publication information changed with respect to the provisional CFP published earlier. From fuzhezheng@hotmail.com Tue Mar 5 22:43:47 2002 From: fuzhezheng@hotmail.com (Zhe Fu) Date: Tue, 5 Mar 2002 14:43:47 -0800 Subject: how to read a file's content to a string? References: <20020305170102.A936D42239E@www.haskell.org> Message-ID: I want to read a file's content into a string. content :: FilePath -> String content f = readFile f But when there is a type error: Type error in explicitly typed binding *** Term : content *** Type : FilePath -> IO String *** Does not match : FilePath -> String How can I solve it? Thanks. Zhe From sqrtofone@yahoo.com Wed Mar 6 00:36:01 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Tue, 5 Mar 2002 18:36:01 -0600 (CST) Subject: how to read a file's content to a string? In-Reply-To: Message-ID: On Tue, 5 Mar 2002, Zhe Fu wrote: > I want to read a file's content into a string. > > content :: FilePath -> String > content f = readFile f > > But when there is a type error: > > Type error in explicitly typed binding > *** Term : content > *** Type : FilePath -> IO String > *** Does not match : FilePath -> String > > How can I solve it? > > Thanks. > > Zhe > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell Essentially, what you are trying to do is invalid. you have to write some function that results in a IO String. I haven't read these but they might help. (cut and paste from haskell wiki front page) ThatAnnoyingIoType: I have an IO String but I need a String - what do I do now? http://haskell.org/wiki/wiki?ThatAnnoyingIoType UsingIo: What's that IO type anyway? How do I do I/O in Haskell? http://haskell.org/wiki/wiki?UsingIo Jay Cox From afelty@site.uottawa.ca Wed Mar 6 03:02:57 2002 From: afelty@site.uottawa.ca (Amy Felty) Date: Tue, 5 Mar 2002 22:02:57 -0500 (EST) Subject: New Deadline: Special Journal Issue on Proof-Carrying Code Message-ID: * * * * New Deadline: April 12, 2002 Call for Papers JOURNAL OF AUTOMATED REASONING Special issue on PROOF-CARRYING CODE Proof-carrying code is a technology that allows a host, or code consumer, to safely run code delivered by an untrusted code producer. The code producer delivers both a program and a formal proof that verifies that the code meets the desired safety policies. Safety policies generally express properties that prohibit the code from harmful behavior such as accessing private data, overwriting important data, accessing unauthorized resources, or consuming too many resources. Ideally, a proof is constructed automatically, and proof search may be directed using information that is passed on from the code producer's compiler. Proofs provided semi-automatically or interactively using a proof assistant are possible as well. Upon receiving the code and proof, the code consumer uses a mechanical proof checker to check the proof before executing the code. This special issue will be devoted to the topic of proof-carrying code and related approaches which use formal reasoning to enhance safety and reliability of software. Manuscripts emphasizing original results and study of tools and methods for proof generation, proof checking, and their integration with code generation/compilation are of particular interest. Manuscripts should be unpublished works and not submitted elsewhere. Revised and enhanced versions of papers published in conference proceedings that have not appeared in archival journals are eligible for submission. All submissions will be reviewed according to the usual standards of scholarship and originality. Information on JAR submissions can be found at URL http://www-unix.mcs.anl.gov/JAR/. Please format your submissions using JAR macros (available at http://www.wkap.nl/kaphtml.htm/STYLEFILES). Submissions should be sent to the guest editor in postscript format, preferably gzipped and uuencoded. In addition, please send as plain text, the title, authors, abstract, and contact information for the paper. The submission deadline is April 12, 2002. Guest Editor: Amy Felty, University of Ottawa, afelty@site.uottawa.ca This information is available on the web at: http://www.site.uottawa.ca/~afelty/jar-pcc/ From icsm2002.info@unisannio.it Wed Mar 6 12:49:21 2002 From: icsm2002.info@unisannio.it (icsm2002.info@unisannio.it) Date: Wed, 6 Mar 2002 13:49:21 +0100 (CET) Subject: Icsm 2002 Call for Papers: deadline is approaching Message-ID: <200203061249.g26CnLm07282@unisannio.it> Dear Colleague I would like to remind you that the ICSM full paper submission deadline is approaching. ICSM (IEEE International Conference on Software Maintenance), 2002, and associated workshops: SCAM, WSE, and WESS will be held next October 2002 in Montreal, Canada. Outstanding Keynotes such as Jon Pincus, Microsoft, Industrial and experience papers, research papers, tutorials, tool expositions, dissertation forum, workshops, panels, and other exciting activities have been planned. Papers are due by 18 March 2002 You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt we hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. If you would like to be removed from our list please send an email to icsm2002.info@unisannio.it with REMOVE in the subject. ICSM2002 Giuliano Antoniol, Program CoChair Ira D. Baxter, Program CoChair ============================================================================ IEEE International Conference on Software Maintenance 2002 Sponsored by IEEE ICSM-2002, Montreal, Canada, 3-6 October 2002 http://www.icsm2002.org icsm2002.info@unisannio.it Call for Papers Theme: Maintaining distributed heterogeneous systems ICSM is the major international conference in the field of software and systems maintenance, evolution, and management. This year's theme elaborates on last year's theme of "systems and software evolution in the era of the internet". Standalone legacy applications of yesterday and novel applications using today's technologies are rapidly becoming integrated as part of enterprise-wide and industry-wide systems. The need for rapid integration has led to many distributed heterogeneous systems that are very challenging to maintain and evolve. ICSM 2002 will address these new scenarios and the major challenges of maintenance and evolution. The focus of the conference will be on the new challenges that heterogeneous systems pose for software maintenance, and the new opportunities for researchers and practitioners. A main goal of ICSM is to promote interaction between researchers and practitioners. ICSM 2002 will bring together researchers, practitioners, developers and users of tools, technology transfer experts, and project managers. Jon Pincus (Microsoft) will describe how Microsoft handles software enhancements. Other outstanding Keynote speakers are being arranged. Past conferences have had Parnas, Rombach, McCabe, and Jacobson. ICSM-2002 will offer technical presentations and demonstrations from academia and industry. We are particularly interested in exchanging concepts, prototypes, research ideas, and other results that could contribute to the academic arena and also benefit business and the industrial community. ICSM 2002 will be participatory, with working collaborative sessions and presentations of industry projects. The Conference will be held in conjunction with: WESS -- Workshop on Empirical Studies of Software Maintenance. SCAM -- Source Code Analysis and Manipulation WSE -- Workshop on WEBsite Evolution Topics of interest include but are not restricted to the following aspects of maintenance and evolution: - Methods and theories - Maintenance and/or productivity metrics - Organizational frameworks - Preventive maintenance - Design for maintenance - Tools and environments - Life cycle and process control - Models/methods for error prediction - User interface evolution - Commercial off-the-shelf (COTS) - Third party maintenance - Freeware and open source applications - Program comprehension - Software and system visualisation - Knowledge based systems - Measurement of software - Formal methods - Legal aspects and standards - Software reusability - Internet and distributed systems - Empirical studies - Testing and regression testing - Remote, tele-work - Version and configuration management - Processes and strategies - Management and organisation - Co-operative applications - Source code analysis and manipulation - Processes and strategies - Impact of new software practices - Programming languages - Reengineering and reverse engineering - Multimedia systems RESEARCH PAPERS: Research papers should describe original and significant work in the research and practice of software maintenance and evolution. Case studies, empirical research, and experiments are particularly welcome. We also welcome papers that present leading edge and novel ideas in maintenance. Papers must not exceed 5000 words (10 pages IEEE style) in length, in English. To encourage strong submissions a prize will be awarded for the "Best Paper as Submitted". This Prize is offered by John Wiley & Sons, the publishers of the Journal of Software Maintenance and Evolution. The Program Committee will select the winner and a formal presentation of the Prize will be made in Montreal at ICSM 2002. FAST TRACK PAPERS: Fast Track papers should describe on-going research activities, or summarize the experience in software maintenance and evolution. Papers must not exceed 4 pages, IEEE style, in length, in English. Accepted fast-track papers will be included in a dedicated section of the conference proceedings. DISSERTATION FORUM: We welcome submissions of young researchers that have delivered their dissertation (Masters or Ph.D.) in the last three years. An award will be issued for the best submission. Four page summaries of accepted dissertations will be included in the conference proceedings and a special forum section will be organised at the conference. INDUSTRIAL APPLICATIONS: Proposals for presentations of Industrial Applications are welcome. These can be state-of-the-art descriptions, experience reports and survey reports from real projects, industrial practices and models, or tool demonstrations. A dedicated sub-committee of the program committee will review Industrial Application proposals and a 1-page summary of accepted proposals will be included in the conference proceedings. TUTORIALS: Tutorials should present software maintenance and evolution topics of interest to practitioners. Tutorials may be full day or half-day in length. SUBMISSION STYLE: PDF and/or Postscript electronic submission only. Papers longer than 15 pages or 6000 words will be returned to the authors. Acceptance notification will occur July 1, 2002. IMPORTANT DATES You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt Research Papers deadline: 18 March 2002 mailto:icsm2002.full@unisannio.it Fast Track Papers deadline: 1 May 2002 mailto:icsm2002.short@unisannio.it Dissertation Forum deadline: 1 May 2002 mailto:icsm2002.thesis@unisannio.it Industrial Applications deadline: 1 May 2002 mailto:icsm2002.industry@unisannio.it Tutorials deadline: 18 March 2002 mailto:icsm2002.tutorial@unisannio.it From Ralf.Laemmel@cwi.nl Wed Mar 6 14:13:37 2002 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Wed, 06 Mar 2002 15:13:37 +0100 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <3C862411.EA847B63@cwi.nl> Suppose you want to define a combinator like this: combinator :: (forall y. Class y => y -> y) -> (forall x. Class x => x -> x) This is a function combinator which turns a polymorphic function into another polymorphic function. As you can see, there is Class constraint. So in fact we would like to define the combinator by class overloading on the x in the result type. So how do we get our hands on the x while it is explicitly quantified by forall. Well, we try with implicit quantification: class Class x where combinator' :: (forall y. Class y => y -> y) -> x -> x So far so, good: We still need to define combinator in terms of combinator'. What is the trick to do this? Sounds like a homework question? Well, I know how to do it for first-class polymorphism. So let's restart the example. We define a function type to capture the kind of functions from above: data Bar = Foo (forall x. Class x => x -> x) Hence, the rank-2 type of combinator looks a bit different: combinator :: Bar -> Bar The class looks as follows: class Class x where combinator' :: Bar -> x -> x And here is how to define combinator in terms of combinator'. combinator f = Foo (combinator' f) This works both with GHC and hugs. In the pure rank-2 setting above, one would like to define combinator accordingly: combinator f = combinator' f But GHC 5.02.2 tells me: rank2.hs:11: Could not deduce (Class x) from the context () Probable fix: Add (Class x) to the type signature(s) for combinator arising from use of `combinator'' at rank2.hs:11 In the definition of `combinator': combinator' f This is not a bug, I guess although the probable fix proposal sends you in the wrong direction I claim. I tried a few other tricks but I can't get it done although my first-class polymorphic experience makes me think that it should be possible. Anyway, can this problem be solved? Any hint appreciated. Ralf -- Dr.-Ing. Ralf Laemmel CWI & VU, Amsterdam, The Netherlands http://www.cwi.nl/~ralf/ http://www.cs.vu.nl/~ralf/ From haskell-cafe@haskell.org Wed Mar 6 20:37:52 2002 From: haskell-cafe@haskell.org (Joe English) Date: Wed, 06 Mar 2002 12:37:52 -0800 Subject: ANNOUNCE: HXML 0.2, XML parser for Haskell Message-ID: <200203062037.g26Kbqu17149@dragon.flightlab.com> Announcing HXML version 0.2, a non-validating XML parser written in Haskell. It is designed for space-efficiency, taking advantage of lazy evaluation to reduce memory requirements. HXML is available at: The current version is 0.2, and is pre-beta quality. HXML has been tested with GHC 5.02, NHC 1.10, and various recent versions of Hugs 98. Changes in version 0.2: + New Arrow-based combinator library + Added support for CDATA sections + New function parseDocument recognizes (and ignores) the document prolog (XML and DOCTYPE declarations) + Several data structures and public functions have been renamed + Space fault in comment parsing fixed Please contact Joe English with any questions, comments, or bug reports. --Joe English jenglish@flightlab.com From ashley@semantic.org Thu Mar 7 00:03:49 2002 From: ashley@semantic.org (Ashley Yakeley) Date: Wed, 6 Mar 2002 16:03:49 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <200203070003.QAA25030@mail4.halcyon.com> At 2002-03-06 06:13, Ralf Laemmel wrote: >This is not a bug, Isn't it? Consider: class Class x where combinator' :: (forall y. Class y => y -> y) -> x -> x This gives: combinator' :: forall x. Class x => (forall y. Class y => y -> y) -> x -> x What happens when you pass something of type (forall y. Class y => y -> y)? s :: forall x. Class x => x -> x s = combinator' id; So I would claim that these two types are the same: forall x. Class x => (forall y. Class y => y -> y) -> x -> x (forall y. Class y => y -> y) -> (forall x. Class x => x -> x) ...so you should be able to do this: combinator :: (forall y. Class y => y -> y) -> (forall x. Class x => x -> x) combinator f x = combinator' f x but for some reason GHC 5.02.2 complains. I think this is a bug. Apparently 5.03 has rank-N polymorphism so maybe this is fixed too. -- Ashley Yakeley, Seattle WA From libertyHGH@btamail.net.cn Thu Mar 7 02:55:45 2002 From: libertyHGH@btamail.net.cn (libertyHGH@btamail.net.cn) Date: Wed, 6 Mar 2002 18:55:45 -0800 Subject: == Feel & Look 10 Years Younger in 10 Weeks With HGH == 3919139765443333222222 Message-ID: One more bulk email --- aren't you the least bit curious to find out what it's about? Well, call us Toll Free at 1-888-248-4571. OR, read on ............................................... HAVE YOU HEARD OF HUMAN GROWTH HORMONE (HGH)??? (This product works best for people over 35) Released by your own pituitary gland, HGH starts declining in your 20s, even more in your 30s and 40s, eventually resulting in the shrinkage of major organs -- plus, all other symptoms related to old age. IN THOUSANDS OF CLINICAL STUDIES, HGH HAS BEEN SHOWN TO ACCOMPLISH THE FOLLOWING: * Reduce Body Fat and Build Lean Muscle WITHOUT EXERCISE! * Enhance Sexual Performance * Remove Wrinkles and Cellulite * Lower Blood Pressure and Improve Cholesterol Profile * Improve Sleep, Vision and Memory * Restore Hair Color and Growth * Strengthen the Immune System * Increase Energy and Cardiac Output * Turn back your body's Biological Time Clock 10 - 20 years * Live Longer AND Stronger All natural and organic plant based FEEL 10 YEARS YOUNGER WITH ORAL SPRAY HGH. GUARANTEED We are the manufacturer and we sell directly to Doctors, Chiropractors, and consumers world wide the highest grade HGH Oral Spray available. With internet marketing, we are able to save advertising cost and pass those savings along to you. But you must act now. To receive more information call us anytime (24hrs) TOLL FREE 1-888-248-4571 We must speak to you in person to qualify your usage. All of your questions will be addressed and answered in a friendly, no pressure manner. Our main purpose is to provide you with information so you can make an educated decision. For more information call 1-888-248-4571. If you are on line write down our phone number and call us when you can. Soon, you and your loved ones will be very glad you did. Read what people are saying: "The effects of 6 months of GH on lean body mass and fat were equivalent in magnitude to the changes incurred during 10-20 years of aging." Dr. Daniel Rudman, MD, New England Journal of Medicine. "Within four months, my body fat decreased form 30% down to 21%! I noticed my skin is more supple and my overall mental outlook improved significantly." D.W., New Jersey "We have been on the spray for just 3 weeks now, and besides the tremendous energy we both feel, my husbands allergies and spells of depression have lifted. I am healing extremely fast after an accident and have lost 7 lbs. without trying!" C.B., Flagstaff. AZ Thanks for reading our letter, The HGH Staff USA Division PS: The HGH Staff guarantees the highest quality and lowest price. We manufacture and ship directly to your door. Call us now 1-888-248-4571 Offer expires March 30, 2002 *********************************************************** ======= End of message ======== To Qualify for a Free HGH Consultation call the HGH Staff -- Today. *********************************************************** The following statement is provided to be in compliance with commercial email laws. If you do not wish to receive further mailings, please click reply and enter remove in the email subject line then click send. This message is in full compliance with U.S. Federal requirements for commercial email under bill S.1618 Title lll, Section 301, Paragraph (a)(2)(C) passed by the 105th U.S. Congress and is not considered SPAM since it includes a remove mechanism. *********************************************************** This message is not intended for residents in the states of CA, NC, NV, RI, TN, VA & WA. Screening of addresses has been done to the best of our technical ability. *********************************************************** -------------------------------------------------------------------------------- From Rijk J. C. van Haaften" Hello everybody, Although I didn't manage to reproduce the bug with a minimal example, I think it is still important enough to tell you (and especially the Hugs writers and maintainers)=2E Yesterday evening, I tried to add some correct (!) code (by-hand-verifyable; by GHC accepted; just using plain Haskell 98) to one of the projects I'm working on=2E Hugs however said this: Type checking ERROR "TypeInferDecls=2Ehs":102 - Type error in application *** Expression : checkedUnify (snd newTyEnv) inferredHpPtr explicitHpP= tr (\t1 t2 ue -> ([l],ExplicitError n t1 t2 ue)) *** Term : checkedUnify *** Type : NonGenerics -> HpPtr -> HpPtr -> ErrorFunction -> TI = Error () *** Does not match : a -> b -> c -> d -> e *** Because : types do not match I've read this ten times, checked my code looking whether I were doing strange things, but I can only conclude: This is, even without a minimal example, clearly a bug: the types do match=2E Moreover, the bug is reported about a completely different part of the file (relative to the location I edited), in code almost unrelated to the code I added (about line 300)=2E I have explicit types everywhere in that file, so if it were wrong, the error should be reported about line 300=2E So the reporting-place is wrong (but I don't expect Hugs to report good error-placement)=2E Though I didn't manage to write a minimal example, I hope our Hugs experts are able to find the bug soon=2E As a last point: the file is rather big: 726 lines of code, 27KB=2E Rijk-Jan van Haaften From Ralf.Laemmel@cwi.nl Thu Mar 7 09:27:20 2002 From: Ralf.Laemmel@cwi.nl (Ralf Laemmel) Date: Thu, 07 Mar 2002 10:27:20 +0100 Subject: class hierarchies inmature in hugs Message-ID: <3C873278.BF98B97A@cwi.nl> I just saw someone "misusing" haskell@haskell.org for bug reports. I am going to join especially - it is a funny one, - the bug hasn't been fixed since Sep. 2001, - it is not even put in the list of known bugs since then. --------------------------------------------------------------- The following code works with ghc but not with hugs (incl. Dec. 2001 release) import Monad class Monad m => C1 m x -- Monad m is implied by C1 but test diverges if constraint not present class (C1 m x) => C2 m x where c2 :: x -> m x instance Monad m => C1 m Bool instance C2 Maybe Bool where c2 = return test :: Maybe Bool test = c2 True --------------------------------------------------------------- So you see, C1 is a kind of derived from Monad. C2 is derived from C1 and hence implicitly from Monad. This is a kind of minimal example. Just attempt to evaluate "test". hugs will loop. There is a way to help hugs. Add Monad m as a further class constraint to C2. Then it will work. Please note both programs do type check, and this is in fact fine. More generally, I get these looping programs whenever I have non-trivial class hierarchies with three or more layers. I guess more people should have suffered from that? Ralf -- Dr.-Ing. Ralf Laemmel CWI & VU, Amsterdam, The Netherlands http://www.cwi.nl/~ralf/ http://www.cs.vu.nl/~ralf/ From Rijk J. C. van Haaften" Dear all, After intensive investication of several people here at Utrecht University, these are the results 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the current distribution, the problems disappeared Therefore, I suspect there have been one or more bug-fix updates after December 2001, fixing this problem. However, I couldn't find that documented on the Hugs site. Can anyone confirm such an update? Where can I find last- minute distribution information? Thanks, Rijk-Jan From Rijk J. C. van Haaften" Dear all, After intensive investication of several people at Utrecht University, these are the results: 1. The very latest Hugs version doesn't have the bug 2. All before-december-2001 versions don't have the bug I were using a version downloaded some weeks ago. After installing the current distribution, the problems disappeared. Therefore, I suspect there have been one or more bug-fix updates after December 2001, fixing this problem. However, I couldn't find that documented on the Hugs site. Can anyone confirm such an update? Where can I find last-minute distribution information? Thanks, Rijk-Jan From bernhard@cogs.susx.ac.uk Thu Mar 7 12:05:38 2002 From: bernhard@cogs.susx.ac.uk (Bernhard Reus) Date: Thu, 07 Mar 2002 12:05:38 +0000 Subject: type aliases in instances Message-ID: <3C875792.DEB308C3@cogs.susx.ac.uk> In Haskell type aliases are not allowed in instance definitions. Is there a particular reason for this? For example, is there a problem with type inference? I noticed that when composing monads (in the Moggi/Wadler style) one easily ends up with a cascade of coercions enforced by datatype declarations. Looks a bit tedious. This can be avoided by using type aliases but then the monads in use cannot be instances of the Monad class. Phil uses aliases in his "Essence of functional programming" paper too. But not declaring the monads to be in class Monad can hardly be good style, can it? Many thanks for your help in advance. Bernhard --- Bernhard Reus, COGS University of Sussex From doaitse@cs.uu.nl Thu Mar 7 15:54:17 2002 From: doaitse@cs.uu.nl (S. Doaitse Swierstra) Date: Thu, 7 Mar 2002 16:54:17 +0100 Subject: new version of Parser Combinators and Syntax Macros's (beta) Message-ID: --============_-1196606036==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" At: http://www.cs.uu.nl/groups/ST/Software/UU_Parsing you will find the latest/greatest version of our combinators, that are: - faster (faster than Parsec) - correct much faster - compute results lazily, and produce error messages online in the IO monad while parsing (using unsafeInterleavedIO) - are compatible with the syntax macro mechanism we have implemented (beta): http://www.cs.uu.nl/~arthurb/index.html Doaitse -- -- __________________________________________________________________________ S. Doaitse Swierstra, Department of Computer Science, Utrecht University P.O.Box 80.089, 3508 TB UTRECHT, the Netherlands Mail: mailto:doaitse@cs.uu.nl WWW: http://www.cs.uu.nl/ tel: +31 30 253 3962 fax: +31 30 251 3791 mobile: +31 6 2880 1680 __________________________________________________________________________ --============_-1196606036==_ma============ Content-Type: text/html; charset="us-ascii" new version of Parser Combinators and Syntax Macros's
    At:

     http://www.cs.uu.nl/groups/ST/Software/UU_Parsing
    you will find the latest/greatest version of our combinators, that are:

     - faster (faster than Parsec)
     - correct much faster
     - compute results lazily, and produce error messages online in the IO monad while parsing
       (using unsafeInterleavedIO)
     - are compatible with the syntax macro mechanism we have implemented (beta):
       http://www.cs.uu.nl/~arthurb/index.html
    Doaitse
    --

    -- 
    
    __________________________________________________________________________
    S. Doaitse Swierstra, Department of Computer Science, Utrecht University
                          P.O.Box 80.089, 3508 TB UTRECHT,   the Netherlands
                          Mail:  mailto:doaitse@cs.uu.nl          
                          WWW:   http://www.cs.uu.nl/

                          tel:    +31 30 253 3962
                          fax:    +31 30 251 3791
                          mobile: +31 6 2880 1680
    __________________________________________________________________________
    --============_-1196606036==_ma============-- From alimarin@cs.kun.nl Thu Mar 7 16:26:59 2002 From: alimarin@cs.kun.nl (Artem S Alimarine) Date: Thu, 07 Mar 2002 17:26:59 +0100 Subject: rank-n polymorphism Message-ID: <3C8794D3.5D713D23@cs.kun.nl> Dear all, GHC 5.0.3 supports rank-n polymorphism. Could anyone please point me to a paper that describes type inference algorithm used. Thanks in advance Artem Alimarine From moran@galois.com Thu Mar 7 17:03:38 2002 From: moran@galois.com (Andy Moran) Date: Thu, 7 Mar 2002 09:03:38 -0800 Subject: rank-n polymorphism In-Reply-To: <3C8794D3.5D713D23@cs.kun.nl> References: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: <200203071703.g27H3dp02321@galois.com> On Thursday 07 March 2002 08:26 am, you wrote: > Dear all, > > GHC 5.0.3 supports rank-n polymorphism. > Could anyone please point me to a paper that describes type inference > algorithm used. The main paper is "Putting Type Annotations to Work" by Odersky and L"aufer: @InProceedings{Odersky-Laufer96, author = "Martin Odersky and Konstantin L{\"a}ufer", title = "Putting Type Annotations to Work", key = "Odersky \& Laufer", pages = "54--67", booktitle = "Conference Record of POPL '96: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, St. Petersberg Beach, Florida", year = "1996", organization = "ACM", address = "New York, NY", month = jan, annote = "31 references.", } Cheers, Andy -- Andy Moran Ph. (503) 526 3472 Galois Connections Inc. Fax. (503) 350 0833 3875 SW Hall Blvd. http://www.galois.com Beaverton, OR 97005 moran@galois.com From hdaume@ISI.EDU Thu Mar 7 17:11:08 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Thu, 7 Mar 2002 09:11:08 -0800 (PST) Subject: rank-n polymorphism In-Reply-To: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: Someone already sent you the Odersky paper, but in brief, there is no type inference (as it is undecidable). Rank-n polymorphism can only happen via explicit type signatures. My understanding is that if these type signatures are not there, GHC will automatically lift all the foralls to the front in type inference. - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On Thu, 7 Mar 2002, Artem S Alimarine wrote: > Dear all, > > GHC 5.0.3 supports rank-n polymorphism. > Could anyone please point me to a paper that describes type inference > algorithm used. > > Thanks in advance > Artem Alimarine > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From mbs@cse.ogi.edu Thu Mar 7 17:26:39 2002 From: mbs@cse.ogi.edu (Mark B Shields) Date: Thu, 7 Mar 2002 17:26:39 +0000 Subject: rank-n polymorphism In-Reply-To: Msg of Thursday 7-March-2002 09:11:08 -0800 References: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: <15495.41679.150665.300221@mbs.cse.ogi.edu> > > GHC 5.0.3 supports rank-n polymorphism. > > Could anyone please point me to a paper that describes type inference > > algorithm used. > Rank-n polymorphism can only happen via explicit type signatures. SPJ and I are working on a formal description of how all of this works, and should have a manuscript ready in few weeks. Yes: the inference is based on Odersky & Laufer, and yes: the trick is to exploit type annotations. The full system, however, has required quite a few innovations beyond this. Our manuscript also describes how to extend Haskell with first-class existentials, in the style described in our FOOL 9 paper "First-class modules for Haskell." Fun for all the family. Regards, Mark From dianne_yang@yahoo.com Thu Mar 7 22:54:01 2002 From: dianne_yang@yahoo.com (yang dianne) Date: Thu, 7 Mar 2002 14:54:01 -0800 (PST) Subject: Question: Database access in Haskell Message-ID: <20020307225401.82817.qmail@web11702.mail.yahoo.com> Dear Sir/Madam, I am considering implement a system using Haskell. I need to use database to manage data there. How can I access the data records in database from Haskell? Thanks for your advice! Best Regards, Dianne __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ From awfurtado@uol.com.br Fri Mar 8 01:49:00 2002 From: awfurtado@uol.com.br (Andre W B Furtado) Date: Thu, 7 Mar 2002 22:49:00 -0300 Subject: pattern-matching with labelled types Message-ID: <004f01c1c643$77f15e20$d632e3c8@windows9> If I have: > data MyType = MT { > x :: Int, > y :: Char > } How do I update the Int value of MyType leaving the Char value unaffected? I tryied something like: > MT {x = newValue} but GHC gave me a warning about the Char value and it indeed caused strange effects. Of course, it is possible to do something like > update :: MyType -> Int -> MyType > update mt newValue = MT {x = newValue, y = oldValue} > where oldValue = y mt but this really annoys me when MyType has too many fields. Suggestions? Thanks a lot, -- Andre From Tom.Pledger@peace.com Fri Mar 8 01:52:52 2002 From: Tom.Pledger@peace.com (Tom Pledger) Date: Fri, 8 Mar 2002 14:52:52 +1300 Subject: pattern-matching with labelled types In-Reply-To: <004f01c1c643$77f15e20$d632e3c8@windows9> References: <004f01c1c643$77f15e20$d632e3c8@windows9> Message-ID: <15496.6516.434722.555847@waytogo.peace.co.nz> Andre W B Furtado writes: : | Of course, it is possible to do something like | | > update :: MyType -> Int -> MyType | > update mt newValue = MT {x = newValue, y = oldValue} | > where oldValue = y mt | | but this really annoys me when MyType has too many fields. Suggestions? update mt newValue = mt {x = newValue} HTH. Tom From awfurtado@uol.com.br Fri Mar 8 03:52:58 2002 From: awfurtado@uol.com.br (Andre W B Furtado) Date: Fri, 8 Mar 2002 00:52:58 -0300 Subject: labelled types efficiency Message-ID: <000001c1c655$765e5ce0$e733e3c8@windows9> Another question about labelled types, this time concerning about efficiency: is there any efficiency differences between functions f and g below? > data RType = R Int Char > data Stype = S {x :: Int, y :: Char} > > f :: RType -> Int > f (R x _) = x > > g :: SType -> Int > g s = x s Thanks again, -- Andre From uk1o@rz.uni-karlsruhe.de Fri Mar 8 07:14:43 2002 From: uk1o@rz.uni-karlsruhe.de (Hannah Schroeter) Date: Fri, 8 Mar 2002 08:14:43 +0100 Subject: labelled types efficiency In-Reply-To: <000001c1c655$765e5ce0$e733e3c8@windows9> References: <000001c1c655$765e5ce0$e733e3c8@windows9> Message-ID: <20020308071442.GA22049@rz.uni-karlsruhe.de> Hello! On Fri, Mar 08, 2002 at 12:52:58AM -0300, Andre W B Furtado wrote: > Another question about labelled types, this time concerning about > efficiency: is there any efficiency differences between functions f and g > below? > > data RType = R Int Char > > data Stype = S {x :: Int, y :: Char} > > f :: RType -> Int > > f (R x _) = x > > g :: SType -> Int > > g s = x s > Thanks again, > -- Andre In principle, the representation of RType and Stype is the same. The only difference of Stype over RType is the implicit definition of the functions (accessors) x and y, as well as the syntactic sugar for constructing values, pattern matching and functional update using field names. But as said, that's just functional sugar and should be just exactly as efficient as using the manual translation of those constructs on RType. Now, that said, g *looks* a bit more lazy than f, as in f, you don't evaluate the right side if the parameter isn't R _|_ _|_ or more. However, I said *looks*, but if one checkes, it's thus, desugared: f (R x _) = x g s = x s where x (S xElem _yElem) = xElem And if you just evaluate both at _|_, the result is _|_ for both f and g. So in fact, there equally strict. Finally, the code for f and g should, save for renaming, be just the same. Kind regards, Hannah. From ronny@cs.kun.nl Fri Mar 8 09:49:10 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 08 Mar 2002 10:49:10 +0100 Subject: rank-n polymorphism In-Reply-To: <3C8794D3.5D713D23@cs.kun.nl> Message-ID: <5.1.0.14.0.20020308104447.02e19680@localhost> Artem Alimarine asks: >GHC 5.0.3 supports rank-n polymorphism. >Could anyone please point me to a paper that describes type inference >algorithm used. "Putting Type Annotations To Work", Martin Odersky and Konstantin Läufer. In Proceedings, 23rd ACM Symposium on Principles of Programming Languages, St. Petersburg, Florida, January 1996. Available from . Cheers, Ronny Wichers Schreur From simonpj@microsoft.com Fri Mar 8 12:40:41 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 8 Mar 2002 04:40:41 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE19374A47@RED-MSG-10.redmond.corp.microsoft.com> | So I would claim that these two types are the same: |=20 | forall x. Class x =3D> (forall y. Class y =3D> y -> y) -> x -> x | (forall y. Class y =3D> y -> y) -> (forall x. Class x =3D> x -> x) |=20 | ...so you should be able to do this: |=20 | combinator :: (forall y. Class y =3D> y -> y) -> (forall x.=20 | Class x =3D> x -> x) | combinator f x =3D combinator' f x |=20 | but for some reason GHC 5.02.2 complains. I think this is a bug.=20 Indeed the two types are the same. In fact GHC does "forall-lifting" on type signatures to bring the foralls to the front. But there's a bug in 5.02's forall-lifting... it doesn't bring the constraints to the front too. I fixed this in 5.03 a while ago, but didn't back-propagate the fix to=20 5.02. And indeed, 5.03 is happy with the pure rank-2 program. class Class x where combinator' :: (forall y. Class y =3D> y -> y) -> x -> x combinator :: (forall y. Class y =3D> y -> y) -> (forall x. Class x =3D> x -> x) combinator f =3D combinator' f It's quite a bit of extra work propagating fixes into the 5.02 branch, so I probably won't do so for this one, since only a small minority of people will trip over it. Perhaps you can try the 5.03 snapshot release? Simon From simonpj@microsoft.com Fri Mar 8 12:40:43 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 8 Mar 2002 04:40:43 -0800 Subject: rank-n polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE19374A4C@RED-MSG-10.redmond.corp.microsoft.com> This is a multi-part message in MIME format. ------_=_NextPart_001_01C1C69E.767EA3BC Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Mark Shields and I are writing a paper. The technical basis is in "Putting type annotations to work" Odersky/Laufer, POPL'96. Simon | -----Original Message----- | From: Artem S Alimarine [mailto:alimarin@cs.kun.nl]=20 | Sent: 07 March 2002 16:27 | To: haskell@haskell.org | Subject: rank-n polymorphism |=20 |=20 | Dear all, |=20 | GHC 5.0.3 supports rank-n polymorphism. | Could anyone please point me to a paper that describes type=20 | inference algorithm used. |=20 | Thanks in advance | Artem Alimarine |=20 | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |=20 ------_=_NextPart_001_01C1C69E.767EA3BC Content-Type: application/ms-tnef; name="winmail.dat" Content-Transfer-Encoding: base64 eJ8+IiwMAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEEgAEAGAAAAFJFOiByYW5rLW4gcG9seW1v cnBoaXNtAIsIAQWAAwAOAAAA0gcDAAgABAAoACsABQBAAQEggAMADgAAANIHAwAIAAQAKAArAAUA QAEBCYABACEAAAA5M0MwREI3NUFFNjEzOTRCODE1NEQ0Qjc3NTM0RDRBOAAnBwEDkAYAEAgAADMA AAALAAIAAQAAAAMAJgAAAAAAAwAuAAAAAAADADYAAAAAAEAAOQC8o352nsbBAR4APQABAAAABQAA AFJFOiAAAAAAAgFHAAEAAAAyAAAAYz1VUzthPU1DSTtwPW1zZnQ7bD1SRUQtTVNHLTEwLTAyMDMw ODEyNDA0M1otNzYyNQAAAB4AcAABAAAAFAAAAHJhbmstbiBwb2x5bW9ycGhpc20AAgFxAAEAAAAb AAAAAcHF9NEdYPgncoQKT0OGj10Tp+eXIgACiozAAB4AGgwBAAAAEwAAAFNpbW9uIFBleXRvbi1K b25lcwAAHgAdDgEAAAAUAAAAcmFuay1uIHBvbHltb3JwaGlzbQACAQkQAQAAAH8CAAB7AgAADAQA AExaRnWdSqbVAwAKAHJjcGcxMjXiMgNDdGV4BUEBAwH3/wqAAqQD5AcTAoAP8wBQBFY/CFUHshEl DlEDAQIAY2jhCsBzZXQyBgAGwxEl9jMERhO3MBIsETMI7wn3tjsYHw4wNREiDGBjAFDzCwkBZDM2 FlALpgXQCsDKawYAaAiQbGQEIABwmGQgSR2wGCAgdwUQqnQLgGcdsCAKsHAEkOAuICBUaB5ADrAT 0J0DAGMHQAqiCoBiYQCQxwQgIOIDoCJQdQJAHqLMdHkfIB2xbm8BkB6QMwIgBCB0bx5QBbBrIgQg TwSBc2t5L0woYXVmBJAsIFRQT8BQTCc5Ni4gVCBUjlMHcAIgJXp8IC0nYnpPBRBnC4AHQAXQB5Bz WGFnZSdjJuZGA2E62xDBDrBtBgAQwGwHcArAuwuAHkBbAMADECMQOgdAASqEQGNzLmt1bvAubmxd CuMnIgZgAjBZKcAwNxziE9AgAdAwQRRAMTY6Mjcm5lSdK2AgE+Aj4B1wbEAvlYouBbBnLMd1YmoF kKUtcXIAcGstA6BwBvDLBsAFsHAdUHNtJuYzDmxEZQrBB0BsJIUzaEcASEMgNS4wLjPwIHN1cDJA ACAEIDHPvzLRJWUnQAhRHYAdsXkCIP8eQAtQNJAUEDIxC4AFQAeAfyMCHuUfsBPgBUABAATyYr8H kSIDJuYLgCRRCfBjIjGsbGcFsB6AaCogdRQQPmQ4hy7XE+A3cCEjYWR+dgBwPcAm5inkKmczDl/v Q29Ef0VKJuZIL6Q6oCsh8x6iKnBzdEZdMAovgAJAoHA6Ly93SkAuMBk2LysSA4EvR9I9UW8vCy+V Mwx9TbAAHgA1EAEAAABPAAAAPDExMTNEREIyNEQ0QTI4NDE5NTFCRkRGODY2NjVFRTE5Mzc0QTRD QFJFRC1NU0ctMTAucmVkbW9uZC5jb3JwLm1pY3Jvc29mdC5jb20+AAAeAEIQAQAAAB4AAAA8M0M4 Nzk0RDMuNUQ3MTNEMjNAY3Mua3VuLm5sPgAAAAMAgBD/////AwCSEAEAAAAfAPMQAQAAADwAAABS AEUAJQAzAEEAIAByAGEAbgBrAC0AbgAgAHAAbwBsAHkAbQBvAHIAcABoAGkAcwBtAC4ARQBNAEwA AAALAPYQAAAAAEAABzDYB2J2nsbBAUAACDBiaIN2nsbBAQMA3j+fTgAAAwDxPwkEAAAeAPg/AQAA ABMAAABTaW1vbiBQZXl0b24tSm9uZXMAAAIB+T8BAAAAUQAAAAAAAADcp0DIwEIQGrS5CAArL+GC AQAAAAAAAAAvTz1NSUNST1NPRlQvT1U9Tk9SVEhBTUVSSUNBL0NOPVJFQ0lQSUVOVFMvQ049NDI4 NTkyAAAAAB4A+j8BAAAAFQAAAFN5c3RlbSBBZG1pbmlzdHJhdG9yAAAAAAIB+z8BAAAAHgAAAAAA AADcp0DIwEIQGrS5CAArL+GCAQAAAAAAAAAuAAAAAwD9P+QEAAADABlAAAAAAAMAGkAAAAAAHgAw QAEAAAAHAAAANDI4NTkyAAAeADFAAQAAAAcAAAA0Mjg1OTIAAB4AOEABAAAABwAAADQyODU5MgAA HgA5QAEAAAACAAAALgAAAAMACVkBAAAACwBYgQggBgAAAAAAwAAAAAAAAEYAAAAADoUAAAAAAAAD AHCBCCAGAAAAAADAAAAAAAAARgAAAABShQAAEpIBAB4AcYEIIAYAAAAAAMAAAAAAAABGAAAAAFSF AAABAAAABQAAADEwLjAAAAAAAwC4gQggBgAAAAAAwAAAAAAAAEYAAAAAAYUAAAAAAAALAL2BCCAG AAAAAADAAAAAAAAARgAAAAADhQAAAAAAAAMAx4EIIAYAAAAAAMAAAAAAAABGAAAAABCFAAAAAAAA AwDOgQggBgAAAAAAwAAAAAAAAEYAAAAAGIUAAAAAAAALAOOBCCAGAAAAAADAAAAAAAAARgAAAAAG hQAAAAAAAAsA5IEIIAYAAAAAAMAAAAAAAABGAAAAAIKFAAAAAAAACwApAAAAAAALACMAAAAAAAMA BhAAH1CPAwAHENEBAAADABAQAAAAAAMAERABAAAAHgAIEAEAAABlAAAATUFSS1NISUVMRFNBTkRJ QVJFV1JJVElOR0FQQVBFUlRIRVRFQ0hOSUNBTEJBU0lTSVNJTiJQVVRUSU5HVFlQRUFOTk9UQVRJ T05TVE9XT1JLIk9ERVJTS1kvTEFVRkVSLFBPUAAAAAACAX8AAQAAAE8AAAA8MTExM0REQjI0RDRB Mjg0MTk1MUJGREY4NjY2NUVFMTkzNzRBNENAUkVELU1TRy0xMC5yZWRtb25kLmNvcnAubWljcm9z b2Z0LmNvbT4AAPPI ------_=_NextPart_001_01C1C69E.767EA3BC-- From jadrian@mat.uc.pt Fri Mar 8 14:38:29 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Fri, 8 Mar 2002 14:38:29 +0000 Subject: pattern-matching with labelled types In-Reply-To: <15496.6516.434722.555847@waytogo.peace.co.nz> References: <004f01c1c643$77f15e20$d632e3c8@windows9> <15496.6516.434722.555847@waytogo.peace.co.nz> Message-ID: <20020308143940.5C707422233@www.haskell.org> On Friday 08 March 2002 01:52, you wrote: > Andre W B Furtado writes: > | Of course, it is possible to do something like > | > | > update :: MyType -> Int -> MyType > | > update mt newValue = MT {x = newValue, y = oldValue} > | > where oldValue = y mt > | > | but this really annoys me when MyType has too many fields. Suggestions? > > update mt newValue = mt {x = newValue} Since we are on the subject, I have some questions about labeled datatypes updates. You can in deed update like that "mt {x = newValue}", but whenever I use labeled datatypes I always end up with Andres problem, having to define not only an 'update' function but also an 'apply' function for every field. I need them becouse I want to pass them as arguments to other funtions. This happens to me all the time, but one very good example IMO is having a STRef to a labeled data type. Now you want to update some field and you want to to be able to use, modifySTRef (updField1 3) or modifySTRef (appField1 (+1)) It would be extremely usefull IMO to have not only field projection funtions, but also apply and update funtions. That, and not beeing possible to specify contexts partialy, makes it particulary complicated for me to follow John Hughes strategy to simulate global variables in haskell (http://www.cs.chalmers.se/~rjmh/Globals.ps) J.A. From marco.comini@inwind.it Fri Mar 8 15:18:53 2002 From: marco.comini@inwind.it (Marco Comini) Date: Fri, 8 Mar 2002 16:18:53 +0100 Subject: [E-CFP] WFLP2002 - deadline is approaching Message-ID: --============_-1196521757==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Dear Colleague I would like to remind you that the WFLP 2002 paper submission deadline is approaching. WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming. WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration. For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/ Papers are due by March 20, 2002 You can sumbit papers following the electronic sumbission process at: http://www.dimi.uniud.it/~wflp2002/submit/ We hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. -- Marco. --============_-1196521757==_ma============ Content-Type: text/html; charset="us-ascii" [E-CFP] WFLP2002 - deadline is approaching
    Dear Colleague
    I would like to remind you that the WFLP 2002 paper submission deadline is
    approaching.  WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming.  WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration.  For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/

    Papers are due by March 20, 2002

    You can sumbit papers following the electronic sumbission process at:
    http://www.dimi.uniud.it/~wflp2002/submit/

    We hope  that this  "Call For  Papers" will be  useful for  your work.
    Please  forward  the  following  to  anybody  who  you  think  may  be
    interested.  Our apologies if you received multiple copy of this.
    -- 
    
    Marco.
    --============_-1196521757==_ma============-- From Ralf.Laemmel@cwi.nl Fri Mar 8 19:23:07 2002 From: Ralf.Laemmel@cwi.nl (Ralf.Laemmel@cwi.nl) Date: Fri, 8 Mar 2002 20:23:07 +0100 (MET) Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: Simon Peyton-Jones wrote: > In fact GHC does "forall-lifting" on type signatures to bring the > foralls to the front. But there's a bug in 5.02's forall-lifting... > ... > Perhaps you can try the 5.03 snapshot release? Certain things work there. In fact, it is fascinating. But now I did a new experiment ... It seems that forall-lifting does not work as expected for type synonyms in 5.03. Here is an example from my upcoming ICFP submission :-) Here is an innocent type synonym for generic functions with three parameters of kind * -> *: type Generic i o m = forall x. i x -> m (o x) This is a good candidate for all the parameters: type Id x = x Now I tried to define sequential composition. In fact, the following type deals with a very restricted case for simplicity: sequ :: forall t. (Generic t t Id) -> (Generic t t Id) -> (Generic t t Id) sequ f g = undefined Looking at the type of sequ, the foralls for t end up at the top. Hence, I have no chance to define sequential composition. Main> :t sequ forall t x1 x11 x. (t x1 -> Id (t x1)) -> (t x11 -> Id (t x11)) -> t x -> Id (t x) Main> Please let me know if this is a bug. Please don't fix it too soon :-) because otherwise I had to rewrite some material which is now based on first-class polymorphism and datatypes for i, o, and m. Such code will probably look better in proper rank-2 style with type synonyms for type constructor parameters. I just realized that type synonyms in GHC seem to be valid arguments even when not completely instantiated? This is wonderful. It is not supported in hugs. How difficult is it to cope with this? Does it make a real difference for the type system? Ralf From hdaume@ISI.EDU Fri Mar 8 20:26:20 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Fri, 8 Mar 2002 12:26:20 -0800 (PST) Subject: HGL ang GHC on Win32 Message-ID: When I compile a program using GHC 5.02.2 on Windows 200 using HGL, using the following command line: > ghc --make HelloWorld.hs -o HelloWorld.exe -package concurrent -package win32 -ic:\GraphicsLibrary\lib\win32 it compiles fine, but then when I run the exe, the window starts out initially as wide as my screen and only as tall as the title bar, regardless of what is passed as the dimensions to openWindow. What gives? If I resize the window everything works fine, but in my own application resizing the window causes it to report some error about arithmetic being bigger than 32 bits... Any ideas? - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume From mlsl99@yahoo.com Sat Mar 9 05:11:19 2002 From: mlsl99@yahoo.com (mary lee) Date: Fri, 8 Mar 2002 21:11:19 -0800 (PST) Subject: College Student Message-ID: <20020309051119.86835.qmail@web14708.mail.yahoo.com> To : Mr. Frank A. Chrishtoph I am recently doing my assignment on Haskell at my college. I am just new on Haskell programming. I would like to request if you can teach me for just few programming rules on Haskell. It is my most appreciation to learn from you. My assignment title is INTERNATIONAL AIRLINES SYSTEM. May i know how to open file, put record entry and just read it from its database. How to do a simple input and output for acquire user options using functional programming. It is very important for me to learn Haskell in a proper way. It will lead me to write a good documentation. A good understanding on programming is good. I am good in Visual Basic, Pascal, Cobol, C++ and also JAVA. But facing functional programming is a real problem for me. Now i have doing a simple Haskell programming on the way. I just know how to import file, declare types and display output. Your help and guidelines is most appreciated. From, Lee Ling Ling __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ From antony.blakey@ihug.com.au Sat Mar 9 13:14:22 2002 From: antony.blakey@ihug.com.au (Antony Blakey) Date: Sat, 09 Mar 2002 23:44:22 +1030 Subject: Concurrent Haskell (GHC) and Win32 Applications ? Message-ID: <3C8A0AAE.90606@ihug.com.au> Hi, I'm experimenting with GHC as a platform for writing a Win32 GUI application, and I've hit what I think is a brick wall. The problem I think is with the lightweight thread implementation - Win32 calls can (and will) block the OS thread that makes the call, which blocks the entire system. Given that I'm wanting to write a network server with a Win32 GUI, this is obviously a Bad Thing. So, does any know if I missing some vital piece of information? I am using the following reduced test case, which I don't think is clueless. import Win32 import Concurrent endless:: Char -> IO () endless c = do { putChar c; endless c } main = do { task1; task2; endless 'b' } where task1 = forkIO ( do { messageBox nullHANDLE "Hey" "Yeah" mB_OK; return () } ) task2 = forkIO ( endless 'a' ) It does intersperse the 'a' and 'b' output nicely, but stops while the message box is on the screen. I'm not keen on writing a seperate GUI management thread in C++ and linking - the point is to do all of this in Haskell and write an application indistinguishable from a C++ GUI app e.g. imagine Simon Peyton Jones' sample webserver with a realtime GUI monitor. Thanks in advance for any pointers! From d99josve@dtek.chalmers.se Sat Mar 9 14:50:38 2002 From: d99josve@dtek.chalmers.se (Jonas Svensson) Date: Sat, 9 Mar 2002 15:50:38 +0100 Subject: Concurrent Haskell (GHC) and Win32 Applications ? In-Reply-To: <3C8A0AAE.90606@ihug.com.au> References: <3C8A0AAE.90606@ihug.com.au> Message-ID: <20020309145037.GA22195@korillov.dtek.chalmers.se> Sat, Mar 09, 2002 at 11:44:22PM +1030, Antony Blakey -> > Hi, > I'm experimenting with GHC as a platform for writing a Win32 GUI > application, and I've hit what I think is a brick wall. > > The problem I think is with the lightweight thread implementation - > Win32 calls can (and will) block the OS thread that makes the call, > which blocks the entire system. Given that I'm wanting to write a > network server with a Win32 GUI, this is obviously a Bad Thing. While I haven't used GHC with the Win32 GUI I've had a similar problem with the gtk+hs bindings. See the ``concurrent haskell'' thread in: http://haskell.org/pipermail/gtkhs/2002-February/thread.html Basically, make sure that a Haskell function is called once in a while (for example add it as a timer callback) and make this function call yeild. I'm not sure the Win32 API works the same way but it might be worth a try. /jonas -- %http://www.dtek.chalmers.se/~d99josve/ - d99josve@dtek.chalmers.se From jerry@gime.com Sat Mar 9 15:01:21 2002 From: jerry@gime.com (Jerry, JiJie) Date: Sat, 9 Mar 2002 23:01:21 +0800 Subject: Debugging Haskell Message-ID: <20020309230121.A6070@ghost.gime.com> --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Good day everyone, I was fiddling around with this tiny echo client/server haskell program from 'The Great Language Shootout' site (http://www.bagley.org/~doug/shootout/) and got stuck. The code (attached) has been reformatted with minimal API tweak (mkPortNumber, writeSocket, readSocket) to please my ghc-5.02.2, and all what I get is something stuck forever after the first iteration: $ ./echo 3 Client wrote: Hello there sailor Server recv: Hello there sailor Server read: Hello there sailor Server wrote: Hello there sailor After adding all these print statement, I still don't have a clue what's jammed there. Hope someone here can shred some light. BTW, I'd also like to take this chance to ask how to debug a haskell program in general? Regards, Jerry --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="echo.hs" -- $Id: echo.ghc,v 1.2 2001/05/01 20:19:52 doug Exp $ -- http://www.bagley.org/~doug/shootout/ -- Haskell echo/client server -- written by Brian Gregor -- compile with: -- ghc -O -o echo -package net -package concurrent -package lang echo.hs module Main where import SocketPrim import Concurrent import System (getArgs,exitFailure) import Exception(finally) import MVar server_sock :: IO (Socket) server_sock = do s <- socket AF_INET Stream 6 setSocketOption s ReuseAddr 1 -- bindSocket s (SockAddrInet (mkPortNumber portnum) iNADDR_ANY) bindSocket s (SockAddrInet (PortNum portnum) iNADDR_ANY) listen s 2 return s echo_server s = do (s', clientAddr) <- accept s proc <- read_data s' 0 putStrLn ("server processed "++(show proc)++" bytes") sClose s' where read_data sock totalbytes = do -- (str,i) <- readSocket sock 19 str <- recv sock 19 -- if (i >= 19) putStr ("Server recv: " ++ str) if ((length str) >= 19) then do putStr ("Server read: " ++ str) -- writ <- writeSocket sock str writ <- send sock str putStr ("Server wrote: " ++ str) -- read_data sock $! (totalbytes+(length $! str)) -- read_data sock (totalbytes+(length str)) else do putStr ("server read: " ++ str) return totalbytes local = "127.0.0.1" message = "Hello there sailor\n" portnum = 7001 client_sock = do s <- socket AF_INET Stream 6 ia <- inet_addr local -- connect s (SockAddrInet (mkPortNumber portnum) ia) connect s (SockAddrInet (PortNum portnum) ia) return s echo_client n = do s <- client_sock drop <- server_echo s n sClose s where server_echo sock n = if n > 0 then do -- writeSocket sock message send sock message putStr ("Client wrote: " ++ message) -- -- (str,i) <- readSocket sock 19 str <- recv sock 19 if (str /= message) then do putStr ("Client read error: " ++ str ++ "\n") exitFailure else do putStr ("Client read success") server_echo sock (n-1) else do putStr "Client read nil\n" return [] main = do ~[n] <- getArgs -- server & client semaphores -- get the server socket ssock <- server_sock -- fork off the server s <- myForkIO (echo_server ssock) -- fork off the client c <- myForkIO (echo_client (read n::Int)) -- let 'em run until they've signaled they're done join s putStr("join s") join c putStr("join c") -- these are used to make the main thread wait until -- the child threads have exited myForkIO :: IO () -> IO (MVar ()) myForkIO io = do mvar <- newEmptyMVar forkIO (io `finally` putMVar mvar ()) return mvar join :: MVar () -> IO () join mvar = readMVar mvar --wRRV7LY7NUeQGEoC-- From gramlich@logic.at Sat Mar 9 18:43:08 2002 From: gramlich@logic.at (Bernhard Gramlich) Date: Sat, 9 Mar 2002 19:43:08 +0100 Subject: 2nd CfP: WRS'02 - 2nd WS on Reduction Strategies in Rewriting and Programming Message-ID: <200203091843.g29Ih8l19182@church.logic.tuwien.ac.at> [Apologies for multiple copies of this announcement] ************************************************************************** **************** 2nd call for papers and participation ***************** ************************************************************************** Second International Workshop on Reduction Strategies in Rewriting and Programming (WRS 2002) http://www.dsic.upv.es/users/elp/WRS2002 affiliated with RTA 2002, held as part of FLoC 2002 Copenhagen, Denmark, July 21, 2002 -------------------------------------------------------------------------- BACKGROUND AND AIMS Reduction strategies in rewriting and programming have attracted an increasing attention within the last years. New types of reduction strategies have been invented and investigated, and new results on rewriting / computation under particular strategies have been obtained. Research in this field ranges from primarily theoretical questions about reduction strategies to very practical application and implementation issues. The need for a deeper understanding of reduction strategies in rewriting and programming, both in theory and practice, is obvious, since they bridge the gap between unrestricted general rewriting (computation) and (more deterministic) rewriting with particular strategies (programming). Moreover, reduction strategies provide a natural way to go from operational principles (e.g., graph and term rewriting, narrowing, lambda-calculus) and semantics (e.g., normalization, computation of values, infinitary normalization, head-normalization) to implementations of programming languages. Therefore any progress in this area is likely to be of interest not only to the rewriting community, but also to neighbouring fields like functional programming, functional-logic programming, and termination proofs of algorithms. The workshop wants to provide a forum for the presentation and discussion of new ideas and results, recent developments, new research directions, as well as of surveys on existing knowledge in this area. Furthermore we aim at fostering interaction and exchange between researchers and students actively working on such topics. The workshop will be held in conjunction with RTA 2002 in Copenhagen (Denmark) on July 21, 2002. The workshop is (co-)organized by TU Valencia and TU Wien. TOPICS OF INTEREST Topics of interest include, but are not restricted to: - theoretical foundations for the definition and semantic description of reduction strategies - strategies in different frameworks (term rewriting, graph rewriting, infinitary rewriting, lambda calculi, higher order rewriting and explicit substitutions, conditional rewriting, rewriting with built-ins, narrowing, constraint solving, etc.) and their application in (equational, functional, functional-logic) programming (languages) - properties of reduction strategies / computations under strategies (e.g., completeness, computability, decidability, complexity, optimality, (hyper-)normalization, cofinality, fairness, perpetuality, context-freeness, neededness, laziness, eagerness, strictness) - interrelations, combinations and applications of reduction under different strategies (e.g., equivalence conditions for fundamental properties like termination and confluence, applications in modularity analysis, connections between strategies of different frameworks, etc.) - program analysis and other semantics-based optimization techniques dealing with reduction strategies - rewrite systems / tools / implementations with flexible / programmable strategies as essential concept / ingredient - specification of reduction strategies in (real) languages - data structures and implementation techniques for reduction strategies. SUBMISSIONS We solicit papers on all aspects of reduction strategies in rewriting and programming. Submissions should describe unpublished work, except for survey papers which are explicitly welcome, too. Submissions should not exceed 10 pages (however, survey papers may be longer) and be sent in postscript format to the PC co-chairs at wrs02@dsic.upv.es before April 15, 2002. Submissions should include the title, authors' names, affiliations, addresses, and e-mail. Selection of papers by the PC will be based on originality, significance, and correctness. Final versions will be due by June 17, 2002. PUBLICATION The final workshop proceedings will be published in the Electronic Notes in Theoretical Computer Science (ENTCS) series of Elsevier. Preliminary hardcopy proceedings will be available at the workshop. A special issue of the Journal of Symbolic Computation (JSC) on Reduction Strategies in Rewriting and Programming will be designated for revised and extended versions of selected contributions from both WRS 2001 (Utrecht, May 2001) and WRS 2002. PROGRAM COMMITTEE Sergio Antoy Portland (USA) Roberto Di Cosmo Paris VII (France) Bernhard Gramlich (co-chair) Wien (Austria) Michael Hanus Kiel (Germany) Claude Kirchner Nancy (France) Paul Klint CWI Amsterdam (The Netherlands) Salvador Lucas (co-chair) Valencia (Spain) Manfred Schmidt-Schauss Frankfurt am Main (Germany) Yoshihito Toyama Tohoku (Japan) ORGANIZERS Bernhard Gramlich (co-chair) Technische Universitaet Wien Salvador Lucas (co-chair) Universidad Politecnica de Valencia INVITED TALKS (with tentative titles) Aart Middeldorp, Tsukuba (Japan): Strategies for Term Rewriting Vincent van Oostrom, Utrecht (The Netherlands): Optimal Strategies in Higher-Order Rewriting IMPORTANT DATES Deadline for submissions: April 15, 2002 Notification: May 27, 2002 Final versions due: June 17, 2002 Workshop: July 21, 2002 FURTHER INFORMATION WRS 2002 website: http://www.dsic.upv.es/users/elp/WRS2002 WRS 2002 e-mail address: wrs02@dsic.upv.es RTA 2002 website: http://www.ericsson.com/cslab/rta2002/ FLoC 2002 website: http://floc02.diku.dk WRS 2002 website at FLoC: http://floc02.diku.dk/WRS ************************************************************************** From ru@river.org Sat Mar 9 20:57:07 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sat, 09 Mar 2002 12:57:07 -0800 Subject: type aliases in instances In-Reply-To: <3C875792.DEB308C3@cogs.susx.ac.uk> References: <3C875792.DEB308C3@cogs.susx.ac.uk> Message-ID: I do not have experience commposing monads (maybe John Hughes can chime in?), but I'll address where Bernhard Reus writes: >This can be avoided by using type >aliases but then the monads in use cannot be instances of the Monad >class. >But not declaring the monads to be in class Monad can hardly >be good style, can it? GHC's source code defines many monads not in class Monad. I'll write some untested code to give an idea of the naming conventions used: type FooMd out = (a,b,c)->((a,b,c),out) returnFooMd out = \s0->out thenFooMd p k = \s0->let (s,out) = p s0 in k out s method1FooMd ... = ... method2FooMd ... = ... the biggest disadvantage is that you cannot use the do notation but rather have to write, eg, method1FooMd x y `thenFooMd` (\result1-> method2FooMd z result1 `thenFooMd` (\result2-> ... of course, you also cannot use liftM and other library functions with (Monad m)=> in their signature, but I do not mind that so much as loss of the do notation. -- Richard Uhtenwoldt From tccuong72@yahoo.com Sat Mar 9 15:49:53 2002 From: tccuong72@yahoo.com (To Chieu Cuong) Date: Sat, 9 Mar 2002 22:49:53 +0700 Subject: scholarship information Message-ID: <002e01c1c7c2$94728300$e18da2cb@vnn1269> Dear Sir or Madam, I'm working at Department of Engineering Mechanics, Ho Chi Minh city University of Technology, Viet Nam as a teaching assistant. I have a M.E. of Civil Engineering and a B.S. of Computer Science. I'm looking for a scholarship. Would you please send me scholarship information of your university? I look forward to hearing from you. With best regards, Cuong. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com From doaks@thecottagemonitor.com Sun Mar 10 05:30:36 2002 From: doaks@thecottagemonitor.com (Doak Serrels) Date: Sun, 10 Mar 2002 00:30:36 -0500 Subject: Protect your vacation home against winter freeze for less than 30 cents a day! Message-ID: The

     

     The

     Cottage

     Monitor

     

     

     

     

    CONTROL AND MONITOR THE

    TEMPERATURE IN YOUR

    VACATION HOME, 24 HOURS

    A DAY VIA A TOLL FREE

    TELEPHONE LINE!

     

     


    Visit our web page in your location for further

    information

     

    CALIFORNIA  COLORADO  MICHIGAN 

    MINNESOTA  NEW YORK 

      UTAH 

     

    800.549.9276

    info@thecottagemonitor.com

     

     

    From igloo@earth.li Sun Mar 10 15:22:40 2002 From: igloo@earth.li (Ian Lynagh) Date: Sun, 10 Mar 2002 15:22:40 +0000 Subject: Layout indentation marking Message-ID: <20020310152240.GA11906@stu163.keble.ox.ac.uk> Given this module module Main where main :: IO() main = putStrLn $ show $ foo foo :: Int foo = x + y where x = 6 s = "foo\ \bar" y = 7 nhc98 and hugs correctly (as per the revised report) print 13. ghc gives q.lhs:11: parse error on input `=' I think ghc is in the right here and the report should be updated to read + Where the start of a lexeme does not follow the end of a lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) (it currently reads + Where the start of a lexeme does not follow a complete lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) where I have altered only the first line). Thanks Ian From post@volker-wysk.de Sun Mar 10 15:48:52 2002 From: post@volker-wysk.de (Volker Wysk) Date: Sun, 10 Mar 2002 16:48:52 +0100 (CET) Subject: Bug in IO libraries when sending data through a pipe? Message-ID: Hello There seems to be a bug in the IO libraries. I'm using the following procedure to call an external program and send it data through a pipe. pipeto :: String -> String -> [String] -> IO () pipeto txt prog par = do catch (do -- create pipe (zu, von) <- createPipe vonh <- fdToHandle von hSetBuffering vonh NoBuffering mpid <- forkProcess case mpid of Nothing -> do -- child -- connect pipe's read end to stdin -- and close its write end dupTo zu (intToFd 0) fdClose zu hClose vonh executeFile prog True par Nothing ... -- (print error message) Just pid -> do -- parent fdClose zu -- close pipe's read end -- ** here ** hPutStr vonh txt -- write text to forked process hClose vonh -- close pipe's write end -- wait for child process to finish (Just ps) <- getProcessStatus True True pid if ps == Exited ExitSuccess then return () else ...) -- (error message) (\err -> ...) -- print error message The problem is that the child process doesn't receive all the data which the parent sends. It's as if "hPutStr vonh txt" sends the data lazily somehow, and "hClose vonh" closes the pipe prematurely. It varies from run to run exactly which data gets through. If I cause the child process to read all its input immediately, the problem doesn't seem to occur. Normally, it does so gradually, which takes a few seconds. I'm using GHC 5.02.2 Volker From petersen@redhat.com Mon Mar 11 01:59:30 2002 From: petersen@redhat.com (Jens Petersen) Date: 11 Mar 2002 10:59:30 +0900 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: References: Message-ID: Volker Wysk writes: > (zu, von) <- createPipe > vonh <- fdToHandle von > hSetBuffering vonh NoBuffering > mpid <- forkProcess > case mpid of > Nothing -> do -- child > -- connect pipe's read end to stdin > -- and close its write end > dupTo zu (intToFd 0) > fdClose zu > hClose vonh > executeFile prog True par Nothing > ... -- (print error message) > Just pid -> do -- parent > fdClose zu -- close pipe's read end > -- ** here ** > hPutStr vonh txt -- write text to forked process > hClose vonh -- close pipe's write end > -- wait for child process to finish > (Just ps) <- getProcessStatus True True pid > if ps == Exited ExitSuccess > then return () > else ...) -- (error message) > > The problem is that the child process doesn't receive all the data which > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > somehow, and "hClose vonh" closes the pipe prematurely. > > It varies from run to run exactly which data gets through. If I cause the > child process to read all its input immediately, the problem doesn't > seem to occur. Normally, it does so gradually, which takes a few seconds. > > I'm using GHC 5.02.2 Quite possibly could be a bug. Lazy IO is rather subtle I think, specially when done across pipes. I faced some similar problem with in POpen recently. You can see how I solved it (worked round it?) by comparing the latest release 1.00 with the previous one 0.00.1: http://www.01.246.ne.jp/~juhp/haskell/popenhs/ In comparison Posix.runProcess allows attaching file handles to the in, out and error pipes, which can be written to and read from eagerly I suppose. Jens From jyrinx_list@mindspring.com Mon Mar 11 02:36:01 2002 From: jyrinx_list@mindspring.com (Jyrinx) Date: 10 Mar 2002 18:36:01 -0800 Subject: Isn't this tail recursive? Message-ID: <1015814162.18982.12.camel@kryptonitespoon.maurers> For practice, I'm playing with reimplementing the solution to the word count problem on the Great Computer Language Shootout (www.bagley.org/~doug/shootout). My current solution looks tail recursive to me: --- snip --- -- wc-luke.hs -- Reimplimentation of the Haskell word count program for the Great -- Computer Language Shootout -- Luke Maurer -- jyrinx@mindspring.com module Main where import IO data CharKind = Normal | White | Newline charKind :: Char -> CharKind charKind c = case c of '\n' -> Newline ' ' -> White '\t' -> White _ -> Normal countAll :: String -> (Int, Int, Int) countAll str = countAll' str 0 0 0 0 where countAll' [] _ nl nw nc = (nl, nw, nc) countAll' (c:cs) newWord nl nw nc = case charKind c of -- The following should all be tail calls ... right? Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) White -> countAll' cs 1 nl nw (nc + 1) Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) main = do -- We need a 4K buffer, as per the rules hSetBuffering stdin (BlockBuffering (Just 4096)) file <- getContents let (l, w, c) = countAll file putStrLn ((show l) ++ " " ++ (show w) ++ " " ++ (show c)) --- snip --- In the case expression at the end of countAll, each of the values looks to me like a recursive tail call - I should think (hope?) that it would be optimized by GHC into a goto statement (a la Scheme). Instead, my program eats up memory (I've got 256 MB) until the RTS whines about a stack overflow. Am I wrong about the tail call? Is there some optimization I should be aware of (I'm compiling with -O2)? Is this a flaw in GHC? (BTW, as a beginner, I'd be glad to hear general commentary on my code ...) Thanks! Jyrinx jyrinx_list at mindspring dot com From hdaume@ISI.EDU Mon Mar 11 02:38:54 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Sun, 10 Mar 2002 18:38:54 -0800 (PST) Subject: Isn't this tail recursive? In-Reply-To: <1015814162.18982.12.camel@kryptonitespoon.maurers> Message-ID: I don't think it's an issue of it being a tail call; i think it's just too lazy. > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > White -> countAll' cs 1 nl nw (nc + 1) > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) make this something like ... Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' White -> nc' `seq` countAll' cs 1 nl nw nc' Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' where nw' = nw + newWord nc' = nc + 1 nl' = nl + 1 ... or something. I'm not entirely sure but it's worth a shot. - Hal From sqrtofone@yahoo.com Mon Mar 11 05:28:10 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Sun, 10 Mar 2002 23:28:10 -0600 (CST) Subject: Isn't this tail recursive? In-Reply-To: <1015814162.18982.12.camel@kryptonitespoon.maurers> Message-ID: On 10 Mar 2002, Jyrinx wrote: > In the case expression at the end of countAll, each of the values looks > to me like a recursive tail call - I should think (hope?) that it would > be optimized by GHC into a goto statement (a la Scheme). Instead, my > program eats up memory (I've got 256 MB) until the RTS whines about a > stack overflow. It is tail recusive. unfortunately, that's not the problem. apparently ghc is not smart enough to realize that countAll' should really be strict in basically all arguments. (hell, I'm not quite sure I can claim to be smart enough to say that!) One way you could fix it up would be to do as Hal did and sprinkle seq and/or $! throughout your code. That would have been my solution as well, but I then realized this happens just too often to have been ignored by the haskell literati. I decided to muck around in the haskell manual and I think I may have found another way. Never fear, -fall-strict is here! Anyway compiling with that ghc option seams to make the problem go away. I just ran your code compiled with it over a 47M file and the heap size hits a max of 16 and stays constant throughout execution. I wish I knew more about what -fall-strict really means. The ghc 5.00 manual hardly explains it. It doesn't have the semantics I would have thought it should have. for instance: main = print foo where foo = let a = error "do I happen?" b = 3 in "foo" ++ show b I would have thought that the execution of that code compiled with the all-strict flag would have raised the error. a strict language would do that, right? Perhaps it is something to do purely with function application. I dont know. Anyway, I guess a fix would be to put in a pragma into your code to quote Malcolm Wallace >ghc and nhc98 already support this. ghc's mechanism is > {-# OPTIONS -fglasgow-exts ... etc #-} >at the top of the file - but there are quite a few restrictions on >what flags are accepted in that pragma. nhc98's mechanism is > {-# OPTIONS_COMPILE -nkpat ... etc #-} >anywhere in the file, which has no restrictions on the options it >accepts - you can use anything that can appear on the commandline. o just maybe you could exchange -fall-strict for -fglasgow-exts and pray to the haskell gods that it happens to be an acceptable option? Jay Cox From simonpj@microsoft.com Mon Mar 11 10:46:55 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 02:46:55 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE19374A69@RED-MSG-10.redmond.corp.microsoft.com> | Looking at the type of sequ, | the foralls for t end up at the top. | Hence, I have no chance to define sequential | composition. Indeed the foralls are at the top, but I claim that wherever you could use the composition function you were expecting, you can also use the one GHC gives you. The two types are isomorphic. Let me know if you find a situation where this isn't true. | Please let me know if this is a bug. No I believe it is not a bug. I would be interested to see why you needed to change your code. | I just realized that type synonyms in GHC seem to be valid=20 | arguments even when not completely instantiated? This is=20 | wonderful. It is not supported in hugs. How difficult is it=20 | to cope with this? Does it make a real difference for the type system? No, GHC does not support partially applied type synonyms,=20 except in the RHS of other type synonyms. It is a VERY BIG thing to allow this, because it amounts to allowing lambdas at the type level and that messes up inference cruelly. Why do you think GHC does? Simon From PPDP-2002@loria.fr Mon Mar 11 11:12:38 2002 From: PPDP-2002@loria.fr (Claude Kirchner) Date: Mon, 11 Mar 2002 12:12:38 +0100 (MET) Subject: PPDP 2002 - Last call for papers --> March 21 Message-ID: <15500.37158.135931.845369@apach.loria.fr> PPDP 2002 - Call for papers March 21, 2002 submission deadline http://ppdp2002.cs.brown.edu Fourth International Conference on Principles and Practice of Declarative Programming 6-8 October, Pittsburgh, USA as part of PLI 2002 (http://pli2002.cs.brown.edu) *** The electronic submission system is open at *** http://ppdp-2002.loria.fr/ Invited speakers: Neil Jones (University of Copenhagen) Catuscia Palamidessi (The Pennsylvania State University) Janos Sztipanovits (Vanderbilt University ) Important dates March 21, 2002 submission FIRM deadline May 30, 2002 acceptance decisions June 30, 2002 Camera-ready copies October 6-8, 2002 Conference Submission web site: http://ppdp-2002.loria.fr Conference Chair: Frank Pfenning, CMU, USA Program Chair: Claude Kirchner, LORIA and INRIA 615, rue du Jardin Botanique, BP 101 54602 Villers-lès-Nancy, France Claude.Kirchner@loria.fr Program Committee: Hassan Ait Kaci: ILOG, France Olivier Danvy: BRICS, University of Aarhus, Denmark Mariangiola Dezani: Universita di Torino, Italy Francois Fages: INRIA, France Fergus Henderson: The University of Melbourne, Australia Manuel Hermenegildo: University of Madrid, Spain Andrew Gordon: Microsoft Research, UK Amy Felty: University of Ottawa, Canada Claude Kirchner: LORIA & INRIA, France Paul Klint: CWI, The Netherlands Michael Maher: Griffith University, Australia and Loyola University Chicago, USA Dale Miller: The Pennsylvania State University, USA Roberto Nieuwenhuis: University of Barcelona, Spain Frank Pfenning: CMU, USA Francesca Rossi: University of Padova, Italy Scope of the Conference PPDP aims to stimulate research on the use of declarative methods in programming and on the design, implementation and application of programming languages that support such methods. Topics of interest include any aspect related to understanding, integrating and extending programming paradigms such as those for logic, functional, constraint, probabilistic, rule and object-oriented programming; concurrent extensions and mobile computing; type theory; support for modularity; use of logical methods in the design of program development tools; program analysis and verification; abstract interpretation; development of implementation methods; application of the relevant paradigms and associated methods in industry and education. This list is not exhaustive: submissions related to new and interesting ideas relating broadly to declarative programming are encouraged. The technical program of the conference will combine presentations of the accepted papers and system descriptions with invited talks and advanced tutorials. Previous PPDP meetings were held in Paris (1999), Montreal (2000), Firenze (2001). Topics of Interest Logic and Constraint Programming; Rule Programming; Object-Oriented Programming; Concurrent Programming; Mobile Computing; Specification Languages and Methods; Type and Module Systems; Program Logics and Verification; Program Analysis and Transformation; Abstract Machines and Compilation Methods; Parallel and Distributed Implementations; Programming Environments; Applications of Declarative Programming; Implementation Techniques; Logical and Semantical Aspects of Declarative Programming; Declarative and probabilistic programming. Paper Submissions Submissions must be received on or before March 21, 2002 (this is a HARD deadline) and must describe original, previously unpublished work that has not been simultaneously submitted for publication elsewhere. They must be written in English and, in case the work is accepted for presentation and publication, one of the author must attend the conference to present it. Submissions must contain a clearly delineated part intended for the proceedings not exceeding 12 pages and 9 pt (for a full description see the ACM conference format at http://www.acm.org/sigplan/conferences/author-info) and must have a cover page with an abstract of up to 200 words, keywords, postal and electronic mailing addresses, and phone and fax numbers of the corresponding author. Additional material for possible consideration by reviewers may be included in the form of appendices. Submitted papers can be either: Regular papers that will be judged in particular on originality, correctness and significance, or System descriptions that will be judged in particular on usefulness and design, originality of system design, implementation or application. They must contain a link to a working system. All submissions are to be electronic unless specifically approved by the Program Chair. Submissions in PostScript or PDF formats should be submitted via the conference management system as described on the web site. Authors will be notified of acceptance decisions by May 30, 2002 Camera-ready copies of the accepted papers must be received by June 30, 2002. Proceedings will be published by ACM Press. Authors of accepted papers will be required to sign the ACM copyright form, which will be made accessible from this site. Conference Venue and Related Events PPDP 2002 is part of a federation of colloquia known as Principles, Logics and Implementations of high-level programming languages (PLI 2002) which includes the ACM SIGPLAN International Conference on Functional Programming (ICFP 2002) and the first ACM SIGPLAN Conference on Generators and Components (GCSE/SAIG'02) . The colloquia and affiliated workshops will run from October 4 to October 8, 2002 and will be held in Pittsburgh, USA. Details about the affiliated conferences and workshops will appear at the URL http://pli2002.cs.brown.edu/. Sponsorship PPDP 2002 is sponsored by ACM SIGPLAN. ---------------------------------------------------------------- From simonpj@microsoft.com Mon Mar 11 11:49:23 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 03:49:23 -0800 Subject: Concurrent Haskell (GHC) and Win32 Applications ? Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041ABE@RED-MSG-10.redmond.corp.microsoft.com> | The problem I think is with the lightweight thread implementation -=20 | Win32 calls can (and will) block the OS thread that makes the call,=20 | which blocks the entire system. Given that I'm wanting to write a=20 | network server with a Win32 GUI, this is obviously a Bad Thing. Yes, that's true at the moment, but it's something that we expect to fix shortly. More precisely, Sigbjorn has been working on a=20 fix. It relies on using an OS thread to make a potentially-blocking call, so it's a robust fix. =20 I don't quite know when he'll be done with this -- Sigbjorn do you know? Meanwhile, all you can do is to avoid making blocking I/O calls. Simon From simonmar@microsoft.com Mon Mar 11 11:54:18 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 11 Mar 2002 11:54:18 -0000 Subject: Isn't this tail recursive? Message-ID: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> > On 10 Mar 2002, Jyrinx wrote: >=20 > > In the case expression at the end of countAll, each of the=20 > values looks > > to me like a recursive tail call - I should think (hope?)=20 > that it would > > be optimized by GHC into a goto statement (a la Scheme). Instead, my > > program eats up memory (I've got 256 MB) until the RTS=20 > whines about a > > stack overflow. >=20 > It is tail recusive. unfortunately, that's not the problem. > apparently ghc is not smart enough to realize that countAll' should > really be strict in basically all arguments. (hell, I'm not=20 > quite sure I > can claim to be smart enough to say that!) The function as written is only strict in its list argument, and its usage site only demands the 'l' argument strictly. So unless the compiler were to make use of the "can't fail" property of '+' on Int (which might not even hold if overflow checking is used), the compiler can't possibly evaluate the accumulating parameters of countAll' strictly. It would be possible to do strict evaluation in the case that the suspended computation is known to take a small bounded amount of time and space and can't fail - GHC doesn't do this, but we've wondered about it from time to time. I do wonder how often similar patterns crop up in practice - I've certainly encountered this pattern in my own code several times, and solved it using seq or strict constructor fields. > Never fear, > -fall-strict is here! I had no idea this flag still worked. As I recall, it was an experiment that turned out to be a bad idea - you're probably just better off using seq. Cheers, Simon From glynn@info.ucl.ac.be Mon Mar 11 12:41:40 2002 From: glynn@info.ucl.ac.be (Kevin Glynn) Date: Mon, 11 Mar 2002 13:41:40 +0100 (MET) Subject: Isn't this tail recursive? In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: <15500.42287.405957.128312@adventure> Looking at the online GHC Users Guide, this flag is documented in 4.19.14. Individual optimisations This has a link to Section 4.11.2, but -fall-strict isn't described in that section. Presumably its only been half removed (added) from the documentation. k Simon Marlow writes: > > On 10 Mar 2002, Jyrinx wrote: > > > > > Never fear, > > -fall-strict is here! > > I had no idea this flag still worked. As I recall, it was an experiment > that turned out to be a bad idea - you're probably just better off using > seq. > > Cheers, > Simon > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From reid@cs.utah.edu Mon Mar 11 12:50:01 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 11 Mar 2002 12:50:01 +0000 Subject: Isn't this tail recursive? In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> References: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: > It would be possible to do strict evaluation in the case that the > suspended computation is known to take a small bounded amount of > time and space and can't fail - GHC doesn't do this, but we've > wondered about it from time to time. I wonder if this would have the side-effect of making Haskell efficiency even more inscrutable. "Ah, yes, you would have expected this to be a bounded, non-failing computation but " Difficult tradeoff: compiler that optimizes most of your code vs. baffling changes in performance for minor changes in how the code is written. But it's not just Haskell users that get this - anyone using a modern processor can experience cache misses (huge performance cost) in C. -- Alastair Reid From icsm2002.info@unisannio.it Mon Mar 11 13:02:33 2002 From: icsm2002.info@unisannio.it (icsm2002.info@unisannio.it) Date: Mon, 11 Mar 2002 14:02:33 +0100 (CET) Subject: Icsm 2002 Call for Papers: deadline is approaching Message-ID: <200203111302.g2BD2X215957@unisannio.it> Dear Colleague I would like to remind you that the ICSM full paper submission deadline is approaching. ICSM (IEEE International Conference on Software Maintenance), 2002, and associated workshops: SCAM, WSE, WESS and the 1st Workshop on Database Maintenance and Reengineering (DBMR'2002) will be held next October 2002 in Montreal, Canada. Outstanding Keynotes such as Jon Pincus, Microsoft, Industrial and experience papers, research papers, tutorials, tool expositions, dissertation forum, workshops, panels, and other exciting activities have been planned. Papers are due by 18 March 2002 You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt we hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. If you would like to be removed from our list please send an email to icsm2002.info@unisannio.it with REMOVE in the subject. ICSM2002 Giuliano Antoniol, Program CoChair Ira D. Baxter, Program CoChair ============================================================================ IEEE International Conference on Software Maintenance 2002 Sponsored by IEEE ICSM-2002, Montreal, Canada, 3-6 October 2002 http://www.icsm2002.org icsm2002.info@unisannio.it Call for Papers Theme: Maintaining distributed heterogeneous systems ICSM is the major international conference in the field of software and systems maintenance, evolution, and management. This year's theme elaborates on last year's theme of "systems and software evolution in the era of the internet". Standalone legacy applications of yesterday and novel applications using today's technologies are rapidly becoming integrated as part of enterprise-wide and industry-wide systems. The need for rapid integration has led to many distributed heterogeneous systems that are very challenging to maintain and evolve. ICSM 2002 will address these new scenarios and the major challenges of maintenance and evolution. The focus of the conference will be on the new challenges that heterogeneous systems pose for software maintenance, and the new opportunities for researchers and practitioners. A main goal of ICSM is to promote interaction between researchers and practitioners. ICSM 2002 will bring together researchers, practitioners, developers and users of tools, technology transfer experts, and project managers. Jon Pincus (Microsoft) will describe how Microsoft handles software enhancements. Other outstanding Keynote speakers are being arranged. Past conferences have had Parnas, Rombach, McCabe, and Jacobson. ICSM-2002 will offer technical presentations and demonstrations from academia and industry. We are particularly interested in exchanging concepts, prototypes, research ideas, and other results that could contribute to the academic arena and also benefit business and the industrial community. ICSM 2002 will be participatory, with working collaborative sessions and presentations of industry projects. The Conference will be held in conjunction with: WESS -- Workshop on Empirical Studies of Software Maintenance. SCAM -- Source Code Analysis and Manipulation WSE -- Workshop on WEBsite Evolution Topics of interest include but are not restricted to the following aspects of maintenance and evolution: - Methods and theories - Maintenance and/or productivity metrics - Organizational frameworks - Preventive maintenance - Design for maintenance - Tools and environments - Life cycle and process control - Models/methods for error prediction - User interface evolution - Commercial off-the-shelf (COTS) - Third party maintenance - Freeware and open source applications - Program comprehension - Software and system visualisation - Knowledge based systems - Measurement of software - Formal methods - Legal aspects and standards - Software reusability - Internet and distributed systems - Empirical studies - Testing and regression testing - Remote, tele-work - Version and configuration management - Processes and strategies - Management and organisation - Co-operative applications - Source code analysis and manipulation - Processes and strategies - Impact of new software practices - Programming languages - Reengineering and reverse engineering - Multimedia systems RESEARCH PAPERS: Research papers should describe original and significant work in the research and practice of software maintenance and evolution. Case studies, empirical research, and experiments are particularly welcome. We also welcome papers that present leading edge and novel ideas in maintenance. Papers must not exceed 5000 words (10 pages IEEE style) in length, in English. To encourage strong submissions a prize will be awarded for the "Best Paper as Submitted". This Prize is offered by John Wiley & Sons, the publishers of the Journal of Software Maintenance and Evolution. The Program Committee will select the winner and a formal presentation of the Prize will be made in Montreal at ICSM 2002. FAST TRACK PAPERS: Fast Track papers should describe on-going research activities, or summarize the experience in software maintenance and evolution. Papers must not exceed 4 pages, IEEE style, in length, in English. Accepted fast-track papers will be included in a dedicated section of the conference proceedings. DISSERTATION FORUM: We welcome submissions of young researchers that have delivered their dissertation (Masters or Ph.D.) in the last three years. An award will be issued for the best submission. Four page summaries of accepted dissertations will be included in the conference proceedings and a special forum section will be organised at the conference. INDUSTRIAL APPLICATIONS: Proposals for presentations of Industrial Applications are welcome. These can be state-of-the-art descriptions, experience reports and survey reports from real projects, industrial practices and models, or tool demonstrations. A dedicated sub-committee of the program committee will review Industrial Application proposals and a 1-page summary of accepted proposals will be included in the conference proceedings. TUTORIALS: Tutorials should present software maintenance and evolution topics of interest to practitioners. Tutorials may be full day or half-day in length. SUBMISSION STYLE: PDF and/or Postscript electronic submission only. Papers longer than 15 pages or 6000 words will be returned to the authors. Acceptance notification will occur July 1, 2002. IMPORTANT DATES You can sumbit papers following the electronic sumbission process at: http://serg.ing.unisannio.it/~icsmpapers Alternatively, you can also submit the papers via email to: icsm2002.full@unisannio.it If you wish to submit papers via email, you are kindly encouraged to fill the Submission Form: http://web.ing.unisannio.it/icsm2002/SubForm.txt Research Papers deadline: 18 March 2002 mailto:icsm2002.full@unisannio.it Fast Track Papers deadline: 1 May 2002 mailto:icsm2002.short@unisannio.it Dissertation Forum deadline: 1 May 2002 mailto:icsm2002.thesis@unisannio.it Industrial Applications deadline: 1 May 2002 mailto:icsm2002.industry@unisannio.it Tutorials deadline: 18 March 2002 mailto:icsm2002.tutorial@unisannio.it From simonpj@microsoft.com Mon Mar 11 13:04:28 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 05:04:28 -0800 Subject: Standard Library report: List union Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AC3@RED-MSG-10.redmond.corp.microsoft.com> There's a remark at the beginning of 7.2 that says: delete, (\\), union and intersect preserve the invariant=20 that lists don't contain duplicates, provided that=20 their first argument contains no duplicates. The same applies to unionBy etc. This design is one you might reasonably disagree with. I'd have thought it would be more sensible to have the invariant that *both* arguments to union and intersect are assumed to be sets (no dups). But I don't propose to change this now. Simon | -----Original Message----- | From: Jay Cox [mailto:sqrtofone@yahoo.com]=20 | Sent: 05 March 2002 01:51 | To: Jon Fairbairn | Cc: haskell@haskell.org | Subject: Re: Standard Library report: List union |=20 |=20 | On Mon, 4 Mar 2002, Jon Fairbairn wrote: |=20 | > The current library report defines unionBy like this: | > | > unionBy eq xs ys =3D xs ++ deleteFirstsBy eq (nubBy eq ys) xs | > | > why does it take the nub of ys, but not xs? I'd have expected | > | > unionBy eq xs ys =3D (nubBy eq xs) ++ deleteFirstsBy eq=20 | (nubBy eq ys)=20 | > xs | > | > J=F3n |=20 | Pure guess, but... (no really!) |=20 |=20 | For the sake of argument, lets define a ulist as a list where=20 | for all elements x in list l, there is no element n with=20 | index not equal to that of x (index being position of the=20 | element in the list) such that eq n x =3D=3D True. |=20 | In other words every element in a ulist appears only once. |=20 | Suppose you (unionBy eq x y) to get a result. | Suppose also that x is a ulist | A. x is a ulist by argument. | B. the result of (nubBy eq ys), lets call it z, is a ulist. | C. the result of (deleteFirstsBye eq z xs) is a list which=20 | has no elements in common with xs). because (deleteFirstsBy=20 | eq) "deletes" elements and doesnt add,the result is a ulist.=20 | D. Adding new, unique, elements (elements not equal to a=20 | element in the ulist in question) to a ulist results in a=20 | ulist. E. Therefore (unionBy eq x y) is a ulist. |=20 |=20 | Why should this be important? |=20 | what if you wanted to fold the function (unionBy eq) over a=20 | list of lists to get a ulist? Assuming you start with an=20 | initial ulist, by your suggestion you'd be applying (nubBy=20 | eq) to a ulist (generated by the the repeated application=20 | (unionByeq), which would be the same as applying the identity=20 | function to a ulist. (meaning you have essentially one big=20 | nasty no-op)! |=20 |=20 | However, in taking a look at unionBy, one might wonder why it=20 | isnt defined like so (assuming xs would be the accumulated=20 | ulist in the fold. |=20 |=20 | unionBy eq xs ys =3D (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs |=20 | or maybe better (to mirror (++)) |=20 | unionBy' eq ys xs =3D (deleteFirstsBy eq (nubBy eq ys) xs) ++ xs |=20 | in using this definition, the number of conses with (:)=20 | should be linear (or less) with with the number of elements=20 | to be added to the first_ulist in the following folds. |=20 |=20 | foldl (unionBy eq) first_ulist list_of_lists | foldr (unionBy' eq) first_ulist list_of_lists |=20 | So, is there aother reason I cannot think of? I'm sure I=20 | haven't covered all bases here. |=20 | Thanks, |=20 | Jay Cox |=20 | _______________________________________________ | Haskell mailing list | Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell |=20 From bernhard@cogs.susx.ac.uk Mon Mar 11 13:06:58 2002 From: bernhard@cogs.susx.ac.uk (Bernhard Reus) Date: Mon, 11 Mar 2002 13:06:58 +0000 Subject: type aliases in instances References: <3C875792.DEB308C3@cogs.susx.ac.uk> Message-ID: <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Richard Uhtenwoldt wrote: > > I do not have experience commposing monads (maybe John Hughes can > chime in?), but I'll address where Bernhard Reus writes: > > >This can be avoided by using type > >aliases but then the monads in use cannot be instances of the Monad > >class. > >But not declaring the monads to be in class Monad can hardly > >be good style, can it? > > GHC's source code defines many monads not in class Monad. > I'll write some untested code to give an idea of > the naming conventions used: > > type FooMd out = (a,b,c)->((a,b,c),out) > returnFooMd out = \s0->out > thenFooMd p k = \s0->let (s,out) = p s0 > Thanks Richard. So this means it is common practice in the Haskell community to use type aliases and not to declare the monads as instances. But that makes me even more curious. Why are type aliases not allowed in instance declarations? I haven't found an explanation in the language doc. Does anybody know the exact reason? Any pointer appreciated. Cheers, Bernhard From franka@cs.uu.nl Mon Mar 11 14:42:33 2002 From: franka@cs.uu.nl (Frank Atanassow) Date: Mon, 11 Mar 2002 15:42:33 +0100 Subject: College Student In-Reply-To: <20020309051119.86835.qmail@web14708.mail.yahoo.com>; from mlsl99@yahoo.com on Fri, Mar 08, 2002 at 09:11:19PM -0800 References: <20020309051119.86835.qmail@web14708.mail.yahoo.com> Message-ID: <20020311154233.A27023@cs.uu.nl> My apologies to the list. This message is addressed to my old email address; I don't know why I was singled out for private tutoring lessons. Strange. Does this sort of thing happen to other people on this list too? I get these sorts of messages, usually privately, about once every two months. mary lee wrote (on 08-03-02 21:11 -0800): > > To : Mr. Frank A. > Chrishtoph > > I am recently doing my assignment on Haskell at my > college. I am just new on Haskell programming. I > would like to request if you can teach me for just few > programming rules on Haskell. It is my most > appreciation to learn from you. > > My assignment title is INTERNATIONAL AIRLINES SYSTEM. > > May i know how to open file, put record entry and just > read it from its database. How to do a simple input > and output for acquire user options using functional > programming. It is very important for me to learn > Haskell in a proper way. It will lead me to write a > good documentation. A good understanding on > programming is good. I am good in Visual Basic, > Pascal, Cobol, C++ and also JAVA. But facing > functional programming is a real problem for me. > > Now i have doing a simple Haskell programming on the > way. I just know how to import file, declare types > and display output. > > Your help and guidelines is most appreciated. > > From, > Lee Ling Ling -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-3791 From antony@apocalypse.org Mon Mar 11 15:36:53 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 11 Mar 2002 10:36:53 -0500 Subject: A Cygwin port of hmake? Message-ID: <3C8CCF15.8010004@apocalypse.org> Hi, Has anyone attempted / considered porting hmake to Cygwin? I'd like to try HaXmL under ghc on Windows, but it seems to require hmake to build. I made a naieve attempt to configure and build hmake under Cygwin myself, but the resulting Makefile tried to pass Cygwin-style /cygdrive/c/... paths to ghc, which promptly choked. I made some abortive attempts to hand-edit the Makefile.inc, but it then attempted to create some directories above my current working directory, and I eventually got lost trying to trace down the nested Makefile inclusions. Before I invest more time in either porting hmake or writing a portable Makefile for HaXmL, I thought I'd post here to see if anyone else had already been down this road. If you have, please get in touch. Thanks, -antony -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From sof@galois.com Mon Mar 11 16:43:46 2002 From: sof@galois.com (Sigbjorn Finne) Date: Mon, 11 Mar 2002 08:43:46 -0800 Subject: Concurrent Haskell (GHC) and Win32 Applications ? References: <1113DDB24D4A2841951BFDF86665EE1901041ABE@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <003301c1c91b$e9ab6b70$8132a8c0@sofxp> "Simon Peyton-Jones" writes: > > | The problem I think is with the lightweight thread implementation - > | Win32 calls can (and will) block the OS thread that makes the call, > | which blocks the entire system. Given that I'm wanting to write a > | network server with a Win32 GUI, this is obviously a Bad Thing. > > Yes, that's true at the moment, but it's something that we expect > to fix shortly. More precisely, Sigbjorn has been working on a > fix. It relies on using an OS thread to make a potentially-blocking > call, so it's a robust fix. > > I don't quite know when he'll be done with this -- Sigbjorn do you know? Modulo settling a couple of minor implementation details, I'd say it's done. To try it out, check out the fptools/ CVS sources, and configure & build it with the option --enable-threaded-rts Non-blocking callouts are enabled by attributing a 'foreign import' with 'threadsafe' (instead of 'unsafe' or 'safe') -- e.g., foreign import "wait" threadsafe snail :: IO () --sigbjorn From xddainese@xlibero.it Mon Mar 11 17:08:50 2002 From: xddainese@xlibero.it (Diego Dainese) Date: 11 Mar 2002 18:08:50 +0100 Subject: type aliases in instances In-Reply-To: <3C8CABF2.7C48E34F@cogs.susx.ac.uk> References: <3C875792.DEB308C3@cogs.susx.ac.uk> <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Message-ID: <87wuwjqbfh.fsf@benten.tomobiki.it> On Mon, 11 Mar 2002 13:06:58 +0000 Bernhard Reus wrote: [...] > But that makes me even more curious. Why are type aliases not allowed in > instance declarations? I haven't found an explanation in the language > doc. Does anybody know the exact reason? Any pointer appreciated. Look at this post from Mark P. Jones: it explains the reasons pretty well. Subject: RE: Constructor Classes Date: Wed, 8 Dec 1999 13:26:53 -0800 Message-Id: Regards, -- Diego To reply remove the 2 `x' from the address. From simonpj@microsoft.com Mon Mar 11 17:48:46 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 11 Mar 2002 09:48:46 -0800 Subject: H98 Report: expression syntax glitch Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AD3@RED-MSG-10.redmond.corp.microsoft.com> Ross points out that this is really hard to parse: | case x of y | ($ True) $ \ z -> z :: Bool -> Bool -> y because the parser doesn't know when to stop eating the type and treat the arrow as the case-alternative arrow. Carl reminds us that this is hard to parse too: | do a =3D=3D b =3D=3D c because the layout processor is meant to insert a close curly where there would be a syntax error, and that depends on the non-associativity of (=3D=3D). In both cases, the specification is unambiguous, but asks too much of the=20 parser. But in neither case can I see a cure that is better than the=20 disease. Remember, large-scale fixes are out of court. So in both cases I propose to say something like: here is an example that is hard to implement; wise programers will avoid code like this That is, point out the trap, and acknowledge that few impls will respect the letter of the law. This seems honest, and better than inventing some elaborate cure. Simon From Sven.Panne@informatik.uni-muenchen.de Mon Mar 11 18:15:26 2002 From: Sven.Panne@informatik.uni-muenchen.de (Sven Panne) Date: Mon, 11 Mar 2002 19:15:26 +0100 Subject: type aliases in instances References: <3C875792.DEB308C3@cogs.susx.ac.uk> <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Message-ID: <3C8CF43E.1010805@informatik.uni-muenchen.de> Bernhard Reus wrote: > Richard Uhtenwoldt wrote: >> [...] GHC's source code defines many monads not in class Monad. >>I'll write some untested code to give an idea of >>the naming conventions used: >> >>type FooMd out = (a,b,c)->((a,b,c),out) >>returnFooMd out = \s0->out >>thenFooMd p k = \s0->let (s,out) = p s0 > > Thanks Richard. So this means it is common practice in the Haskell > community to use type aliases and not to declare the monads as > instances. [...] Nope, it just means that at the time those parts were written the class Monad didn't exist, i.e. pre-Haskell-1.3, IIRC. :-) Cheers, S. From Ralf.Laemmel@cwi.nl Mon Mar 11 19:59:54 2002 From: Ralf.Laemmel@cwi.nl (Ralf.Laemmel@cwi.nl) Date: Mon, 11 Mar 2002 20:59:54 +0100 (MET) Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: Simon Peyton-Jones wrote: > Indeed the foralls are at the top, but I claim that wherever > you could use the composition function you were expecting, > you can also use the one GHC gives you. The two types > are isomorphic. > ... > Let me know if you find a situation where this isn't true. > ... > No I believe it is not a bug. I would be interested to see why you > needed to change your code. It is all not that simple. Let me try to explain. For some deeper background I refer to my draft. One more week to finish. http://www.cwi.nl/~ralf/rank2/ Maybe, we should do that offline. But maybe it is interesting for people how like rank-2 stuff. Let's consult the following code with the ghc 5.03 snapshot. It is basically the same kind of example as in my last posting but I point out a few things more clearly, and the example is simpler. --------------------------------------------------------------------- type Generic i o = forall x. i x -> o x type Id x = x comb :: (Generic Id Id) -> (Generic Id Id) -> (Generic Id Id) comb = undefined comb' :: forall x1 x11 x. (Id x1 -> Id x1) -> (Id x11 -> Id x11) -> Id x -> Id x comb' = undefined yacomb :: (forall x. x -> x) -> (forall x. x -> x) -> (forall x. x -> x) yacomb = (.) yacomb' :: forall x y z. (x -> x) -> (y -> y) -> (z -> z) yacomb' = undefined --------------------------------------------------------------------- I explain the code per def./decl.: 1. The type synonym Generic captures a parameterized function type where we can still plug in type constructors of kind *->* to derive domain and codomain from the explicitly quantified x. The type Generic suggests that we deal parametric polymorphism but in my real code I have class constraints on x. This immediately resolves Simon's concern about the usefulness of defining sequential composition in some new way. I had chosen seq. comp. as an example to play with types. If we go beyond parametric polymorphism, several binary combinators using Generic for arguments and result make sense (see my draft; feedback appreciated). 2. The type constructor Id of kind * -> * is the identity type constructor. That is, given a type, it returns the very same type. There are plenty of useful type constructors like Id but let's restrict our discussion to Id for simplicity. As an aside, I like it very much that ghc allows me to compose type synoyms like I do with Generic and Id. hugs doesn't allow me that, and this implies that I have to use datatypes instead for things like Id, and this in turn implies that I have quite some wrapping / unwrapping going on in my hugs expression code. 3. Let's suppose we want to define SOME binary function combinator comb. It takes two polymorphic functions of a certain type as for i and o and returns another polymorphic function with potentially some other i and o for the domain and codomain. In fact, I have chosen Id for all i and o parameters for the above comb for simplicity. Let's us ignore parametricity for a moment and pretend we know how to define many combinators like this. In the example above, I left comb undefined since I only want to play with the ghc type system. As I said, in my true code I define interesting combinators with such type schemes but with extra class constraints. This is the reason that I can do more things than parametricity allows me. So let us really not think of ordinary (say, parametric polymorphic) sequential composition as my last email maybe suggested. 4. So now let's ask for the type of comb in ghc. It turns out to be the rank-1 (!!!) type I captured as explicit type annotation for comb'. I would have expected a rank-2 type because the forall is scoped by the type synonym Generic. So why should I like to see the forall going to the top? I still would say that THIS IS A BUG. Here is why the types are different: The rank-1 type allows me to combine functions on say integers (by using Int for x x1 and x11). The rank-2 type that I am asking for rules out monomorphic functions to be composed. So the type with the foralls at the top, and the foralls scoped in a rank-2 discipline are NOT isomorphic. Also, keep the possibility of class constraints in mind. Simon, is it maybe possible that you confused the type of (.), that is, forall b c a. (b -> c) -> (a -> b) -> a -> c with the type forall z y x. (x -> x) -> (y -> y) -> z -> z. The b c a in (.) types deal with the possibly different result types. The z y x in my rank-1 comb (messed up by ghc) deal were originally meant to display insistance on polymorphic function arguments. So the the foralls should not be at the top. 5. The type that I wrote down for yacomb is precisely the rank-2 type I would have favoured to see for comb instead of the actual type suggested by ghci. It is a rank-2 type. A minor issue: I expanded the occurrences of Id for readability (ghc keeps them at all costs because it seems to assume that I like to get reminded of them which is not the case BTW). So everything (the two arguments and the result) are of type forall x. x -> x (which should be equal to Generic Id Id). As an example, I define yacomb to be equal to (.). But note yacomb is a very much restricted (.), not just that it composes type-preserving functions but it insists on polymorphic functions. 6. Now let us see what happens if we take all the foralls to the top. This function would be of the type as shown for yacomb', that is, forall x y z., ... This is precisely the type ghci suggests instead of the rank-2 type except that I applied away Id. Now let's try to define yacomb' in terms of yacomb, that is: yacomb' = yacomb This works. Let us not wonder why. Now let's try to define yacomb' in terms of (.) instead, that is: yacomb' = (.) You get a nice type error in ghci 5.03: test.hs:17: Inferred type is less polymorphic than expected Quantified type variable `x' is unified with another quantified type variabl e `z' Quantified type variable `y' is unified with another quantified type variabl e `z' Signature type: forall z y x. (x -> x) -> (y -> y) -> z -> z Type to generalise: (x -> x) -> (x -> x) -> x -> x When checking the type signature for `yacomb'' When generalising the type(s) for `yacomb'' module `Prelude' is not interpreted Whatever this means, it at least shows that the two types are not isomorphic in the sense that ghci very well separates them even in the case of parametric polymorphism. Or is this (another) bug? Simon Peyton-Jones also wrote: > No, GHC does not support partially applied type synonyms, > except in the RHS of other type synonyms. It is a VERY BIG thing to > allow this, because it amounts to allowing lambdas at the type level > and that messes up inference cruelly. > > Why do you think GHC does? Ok, that's what I meant: in RHSs of other type synonyms. BTW, it also works when passing parameters to parameterized datatypes. Here is a variation on defining Generic as a datatypes as opposed to the earlier type synonym. Id is still the same type synonym as before. data Generic' i o = G (forall x. i x -> o x) type TP = Generic Id Id Yes, I was surprised to see that it works to this extent. In fact, it is already quite expressive in this form because it allows us to have type constructors as type synonyms but of course not arbitrary lambdas as Girard's system would ask for. So I revise my question: Does the current support for partially applied type synonyms pose any challenges or is it basically just like macro expansion? That is, is the type system maybe not even affected by it? If it is easy, why is not in Haskell 98 and in hugs? It is terribly useful. Ralf From claus.reinke@talk21.com Mon Mar 11 21:45:07 2002 From: claus.reinke@talk21.com (Claus Reinke) Date: Mon, 11 Mar 2002 21:45:07 -0000 Subject: A Cygwin port of hmake? References: <3C8CCF15.8010004@apocalypse.org> Message-ID: <003c01c1c946$1b8b6b20$ae1ffea9@Standard> > Has anyone attempted / considered porting hmake to Cygwin? > > I'd like to try HaXmL under ghc on Windows, but it seems to require > hmake to build. Just curious: is that the HaXmL in hslibs.Text that comes with ghc? Aren't hslibs thingies supposed to be portable (and ported/updated, if they come with a Haskell implementation)? > I made a naieve attempt to configure and build hmake under Cygwin > myself, but the resulting Makefile tried to pass Cygwin-style > /cygdrive/c/... paths to ghc, which promptly choked. I'm no expert on configure, but who exactly is putting the /cygdrive/c/.. stuff in there? Cygwin should use its pretended filesystem, or indeed local paths, so perhaps someone is explicitly setting an absolute path or path-prefix. Can you configure with c:/ instead (I understand that ghc only chokes on cygwin specials, not on Windows-infelicities or local paths, and some cygwin tools are tolerant towards c:/.. style), perhaps by setting appropriate prefixes? I seem to remember that compiling HOpenGL with non-cygwin GHC under cygwin/Win2k, using configure and co, worked without such problems. Claus From antony@apocalypse.org Mon Mar 11 22:40:55 2002 From: antony@apocalypse.org (Antony Courtney) Date: Mon, 11 Mar 2002 17:40:55 -0500 Subject: A Cygwin port of hmake? References: <3C8CCF15.8010004@apocalypse.org> <003c01c1c946$1b8b6b20$ae1ffea9@Standard> Message-ID: <3C8D3277.4060003@apocalypse.org> Claus Reinke wrote: >>Has anyone attempted / considered porting hmake to Cygwin? >> >>I'd like to try HaXmL under ghc on Windows, but it seems to require >>hmake to build. >> > > Just curious: is that the HaXmL in hslibs.Text that comes with ghc? > Aren't hslibs thingies supposed to be portable (and ported/updated, > if they come with a Haskell implementation)? Indeed it is. I was pleasantly surprised to learn that '-package text' was all I needed to use HaXmL. >>I made a naieve attempt to configure and build hmake under Cygwin >>myself, but the resulting Makefile tried to pass Cygwin-style >>/cygdrive/c/... paths to ghc, which promptly choked. >> > > I'm no expert on configure, but who exactly is putting the /cygdrive/c/.. > stuff in there? Cygwin should use its pretended filesystem, or indeed > local paths, so perhaps someone is explicitly setting an absolute path > or path-prefix. Can you configure with c:/ instead (I understand that > ghc only chokes on cygwin specials, not on Windows-infelicities or > local paths, and some cygwin tools are tolerant towards c:/.. style), > perhaps by setting appropriate prefixes? I seem to remember that > compiling HOpenGL with non-cygwin GHC under cygwin/Win2k, > using configure and co, worked without such problems. Unfortunately, that isn't the problem. I set prefix=c:/... when invoking configure, and configure used that path in its output. But unfortunately the Makefile.inc used to build hmake does some tricky $(PWD) shenanigans that have nothing to do with configure, and then passes the resulting path to ghc. Unfortunately, $(PWD) returns Cygwin-style paths, and I failed to find a good workaround for this in the few minutes I spent looking at it. Anyway, I'm relieved that HaXmL is in hslibs. -antony -- Antony Courtney Grad. Student, Dept. of Computer Science, Yale University antony@apocalypse.org http://www.apocalypse.org/pub/u/antony From sqrtofone@yahoo.com Tue Mar 12 04:35:47 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Mon, 11 Mar 2002 22:35:47 -0600 (CST) Subject: type aliases in instances In-Reply-To: <3C8CABF2.7C48E34F@cogs.susx.ac.uk> Message-ID: On Mon, 11 Mar 2002, Bernhard Reus wrote: > Richard Uhtenwoldt wrote: > > > > I do not have experience commposing monads (maybe John Hughes can > > chime in?), but I'll address where Bernhard Reus writes: > > > > >This can be avoided by using type > > >aliases but then the monads in use cannot be instances of the Monad > > >class. > > >But not declaring the monads to be in class Monad can hardly > > >be good style, can it? > > > > GHC's source code defines many monads not in class Monad. > > I'll write some untested code to give an idea of > > the naming conventions used: > > > > type FooMd out = (a,b,c)->((a,b,c),out) > > returnFooMd out = \s0->out > > thenFooMd p k = \s0->let (s,out) = p s0 > > > > Thanks Richard. So this means it is common practice in the Haskell > community to use type aliases and not to declare the monads as > instances. I don't know about that. Andy Gill has a a monad library out there (sorry, the link I have is not in use anymore) that basically uses the newtype psuedo-type aliases. If I needed to construct monad for myself, I certainly wouldn't use "type". I'm sure most others feel the same way. Besides, there might be any number of reasons that GHC could use type aliases. The first that comes to mind is the old rule, "If it works, don't fix it." As I haven't read the sourcecode, I can only guess. > But that makes me even more curious. Why are type aliases not allowed in > instance declarations? I haven't found an explanation in the language > doc. Does anybody know the exact reason? Any pointer appreciated. With glasgow extensions, (perhaps hugs has this extension too?) you could use almost any arbitrary type. But as SPJ said in a previous post, you cannot have standalone "curried" type alias expressions, therefore I believe you, shouldn't be able to use type aliases for a definition of a Monad or Functor instance. (Hey, I tried! the original message that inspired this thread inspired me to do so.) As an example, I created this half finished library which allows one to type non-polymorphic expressions with type-classes. It uses ghc's -fallow-overlapping-instances so that something of type, say, String -> [(a,String)] as a "Parser a" (The "Parser a" example not included in source code). It also uses glasgow-exts, but I believe its only need is to express the type of the constant bottomless, which because it is polymorphic, I use to assign types to multiple instances of it. (basically, I have built a type class that recurses down the type expression trees.) and, well, perhaps another extension. I'm to lazy to research the names of all extensions :). The code is suprisingly trivial, if one can understand it. Here's a tidbit from the library >bottomless:: forall a. a >bottomless=error "This shouldn't happen in the HasType Module" > >class HasType a where > istype :: a -> String >instance HasType a => HasType(IO a) where > istype _ = "IO (" ++ istype (bottomless::a) ++ ")" If you want to take a look at more of it goto http://www.flash.net/~flygal/Jay/Haskell/HasType.lhs sometime. by that time you get it, it may look alittle different, as i perfect it, change it so that it doesn have to outragous runtime, change the class definition, actually define it as a Module, or whatever. Again, this is a temporary place, until I find a more permanent place, (like my own domain name.) I've digressed. Back to the problem of using type aliases, A problem with using overlapping instances is that you might want to use instances which overlap equally. For example, what if I wanted to use some alias for an arbitrary tuple? The type checker cannot tell the difference between the aliased type and the other, which means you cannot make the two instances type Alias1 =Type1 instance Foo Type1 where ... instance Foo Alias1 where ... Which you dearly might if you wanted to interpet your conception of what your type alias "means" into your program. That's probably why newtype was invented. Jay Cox From jyrinx_list@mindspring.com Tue Mar 12 05:33:01 2002 From: jyrinx_list@mindspring.com (Jyrinx) Date: 11 Mar 2002 21:33:01 -0800 Subject: Isn't this tail recursive? In-Reply-To: References: Message-ID: <1015911182.6392.11.camel@kryptonitespoon.maurers> > > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > > White -> countAll' cs 1 nl nw (nc + 1) > > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) > > > make this something like > > ... > > Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' > White -> nc' `seq` countAll' cs 1 nl nw nc' > Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' > where nw' = nw + newWord > nc' = nc + 1 > nl' = nl + 1 Cool! That did the trick ... (runs on very little memory *and* time now ... very cool) I've read through the other responses (thanks all!), and I'm still not exactly sure what's going on ... I'm relatively new to Haskell, and my understanding of laziness is hardly rigorous; in general, how should I know where I need to use seq, and what I need to use it on? Is there a paper I should read? (I've got Hudak's book, but it does everything lazily IIRC) Jyrinx jyrinx_list@mindspring.com From ketil@ii.uib.no Tue Mar 12 07:11:13 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 12 Mar 2002 08:11:13 +0100 Subject: Concurrent Haskell (GHC) and Win32 Applications ? In-Reply-To: <003301c1c91b$e9ab6b70$8132a8c0@sofxp> References: <1113DDB24D4A2841951BFDF86665EE1901041ABE@RED-MSG-10.redmond.corp.microsoft.com> <003301c1c91b$e9ab6b70$8132a8c0@sofxp> Message-ID: "Sigbjorn Finne" writes: >> Yes, that's true at the moment, but it's something that we expect >> to fix shortly. More precisely, Sigbjorn has been working on a >> fix. It relies on using an OS thread to make a potentially-blocking >> call, so it's a robust fix. > Modulo settling a couple of minor implementation details, I'd say it's done. > To try it out, check out the fptools/ CVS sources, and configure & build > it with the option --enable-threaded-rts Ahem - how far would this be from a "real" multithreaded implementation, i.e. one that could use a few OS threads to take advantage of multiple CPUs in an SMP system? -kzm -- If I haven't seen further, it is by standing in the footprints of giants From simonpj@microsoft.com Tue Mar 12 09:04:47 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 01:04:47 -0800 Subject: Concurrent Haskell (GHC) and Win32 Applications ? Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AD9@RED-MSG-10.redmond.corp.microsoft.com> | Ahem - how far would this be from a "real" multithreaded=20 | implementation, i.e. one that could use a few OS threads to=20 | take advantage of multiple CPUs in an SMP system? Not very far. We have had a working implementation of=20 such a thing, but not in a robust releasable state. S From ketil@ii.uib.no Tue Mar 12 09:50:54 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 12 Mar 2002 10:50:54 +0100 Subject: Concurrent Haskell (GHC) and Win32 Applications ? In-Reply-To: <1113DDB24D4A2841951BFDF86665EE1901041AD9@RED-MSG-10.redmond.corp.microsoft.com> References: <1113DDB24D4A2841951BFDF86665EE1901041AD9@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: "Simon Peyton-Jones" writes: > | Ahem - how far would this be from a "real" multithreaded > | implementation, i.e. one that could use a few OS threads to > | take advantage of multiple CPUs in an SMP system? > Not very far. We have had a working implementation of > such a thing, but not in a robust releasable state. Really!? Wow! I have at my disposal an 8-CPU Sun and a (well, less disposable, but access to, at any rate) a cluster of three 64-CPU Regattae. I also have at hand compute-heavy problems with a Haskell-implemented solution. Do let me know when you have something you'll let an amateur with no compiler experience loose upon, won't you? :-) When I last asked about, it seemed that parallell Haskell was the way to go for performance gain, but sadly GPH is lagging real GHC a bit, and worse, is using PVM for parallellisation. As far as I understand, this means a lot of heap duplication (which hurts, since I consume lots of memory) and needless communication overhead on SMPs. May I assume that, if/when a multithreaded RTS stabilises, the paradigms from parallell Haskell can easily be implemented on it ("easily" meaning that it'll probably happen)? At the moment, I'm working on getting my program correct, so I'm only charting the waters, as it were, for parallellisation. -kzm -- If I haven't seen further, it is by standing in the footprints of giants From simonpj@microsoft.com Tue Mar 12 09:55:55 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 01:55:55 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041ADA@RED-MSG-10.redmond.corp.microsoft.com> | type Generic i o =3D forall x. i x -> o x |=20 | type Id x =3D x |=20 | comb ::=20 | (Generic Id Id) | -> (Generic Id Id) =20 | -> (Generic Id Id) =20 | comb =3D undefined | So now let's ask for the type of comb in ghc. | It turns out to be the rank-1 (!!!) type I captured as=20 | explicit type annotation for comb'. I would have expected a=20 | rank-2 type because the forall is scoped by the type synonym=20 | Generic. So why should I like to see the forall going to the=20 | top? I still would say that THIS IS A BUG. Here is why the=20 Yes, indeed this is a bug. Thank you for finding it. It turned out that in liberalising GHC's treatment of type synonyms (which you remark is a good thing) I had failed to cover a case. Fortunately, an ASSERT caught the bug in my build, and the fix is easy. | yacomb1 :: (forall x. x -> x)=20 | -> (forall x. x -> x)=20 | -> (forall x. x -> x)=20 | yacomb1 =3D (.) | | yacomb2 :: forall x y z. (x -> x) -> (y -> y) -> (z -> z) | yacomb2 =3D undefined | | Now let's try to define yacomb2 in terms of yacomb1, that is: | | yacomb2 =3D yacomb1 | | This works. Let us not wonder why. We should wonder why. It's plain wrong. yacomb1's type signature is more restrictive than that of yacomb2. This is a bug in the 5.03 snapshot, which fortunately I fixed a week or two ago. The compiler in the respository rejects the definition. Bottom line: you found two bugs, for which much thanks. But I stand by forall-lifting! (But note that the foralls are lifted only from *after* the arrow, not before. (forall a.a->a) -> Int is not the same as (forall a. (a->a) -> Int).) Simon From ross@soi.city.ac.uk Tue Mar 12 10:00:15 2002 From: ross@soi.city.ac.uk (Ross Paterson) Date: Tue, 12 Mar 2002 10:00:15 +0000 Subject: minor H98 inconsistency: sections Message-ID: <20020312100015.GA16972@soi.city.ac.uk> The following passages differ on the status of (a+b+): 3 Expressions aexp -> ... | ( expi+1 qop(a,i) ) (left section) | ( qop(a,i) expi+1 ) (right section) 3.5 Sections Syntactic precedence rules apply to sections as follows. (op e) is legal if and only if (x op e) parses in the same way as (x op (e)); and similarly for (e op). For example, (*a+b) is syntactically invalid, but (+a*b) and (*(a+b)) are valid. Because (+) is left associative, (a+b+) is syntactically correct, but (+a+b) is not; the latter may legally be written as (+(a+b)). ghc follows the grammar, rejecting (a+b+) Hugs accepts (op a op' b) and rejects (a op b op') regardless of associativity and precedence, while nhc accepts them both. The grammar could be made to match the text by adding two alternatives: | ( lexpi qop(l,i) ) (left section) | ( qop(r,i) rexpi ) (right section) Changing the text to match the grammar seems less attractive. But the text says more than the revised grammar. For example, it deals with the expression glitch I mentioned the other week: together with the disambiguation meta-rule, it implies that the expression (let x = 10 in x `div`) is invalid, because let x = 10 in x `div` z doesn't parse as (let x = 10 in x) `div` z (might be worth adding this as an example) but it's no help with SimonM's example let x = 10 in x == x == True From simonpj@microsoft.com Tue Mar 12 10:06:25 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 02:06:25 -0800 Subject: first-class polymorphism beats rank-2 polymorphism Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041ADD@RED-MSG-10.redmond.corp.microsoft.com> | Ok, that's what I meant: in RHSs of other type synonyms. | BTW, it also works when passing parameters to parameterized=20 | datatypes. Here is a variation on defining Generic as a=20 | datatypes as opposed to the earlier type synonym. Id is still=20 | the same type synonym as before. |=20 | data Generic' i o =3D G (forall x. i x -> o x) | type TP =3D Generic Id Id |=20 | Yes, I was surprised to see that it works to this extent. This works because you said Generic not Generic' in the RHS of TP. If you use Generic' the program is rejected, and so it should be. | system would ask for. So I revise my question: Does the | current support for partially applied type synonyms=20 | pose any challenges or is it basically just like macro=20 | expansion? That is, is the type system maybe not even=20 | affected by it? If it is easy, why is not in Haskell 98 and=20 | in hugs? It is terribly useful. It's just macro expansion. GHC expands saturated type synonyms before looking for well-formedness in types. This is indeed=20 rather useful, and it's easy too. It's not in H98 because no one thought of it then.=20 Simon From Malcolm.Wallace@cs.york.ac.uk Tue Mar 12 10:20:44 2002 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Tue, 12 Mar 2002 10:20:44 +0000 Subject: A Cygwin port of hmake? In-Reply-To: <3C8D3277.4060003@apocalypse.org> Message-ID: Antony, > But unfortunately the Makefile.inc used to build hmake does some tricky > $(PWD) shenanigans that have nothing to do with configure, and then > passes the resulting path to ghc. Unfortunately, $(PWD) returns > Cygwin-style paths, and I failed to find a good workaround for this in > the few minutes I spent looking at it. David Duke recently reported that the hmake distributed with nhc98-1.10 builds correctly with ghc-5.02.2 under Cygwin, but the separate distribution of hmake-3.01 does not. This was very puzzling, but your mention of $(PWD) rings a bell as to what the difference between them might be. The working distribution uses $(shell pwd) in its Makefiles instead of $(PWD). I recently changed all instances of the former to the latter because I couldn't see any reason why we should fork off lots of shell processes just to find the current directory, when that information is instantly available in a variable. It seems that the slight performance hit entailed by the shell calls is a necessary evil in order to cope with Cygwin, so I'll change them back again. Apologies for the inconvenience I have caused you by introducing this simple "improvement". It looked benign at the time! Regards, Malcolm From simonpj@microsoft.com Tue Mar 12 12:08:56 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 04:08:56 -0800 Subject: FW: Layout indentation marking Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AE2@RED-MSG-10.redmond.corp.microsoft.com> I agree with Ian here (and not just because of what GHC does!) Does anyone disagree? Simon -----Original Message----- From: Ian Lynagh [mailto:igloo@earth.li]=20 Sent: 10 March 2002 15:23 To: Haskell list Subject: Layout indentation marking Given this module module Main where main :: IO() main =3D putStrLn $ show $ foo foo :: Int foo =3D x + y where x =3D 6 s =3D "foo\ \bar" y =3D 7 nhc98 and hugs correctly (as per the revised report) print 13. ghc gives q.lhs:11: parse error on input `=3D' I think ghc is in the right here and the report should be updated to read + Where the start of a lexeme does not follow the end of a lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) (it currently reads + Where the start of a lexeme does not follow a complete lexeme on the same line, this lexeme is preceded by where n is the indentation of the lexeme, provided that it is not, as a consequence of the first two rules, preceded by {n}. (A string literal may span multiple lines -- Section 2.6.) where I have altered only the first line). Thanks Ian _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell From simonpj@microsoft.com Tue Mar 12 13:00:36 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 05:00:36 -0800 Subject: FW: H98 Report: expression syntax glitch Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AE6@RED-MSG-10.redmond.corp.microsoft.com> In response to my recent message (below), Ross asks: "Are you rejecting the fix I suggested: Add a side condition to the grammar in 3.13: the guard must not end with a type signature (because the following -> looks like part of the type)." Indeed, this would be possible. It would reject programs like f x =3D case x of { (a,b) | b :: Bool -> a } which are in principle reasonable, but are really hard to parse. Indeed, GHC, Hugs, and nhc all reject it. I suppose that the term "ends with" is a bit imprecise, too. Presumably this would be OK f x =3D case x of { (a,b) | (b :: Bool) -> a } Still, Ross's suggestion is pragmatic: if all the impls find this corner of the language too hard to parse, then some guidance about what=20 not to write would be a good plan. As usual, this is not a big deal: it's a dark corner that few will trip over. But it is my joyful task (aided by many others) to try to=20 illuminate the darkness, so I invite your opinions about which fix (the one below, or Ross's) is better. Simon -----Original Message----- From: Ross Paterson [mailto:ross@soi.city.ac.uk]=20 Sent: 11 March 2002 17:59 To: Simon Peyton-Jones Subject: Re: H98 Report: expression syntax glitch Simon, > Ross points out that this is really hard to parse: >=20 > | case x of y | ($ True) $ \ z -> z :: Bool -> Bool -> y >=20 > because the parser doesn't know when to stop eating the type and treat > the arrow as the case-alternative arrow. > But in neither case can I see a cure that is better than the > disease. Remember, large-scale fixes are out of court. An easier case than Carl's, I think. From simonpj@microsoft.com Tue Mar 12 17:08:07 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 12 Mar 2002 09:08:07 -0800 Subject: Haskell report: deriving Show & Read instances, Appendix D Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041AF4@RED-MSG-10.redmond.corp.microsoft.com> Folks Olaf points out a problem with the specification of 'deriving' Show. In particular: | "The representation will be enclosed in parentheses=20 | if the precedence of the top-level constructor operator in x=20 | is less than d."=20 Olaf proposes that we should change "less than" to "less than or equal to". His reasoning is below, and seems persuasive to me. Briefly, the=20 consequences of the change would be: a) The current specification yields syntactically incorrect Haskell for some associativities. The changed specification would avoid this. b) The changed spec would yield more than the minimum number of parentheses. c) The current spec makes it hard for simple recursive descent parsers, such as that suggested by the Report for Read, to avoid divergence on left recursion. The changed spec makes it easy. d) The downside is that all compilers would need to change, slightly. Any comments? Simon | In all Haskell implementations (tested Hugs,Ghc and nhc98)=20 | show sometimes produces output that does not represent=20 | well-formed expressions. For example: |=20 | data Tree a =3D Node a | Tree a :^: Tree a | Tree a ::: Tree a=20 | deriving (Eq,Show) |=20 | infixl 6 ::: | infixr 6 :^: |=20 | main =3D print ((Node True :^: Node False) ::: Node True) |=20 | yields |=20 | Node True :^: Node False ::: Node True |=20 | The expression is ill-formed because one constructor is left-=20 | and the other one is right-associative. |=20 | Finally, left-recursive data constructors that are=20 | left-associative lead read into infinite recursion. Example: |=20 | infixl 5 :^: | =20 | data Tree a =3D Leaf a | Tree a :^: Tree a deriving (Show,Read) |=20 | main =3D do | print (read "(Leaf True :^: Leaf False) :^: Leaf True" :: Tree Bool) |=20 |=20 | I have a solution for the two last problems. It means all=20 | Haskell compilers have to change, but I believe that it is worth it. |=20 | The source of the show problem is that show tries to handle=20 | associativity of infix constructors. But there is no way to=20 | do this correctly. showsPrec gets as argument the precedence=20 | of the surounding expression, but not its associativity. This=20 | associativity would be needed to use associativity of=20 | constructors correctly. |=20 | The solution is simple: dont' try to use associativity to=20 | avoid parenthesis. Thus you get some superfluous paranthesis,=20 | but the output is always correct and the implementation of=20 | deriving is even a bit simpler. E.g.: |=20 | showsPrec d (u :^: v) =3D showParen (d > 5) showStr | where | showStr =3D showsPrec 6 u .=20 | showString " :^: " . | showsPrec 6 v | For all of |=20 | infix 5 :^: | infixl 5 :^: | infixr 5 :^: |=20 | The second advantage of this simplification is, that the=20 | additional parentheses prevent infinite left recursion. You=20 | can read in the tree expression given above, because=20 | parentheses are now compulsory: |=20 | instance (Read a) =3D> Read (Tree a) where |=20 | readsPrec d r =3D readParen (d > 5) | (\r -> [(u:^:v,w) | | (u,s) <- readsPrec 6 r, | (":^:",t) <- lex s, | (v,w) <- readsPrec 6 t]) r |=20 | ++ readParen (d > 9) | (\r -> [(Leaf m,t) | | ("Leaf",s) <- lex r, | (m,t) <- readsPrec 10 s]) r |=20 | What do you think? |=20 | Discussing all the other minor problems with the report=20 | specification doesn't make sense before this major issue is=20 | cleared up. |=20 | Ciao, | Olaf |=20 | --=20 | OLAF CHITIL,=20 | Dept. of Computer Science, The University of York, York YO10=20 | 5DD, UK.=20 | URL: http://www.cs.york.ac.uk/~olaf/ | Tel: +44 1904 434756; Fax: +44 1904 432767 |=20 From hdaume@ISI.EDU Tue Mar 12 17:34:47 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Tue, 12 Mar 2002 09:34:47 -0800 (PST) Subject: Isn't this tail recursive? In-Reply-To: <1015911182.6392.11.camel@kryptonitespoon.maurers> Message-ID: Here's the basic idea. Suppose we have the function: > sum [] acc = acc > sum (x:xs) acc = sum xs (acc+x) This is tail recursive, but not strict in the accumulator argument. What this means is that the computation will be performed lazily, so sum [4,5,8,10,14,20] 0 will go like this: > sum [4,5,8,10,14,20] 0 = > sum [5,8,10,14,20] (0+4) = > sum [8,10,14,20] ((0+4)+5) = > sum [10,14,20] (((0+4)+5)+8) = > sum [14,20] ((((0+4)+5)+8)+10) = > sum [20] (((((0+4)+5)+8)+10)+14) = > sum [] ((((((0+4)+5)+8)+10)+14)+20) = > ((((((0+4)+5)+8)+10)+14)+20) this computation in the accumulator argument won't be evaluated until you try to print it or something, which will reduce it and perform the computation. this means that for a list of length n, the the sum computation will grow in size O(n). what you need is to make sure that the computation is done strictly and that is done using seq or $!, as in: > sum2 [] acc = acc > sum2 (x:xs) acc = sum2 xs $! (acc+x) this means that "acc+x" will be computed at each step, so the accumulator will hold only the integer (or whatever type) and not the thunk (the computation). the type of "$!" is the same as "$": > $! :: (a -> b) -> a -> b the sematics of $! are: > f $! a = f a but the difference is that $! causes "a" to be reduced completely, so it won't build a huge thunk. at least that's my understanding; i'm willing to be corrected :) - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On 11 Mar 2002, Jyrinx wrote: > > > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > > > White -> countAll' cs 1 nl nw (nc + 1) > > > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) > > > > > > make this something like > > > > ... > > > > Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' > > White -> nc' `seq` countAll' cs 1 nl nw nc' > > Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' > > where nw' = nw + newWord > > nc' = nc + 1 > > nl' = nl + 1 > > Cool! That did the trick ... (runs on very little memory *and* time now > ... very cool) I've read through the other responses (thanks all!), and > I'm still not exactly sure what's going on ... I'm relatively new to > Haskell, and my understanding of laziness is hardly rigorous; in > general, how should I know where I need to use seq, and what I need to > use it on? Is there a paper I should read? (I've got Hudak's book, but > it does everything lazily IIRC) > > Jyrinx > jyrinx_list@mindspring.com > From awfurtado@uol.com.br Tue Mar 12 20:16:29 2002 From: awfurtado@uol.com.br (Andre W B Furtado) Date: Tue, 12 Mar 2002 17:16:29 -0300 Subject: uniqueness typing Message-ID: <006601c1ca02$d32a61c0$2e30e3c8@windows9> I found the following text when visiting the Clean (a functional language) site: "Clean is the only functional language in the world which has a special type system, uniqueness typing. It enables to update function arguments destructively retaining the purity of the language." Then I have some questions: 1. Can anyone explain what does "update function arguments destructively" mean? 2. If this is a desirable thing, why does Haskell not implement it? Thanks, -- Andre From dgharrin@ucalgary.ca Tue Mar 12 22:52:29 2002 From: dgharrin@ucalgary.ca (Dana Harrington) Date: Tue, 12 Mar 2002 15:52:29 -0700 Subject: uniqueness typing References: <006601c1ca02$d32a61c0$2e30e3c8@windows9> Message-ID: <3C8E86AD.2000801@ucalgary.ca> Andre W B Furtado wrote: > I found the following text when visiting the Clean (a functional language) > site: > > "Clean is the only functional language in the world which has a special type > system, uniqueness typing. It enables to update function arguments > destructively retaining the purity of the language." I believe Mercury borrowed their uniqueness type (mode) system from Clean. But since Mercury is functional/logical then I guess its still true that Clean is the only functional language with a uniqueness type system. > Then I have some questions: > 1. Can anyone explain what does "update function arguments destructively" > mean? Uniquely typed values are guaranteed to be referenced at most once under program evaluation, these values can be modified in-place. As an example, suppose I have an array and I want to modify an element. In general I need to create a whole new copy of the array in order to make the modification since there may be other places in the program that require access to the old array. However, if I know that the old array has no other references (because the array has a unique type) then I do not need to make a copy, I can just modify the original array. This has obvious efficiency benefits. > 2. If this is a desirable thing, why does Haskell not implement it? - Uniqueness types, of course, require replacing the type system, this is a non-trivial task, - Destructive updates can already be accomplished with compiler supported libraries using monads, - Uniqueness types invalidate some program transformations. On the other hand I think uniqueness types are quite useful. Particularly as they allow much more flexible interaction between mutable data-structures than monadic approaches. I don't know of any concrete reasons a uniqueness type system couldn't be added to Haskell. This seems like a fine time to insert a plug for my Master's thesis, which describes a denotational semantics of uniqueness types: http://www.cpsc.ucalgary.ca/~danaha/uniqueness-types.ps Dana From christine@ema.trafficmagnet.net Tue Mar 12 23:41:33 2002 From: christine@ema.trafficmagnet.net (Christine Hall) Date: Wed, 13 Mar 2002 07:41:33 +0800 (CST) Subject: TrafficMagnet - Special Offer! Message-ID: <18CR1000101633@emaserver.trafficmagnet.net> --1264473606.1015976493000.JavaMail.SYSTEM.emaserver Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ReplyTo:"Christine Hall" Hi! Did you know that 85% of your potential customers will be using search engines to find what they are looking for on the Internet? Have you ever thought about getting your website listed on search engines worldwide? TrafficMagnet offers a unique technology that will submit your website to over 300,000 search engines and directories every month. We can help your customers find you! Submit your website to more than 300,000 search engines and directories http://haskell.org Normal Price: $14.95 per month Special Price: $9.95 per month You Save: more than 30% off Sign up today at http://www.trafficmagnet.net Benefit now! It's easy, it's affordable and you can sign up online. I look forward to hearing from you. Best Regards, Christine Hall Sales and Marketing E-mail: christine@trafficmagnet.net http://www.TrafficMagnet.net --1264473606.1015976493000.JavaMail.SYSTEM.emaserver Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
    Hi!

    Did you know that 85% of your potential customers will be using search engines to find what they are looking for on the Internet? Have you ever thought about getting your website listed on search engines worldwide?

    TrafficMagnet offers a unique technology that will submit your website to over 300,000 search engines and directories every month. We can help your customers find you!

    Normal Price: $14.95 per month
    Special Price: $9.95 per month
    You Save: More than 30% off
     
    Get Started Today
    Learn More
    Benefit now!
    It's easy, it's affordable and you can sign up online.
    I look forward to hearing from you.

    Best Regards,

    Christine Hall
    Sales and Marketing
    E-mail: christine@trafficmagnet.net
    http://www.TrafficMagnet.net

    This email was sent to haskell@haskell.org.
    We understand you may wish NOT to receive information from us by eMail.
    To be removed from this and other offers, simply click here.
    . --1264473606.1015976493000.JavaMail.SYSTEM.emaserver-- From hdaume@ISI.EDU Wed Mar 13 00:28:37 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Tue, 12 Mar 2002 16:28:37 -0800 (PST) Subject: Isn't this tail recursive? In-Reply-To: Message-ID: Oops, I made a false statement: > > f $! a = f a > > but the difference is that $! causes "a" to be reduced completely, so it > won't build a huge thunk. This isn't true. $! will only perform one reduction, so for instance: > id $! (a+1,b+1) will not cause a+1 and b+1 to be calculated; it will only perform the computation which creates the tuple. similarly, > id $! [a+5] will not cause a+5 to be calculated, it will only result in the list being created (i.e., reduced from a computation which will compute [a+5] to simply the value [a+5]). if you want what i was talking about, use the DeepSeq module (http://www.isi.edu/~hdaume/haskell/Util/DeepSeq.hs) and then you can write: > id $!! [a+5] which will actually perform the calculation. - Hal From sqrtofone@yahoo.com Wed Mar 13 01:06:28 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Tue, 12 Mar 2002 19:06:28 -0600 (CST) Subject: Isn't this tail recursive? In-Reply-To: Message-ID: On Tue, 12 Mar 2002, Hal Daume III wrote: > Here's the basic idea. Suppose we have the function: > > > sum [] acc = acc > > sum (x:xs) acc = sum xs (acc+x) > > This is tail recursive, but not strict in the accumulator argument. What > this means is that the computation will be performed lazily, so sum > [4,5,8,10,14,20] 0 will go like this: > > > sum [4,5,8,10,14,20] 0 = > > sum [5,8,10,14,20] (0+4) = > > sum [8,10,14,20] ((0+4)+5) = > > sum [10,14,20] (((0+4)+5)+8) = > > sum [14,20] ((((0+4)+5)+8)+10) = > > sum [20] (((((0+4)+5)+8)+10)+14) = > > sum [] ((((((0+4)+5)+8)+10)+14)+20) = > > ((((((0+4)+5)+8)+10)+14)+20) > > this computation in the accumulator argument won't be evaluated until you > try to print it or something, which will reduce it and perform the > computation. this means that for a list of length n, the the sum > computation will grow in size O(n). what you need is to make sure that > the computation is done strictly and that is done using seq or $!, as in: > > > sum2 [] acc = acc > > sum2 (x:xs) acc = sum2 xs $! (acc+x) > > this means that "acc+x" will be computed at each step, so the accumulator > will hold only the integer (or whatever type) and not the thunk (the > computation). > > the type of "$!" is the same as "$": > > > $! :: (a -> b) -> a -> b > > the sematics of $! are: > > > f $! a = f a > > but the difference is that $! causes "a" to be reduced completely, so it > won't build a huge thunk. I hate to say it, but my understanding of it is that it isnt so simple (which could be good or bad depending upon your view). I guess he best i can describe it is that it will force a to weak head normal form (which is the same as being reduced completely for expressions with only integers, or whatever...) For instance, forcing x=(map f) $! [1..] will essentially force [1.. to (1: (thunk generating [2..]) just before the (map f) is applied. I think. Ok maybe that was a bad example but I can't really think of a good one right now. You might add something that it isn't the (+) operator thats generating the thunks. It is the fact (and only this!) that (+) isn't being forced. I always got confused how (+) could be strict in both arguments, at least for the primitives Float, Integer, and the like, yet still apparently generate a bunch of thunks, like in your expression ((((((0+4)+5)+8)+10)+14)+20). Appearances can be deceiving. But, once that outermost expression is forced, the forcing moves down toward the innermost expression and then the whole expression implodes into a value. I guess the confusion was I somehow conjectured that the application of a strict function to a value would cause haskell to apply that function strictly, when in fact it should not and does not and I was plainly wrong. Here is a short "proof" bottom::[Int] bottom=bottom --bottom = _|_ y = const 3 -- const v = \x -> v main=print (y (head bottom)) If my conjecture was right, main would not terminate. (head is a strict function being applied to _|_ ). However we know that since y = \x -> 3, y will not force x, therefore main will print 3. However... all one needs to do is to change the above to. main=print (y $! (head bottom)) _|_ should be, propagated to main by the following deductions: head _|_ = _|_, y $! _|_ = _|_, print _|_ = _|_. thus main = _|_. Ooh, interesting. I tried that in ghc 5.00 and in fact ghc is smart enough to detect bottom here! It says >[jay@localhost haskell]$ ./a.out > >Fail: <> awesome! I feel like I am rambling to no end. alright. I hope I haven't been too confusing here. All in all I do like your explanation though. Oh, and after I went to the trouble to write this, I see that you did correct yourself. All my work all for naught! Maybe somebody will get something from my ramblings. Thanks, Jay Cox From reid@cs.utah.edu Wed Mar 13 03:09:48 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 13 Mar 2002 03:09:48 +0000 Subject: HGL ang GHC on Win32 In-Reply-To: References: Message-ID: > When I compile a program using GHC 5.02.2 on Windows 200 using HGL, I don't have GHC installed on my Windows partition (nor space for it, I suspect) so I'll ask some questions and hope they suggest an answer. Does it work ok using Hugs and HGL? Sigbjorn Finne did a great job of packaging both Hugs and HGL as .msi files so it should be quick to check. Be sure to use December 2002 Hugs and version 2.0.4 HGL (i.e., the versions currently on the web pages. Any luck using ghci? (Unlikely to be any better) Does rebooting your machine help? (This is one of the larger straws I'm going to grasp at.) > when I run the exe, the window starts out initially as wide as my > screen and only as tall as the title bar, regardless of what is > passed as the dimensions to openWindow. What gives? I haven't heard of this before. A quick glance at the code doesn't suggest anything. Grasping at straws, here's an implausible story for what is going wrong (doesn't suggest how it would work for other people but not for you): If you use openWindow, the position on the screen is not specified (just the size). In Haskell, this is expressed as Nothing but in (this corner of) the Win32 API, it is expressed by specifying -1 for the X and Y position. It is just possible that something has gone wrong in how that -1 is passed over from Haskell to C and that this has somehow gotten confused with the window size. You could test this implausible theory by changing the openWindow call in HelloWorld to read w <- openWindowEx "Hello World Window" (Just (100,100)) (300, 300) Unbuffered Nothing > If I resize the window everything works fine, but in my own > application resizing the window causes it to report some error about > arithmetic being bigger than 32 bits... This might agree with my theory about -1's being passed around. The -1 might somehow come back as the maximum unsigned int 0xffffffff and almost any arithmetic operation on that would lead to overflow. Except that GHC doesn't detect overflow... > Any ideas? No good ones. I'm hoping that a GHC honcho will say "Well of course that happens with 5.02.2 - you should upgrade to 5.03 right away." or some such. Sorry I can't be more help, Alastair Reid From jyrinx_list@mindspring.com Wed Mar 13 03:52:40 2002 From: jyrinx_list@mindspring.com (Jyrinx) Date: 12 Mar 2002 19:52:40 -0800 Subject: Isn't this tail recursive? In-Reply-To: References: Message-ID: <1015991561.11321.2.camel@kryptonitespoon.maurers> Aha! Gotcha. Thanks for the explanation. I suppose that, in general, for tail recursion to work right, the accumulator has to be evaluated strictly (as is how my code was fixed)? Jyrinx jyrinx_list@mindspring.com On Tue, 2002-03-12 at 09:34, Hal Daume III wrote: > Here's the basic idea. Suppose we have the function: > > > sum [] acc = acc > > sum (x:xs) acc = sum xs (acc+x) > > This is tail recursive, but not strict in the accumulator argument. What > this means is that the computation will be performed lazily, so sum > [4,5,8,10,14,20] 0 will go like this: > > > sum [4,5,8,10,14,20] 0 = > > sum [5,8,10,14,20] (0+4) = > > sum [8,10,14,20] ((0+4)+5) = > > sum [10,14,20] (((0+4)+5)+8) = > > sum [14,20] ((((0+4)+5)+8)+10) = > > sum [20] (((((0+4)+5)+8)+10)+14) = > > sum [] ((((((0+4)+5)+8)+10)+14)+20) = > > ((((((0+4)+5)+8)+10)+14)+20) > > this computation in the accumulator argument won't be evaluated until you > try to print it or something, which will reduce it and perform the > computation. this means that for a list of length n, the the sum > computation will grow in size O(n). what you need is to make sure that > the computation is done strictly and that is done using seq or $!, as in: > > > sum2 [] acc = acc > > sum2 (x:xs) acc = sum2 xs $! (acc+x) > > this means that "acc+x" will be computed at each step, so the accumulator > will hold only the integer (or whatever type) and not the thunk (the > computation). > > the type of "$!" is the same as "$": > > > $! :: (a -> b) -> a -> b > > the sematics of $! are: > > > f $! a = f a > > but the difference is that $! causes "a" to be reduced completely, so it > won't build a huge thunk. > > at least that's my understanding; i'm willing to be corrected :) > > - Hal > > -- > Hal Daume III > > "Computer science is no more about computers | hdaume@isi.edu > than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume > > On 11 Mar 2002, Jyrinx wrote: > > > > > Normal -> countAll' cs 0 nl (nw + newWord) (nc + 1) > > > > White -> countAll' cs 1 nl nw (nc + 1) > > > > Newline -> countAll' cs 1 (nl + 1) nw (nc + 1) > > > > > > > > > make this something like > > > > > > ... > > > > > > Normal -> nw' `seq` nc' `seq` countAll' cs 0 nl nw' nc' > > > White -> nc' `seq` countAll' cs 1 nl nw nc' > > > Newline-> nl' `seq` nc` `seq` countAll' cs 1 nl' nw nc' > > > where nw' = nw + newWord > > > nc' = nc + 1 > > > nl' = nl + 1 > > > > Cool! That did the trick ... (runs on very little memory *and* time now > > ... very cool) I've read through the other responses (thanks all!), and > > I'm still not exactly sure what's going on ... I'm relatively new to > > Haskell, and my understanding of laziness is hardly rigorous; in > > general, how should I know where I need to use seq, and what I need to > > use it on? Is there a paper I should read? (I've got Hudak's book, but > > it does everything lazily IIRC) > > > > Jyrinx > > jyrinx_list@mindspring.com > > > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From lisper@it.kth.se Wed Mar 13 08:12:04 2002 From: lisper@it.kth.se (Bjorn Lisper) Date: Wed, 13 Mar 2002 09:12:04 +0100 (MET) Subject: Isn't this tail recursive? In-Reply-To: (message from Hal Daume III on Tue, 12 Mar 2002 09:34:47 -0800 (PST)) References: Message-ID: <200203130812.JAA08139@ripper.it.kth.se> Hal Daume III: >Here's the basic idea. Suppose we have the function: > >> sum [] acc = acc >> sum (x:xs) acc = sum xs (acc+x) > >This is tail recursive, but not strict in the accumulator argument. ... Just a nitpick here. sum is indeed strict in its second argument (given that (+) is strict in its first argument). That is, sum l _|_ = _|_ for all possible lists l. It is of course possible that the compiler you use does not detect this and generates nonstrict code. But I think a decent strictness analyzer should detect this. Can the problem be that + is overloaded in Haskell, so the compiler cannot assume any semantical properties like strictness for it? Björn Lisper From simonmar@microsoft.com Wed Mar 13 11:12:38 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Wed, 13 Mar 2002 11:12:38 -0000 Subject: HGL ang GHC on Win32 Message-ID: <9584A4A864BD8548932F2F88EB30D1C608973B5C@TVP-MSG-01.europe.corp.microsoft.com> > I'm hoping that a GHC honcho will say=20 >=20 > "Well of course that happens with 5.02.2 - you should=20 > upgrade to 5.03 right away." >=20 > or some such. I'm afraid not :-) But there *is* a bug in the native code generator in 5.02.2, namly in the FFI support for passing floating point arguments to ccalls, which I fixed yesterday and could potentially cause this kind of problem. Make sure the graphics library has been compiled with -fvia-C or -O to work around it (and if this helps, please let us know). Cheers, Simon From robert@TechFak.Uni-Bielefeld.DE Wed Mar 13 17:13:32 2002 From: robert@TechFak.Uni-Bielefeld.DE (Robert Giegerich) Date: Wed, 13 Mar 2002 18:13:32 +0100 Subject: Hugs plugin, Haskell Browser Message-ID: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Teachers in Haskell, I often use Haskell demos in teaching algorithms. The problem is that this does not integrate well with the rest of the material, e.g. lecture notes or slides in PDF or HTML. I'd like to integrate explanations and demos and explorative changes to algorithms. This needs better support. Is there something like a Hugs plugin for Netscape? Is there something like a Haskell source browser producing XML or HTML? Thanks for all hints Robert Giegerich From aegnor@antioch-college.edu Wed Mar 13 20:19:51 2002 From: aegnor@antioch-college.edu (Abraham Egnor) Date: Wed, 13 Mar 2002 15:19:51 -0500 (EST) Subject: Hugs plugin, Haskell Browser In-Reply-To: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Message-ID: Vim can produce HTML from any source code it has highlighting rules for, which includes Haskell. Dunno about the browser plugin, though. Abe On Wed, 13 Mar 2002, Robert Giegerich wrote: > Teachers in Haskell, > > I often use Haskell demos in teaching algorithms. The problem is that this > does not integrate well with the rest of the material, e.g. lecture > notes or slides in PDF or HTML. I'd like to integrate explanations and > demos and explorative changes to algorithms. This needs better support. > > Is there something like a Hugs plugin for Netscape? > > Is there something like a Haskell source browser producing XML or HTML? > > Thanks for all hints > > Robert Giegerich > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From hdaume@ISI.EDU Wed Mar 13 20:45:06 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 13 Mar 2002 12:45:06 -0800 (PST) Subject: HGL ang GHC on Win32 In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C608973B5C@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: That is a shame. I tried both suggestions (specifying position explicitly and recompiling with fvia-c -- i had been using O all along) and neither worked :(. I also tried using 5.03, and got the following warnings: ghc.exe: chasing modules from: HelloWorld.hs Compiling GraphicsFlag ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFlag.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFlag.o ) Compiling GraphicsUtilities ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtilit ies.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtilities.o ) Compiling GraphicsTypes ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTypes.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTypes.o ) Compiling GraphicsRegion ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsRegion. hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsRegion.o ) Compiling GraphicsBrush ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBrush.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBrush.o ) Compiling GraphicsFont ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFont.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsFont.o ) Compiling GraphicsPen ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPen.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPen.o ) Compiling GraphicsDraw ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsDraw.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsDraw.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `GraphicsDraw_lvl_fast1' : C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:59: warning: implicit declaration of function `prim_rgb' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sc2l_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:1070: warning: implicit declaration o f function `prim_createCompatibleDC' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:1070: warning: assignment makes point er from integer without a cast Compiling GraphicsBitmap ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBitmap. hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsBitmap.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sf06_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:652: warning: implicit declaration of function `prim_free' Compiling GraphicsPicture ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPicture .hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsPicture.o ) Compiling GraphicsText ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsText.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsText.o ) Compiling GraphicsKey ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsKey.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsKey.o ) Compiling GraphicsEvent ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvent.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvent.o ) Compiling GraphicsEvents ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvents. hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsEvents.o ) Compiling GraphicsWND ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWND.hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWND.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suYv_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:881: warning: implicit declaration of function `prim_dispatchMessage' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suYu_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:918: warning: implicit declaration of function `prim_translateMessage' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suZz_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:2033: warning: implicit declaration o f function `prim_showWindow' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sv08_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:2315: warning: implicit declaration o f function `prim_free' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sv06_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:2334: warning: implicit declaration o f function `prim_endPaint' C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `suZv_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:4248: warning: implicit declaration o f function `prim_registerClass' Compiling GraphicsWindows ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWindows .hs, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsWindows.o ) Compiling GraphicsTime ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTime.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTime.o ) c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsTime.hs:1: Warning: The export item `Time(..)' suggests that `Time' has constructor or class methods but it has none; it is a type synonym or abstract type or class Compiling GraphicsCore ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsCore.hs , c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsCore.o ) C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc: In function `sylv_ret': C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:550: warning: implicit declaration of function `prim_deleteFont' Compiling GraphicsUtils ( c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtils.h s, c:\Hugs98\GraphicsLibrary\lib\win32/GraphicsUtils.o ) Compiling Main ( HelloWorld.hs, ./HelloWorld.o ) ghc: linking ... all of which scares me, and now no window even pops up :) sigh. - hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume On Wed, 13 Mar 2002, Simon Marlow wrote: > > I'm hoping that a GHC honcho will say > > > > "Well of course that happens with 5.02.2 - you should > > upgrade to 5.03 right away." > > > > or some such. > > I'm afraid not :-) But there *is* a bug in the native code generator in > 5.02.2, namly in the FFI support for passing floating point arguments to > ccalls, which I fixed yesterday and could potentially cause this kind of > problem. Make sure the graphics library has been compiled with -fvia-C > or -O to work around it (and if this helps, please let us know). > > Cheers, > Simon > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From reid@cs.utah.edu Wed Mar 13 22:50:31 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 13 Mar 2002 22:50:31 +0000 Subject: Hugs plugin, Haskell Browser In-Reply-To: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Message-ID: > Is there something like a Hugs plugin for Netscape? We used to have one at Yale. Can't remember what happened to it so I'm adding John Peterson to the address list in case he can remember. -- Alastair Reid Reid Consulting (UK) Ltd From hdaume@ISI.EDU Thu Mar 14 02:15:56 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 13 Mar 2002 18:15:56 -0800 (PST) Subject: un-layout program Message-ID: does there exist a program that'll take a layed out haskell program and output one that uses braces and semis to delimit? - hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume From chak@cse.unsw.edu.au Thu Mar 14 04:05:34 2002 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Thu, 14 Mar 2002 15:05:34 +1100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> Message-ID: <20020314150534U.chak@cse.unsw.edu.au> "Robert Giegerich" wrote, > I often use Haskell demos in teaching algorithms. The problem is that this > does not integrate well with the rest of the material, e.g. lecture > notes or slides in PDF or HTML. I'd like to integrate explanations and > demos and explorative changes to algorithms. This needs better support. > > Is there something like a Hugs plugin for Netscape? What I am doing is to run XEmacs and a PostScript previewer (with the slides) on two different virtual desktops. I can switch between both desktops with a single keystroke. In XEmacs, I am using the Haskell mode from http://haskell.org/haskell-mode/ It does markup Haskell code quite nicely using colour and allows me to run GHCi as a background process - ie, my XEmacs window is split into two halfs with the font-locked source on top and my GHCi session on the bottom. In the first year programming course that I teach, I always develop and debug programs in front of the class (with maybe some definitions pre-defined for larger examples). In fact, I regard it as a big advantage of using Haskell for first-year teaching that this is possible (it's difficult with a more verbose language). I have run student surveys asking students to comment on the lecture and the feedback has been very positive. In fact, the vast majority of students has rated the described approach as by far superior to the traditional chalk&talk approach. > Is there something like a Haskell source browser producing XML or HTML? Again, XEmacs with the above mentioned Haskell mode can do it. Just execute the function `htmlize-buffer' on a buffer containing the Haskell source. As an example for the generated output, have a look at http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html The detailed choice of colours is, of course, adjustable. At least on a Unix machine, I am quite sure you can use XEmacs also in batch mode to generate the HTML (eg, as part of a Makefile), but I haven't actually used it that way yet. Cheers, Manuel PS: I am doing all this on a laptop running Linux, but I think the virtually same setup should be possible on a Win32 box as XEmacs is available for that platform, too. From sqrtofone@yahoo.com Thu Mar 14 04:47:18 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Wed, 13 Mar 2002 22:47:18 -0600 (CST) Subject: Strictness (was: Is this tail recursive?) In-Reply-To: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: On Wed, 13 Mar 2002, Bjorn Lisper wrote: > Hal Daume III: > >Here's the basic idea. Suppose we have the function: > > > >> sum [] acc = acc > >> sum (x:xs) acc = sum xs (acc+x) > > > >This is tail recursive, but not strict in the accumulator argument. > ... > > Just a nitpick here. sum is indeed strict in its second argument (given that > (+) is strict in its first argument). That is, sum l _|_ = _|_ for all > possible lists l. Do you really know that? all you know is (+):: Num a => a -> a -> a therefore sum :: Num a => [a] -> a -> a now, for any conceivable sum, you generally need both arguments to compute it (or am I wrong?), so i guess you could say (+) should probably be strict for both arguments. But how would you tell the compiler that? oh wait. . o O 0 church numerals... peano numerals.... data Peano = Zero | Succ (Peano) sumpeano blah (Succ x) = sumpeano (Succ blah) x sumpeano blah Zero = blah sumpeano not strict on first argument. define instance Num for Peano. I dont even know if you could talk about strictness in either argument with church numerals. (and I'm to lazy to remind myself what a church numeral looks like precisely so that I could find out.) Perhaps what could be done about this strictness business is to make a kind of strictness annotation. Perhaps something that says (force the second argument of function F before every call to F (including any time F calls itself)). Then perhaps one could define a strict_foldl = foldl but the strictness annotations basically "inserts" the proper seq expression or $! into the redefinition of foldl. here's a rough example. !a mean !a will be forced at its application (for not knowing proper language to call it). strict_foldl :: (a -> b -> a) -> !a -> [b] -> a strict_foldl = foldl of course, there has to be a number of things that must be propagated whence you start adding these things. like for instance. if f:: !a ->b ->c f x y = .... then (flip f) should have type b ->!a ->c and then there might be times when you want to ah, lazify, a strict function. maybe that would be taken care of by giving the type without the strictness annotation (explicitly giving the type but removing all "!") How about it? Has there been any other proposals? (like maybe going as far as a "Strictness Type" system?) Thanks, Jay Cox P.S. I do wonder if my message will even get to Björn Lisper. His mailserver apparently dumps anything sent with a yahoo.com in the From: header. (and unfortunately given how much spam comes from yahoo I can see why). From ketil@ii.uib.no Thu Mar 14 07:02:32 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 14 Mar 2002 08:02:32 +0100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020314150534U.chak@cse.unsw.edu.au> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: "Manuel M. T. Chakravarty" writes: > The detailed choice of colours is, of course, adjustable. > At least on a Unix machine, I am quite sure you can use > XEmacs also in batch mode to generate the HTML Sure. Have a look at -batch, -f and -eval options. Be prepared for a bit of lag at startup though :-) -kzm -- If I haven't seen further, it is by standing in the footprints of giants From mvelev@ece.gatech.edu Thu Mar 14 08:33:40 2002 From: mvelev@ece.gatech.edu (mvelev@ece.gatech.edu) Date: Thu, 14 Mar 2002 03:33:40 -0500 (EST) Subject: Final CFP: MTV'02 deadline on March 25 Message-ID: <200203140833.g2E8Xe9m010772@yamsrv3.ece.gatech.edu> Call for Papers ===================================================================== Microprocessor Test and Verification (MTV'02) June 6-7, 2002, Austin, Texas, USA http://ece.tamu.edu/MTV/ ===================================================================== Submission deadline: March 25, 2002 Sponsored by: IEEE Computer Society Test Technology Technical Council General Chair: Magdy S. Abadir (abadir@ibmoto.com), Motorola Program Chair: Li-C. Wang (licwang@ece.ucsb.edu), UCSB Areas of Interest: -Validation of microprocessors -Experiences on test and verification of high performance processors -Test/verification of multimedia processors -Performance testing -High-level test generation for functional verification -Emulation techniques -Silicon debugging -Formal techniques and their applications -Verification coverage -Test generation at the transistor level -Equivalence checking of custom circuits at the transistor level -Circuit level verification -Switch-level circuit modeling -Timing verification techniques -Path analysis for verification or test -Design error models -Design error diagnosis -Design for testability or verifiability -Optimizing SAT procedures for application to testing and formal verification From d95mback@dtek.chalmers.se Thu Mar 14 09:09:29 2002 From: d95mback@dtek.chalmers.se (Martin =?ISO-8859-1?Q?Norb=E4ck?=) Date: 14 Mar 2002 10:09:29 +0100 Subject: Hugs plugin, Haskell Browser In-Reply-To: References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: <1016096969.4469.4.camel@caesar.safelogic.se> tor 2002-03-14 klockan 08.02 skrev Ketil Z. Malde: > "Manuel M. T. Chakravarty" writes: > > > The detailed choice of colours is, of course, adjustable. > > At least on a Unix machine, I am quite sure you can use > > XEmacs also in batch mode to generate the HTML > > Sure. Have a look at -batch, -f and -eval options. Be prepared for a > bit of lag at startup though :-) Enscript has support for coloring Haskell and outputting html: enscript --language=html --pretty-print=haskell --color --output=- --output=- is for stdout You could easily invoke it from a cgi-script. Regards, Martin -- [ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ] Opinions expressed above are mine, and not those of my future employees. SIGBORE: Signature boring error, core dumped From Andrew.Butterfield@cs.tcd.ie Thu Mar 14 10:27:41 2002 From: Andrew.Butterfield@cs.tcd.ie (Andrew Butterfield) Date: Thu, 14 Mar 2002 10:27:41 +0000 Subject: Strictness (was: Is this tail recursive?) In-Reply-To: References: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: <5.1.0.14.0.20020314102524.00a23010@mail.cs.tcd.ie> At 22:47 13/03/02 -0600, Jay Cox wrote: >Perhaps what could be done about this strictness business is to make a >kind of strictness annotation. Perhaps something that says (force the >second argument of function F before every call to F (including any time F >calls itself)). >... >here's a rough example. !a mean !a will be forced at its application (for >not knowing proper language to call it). > >strict_foldl :: (a -> b -> a) -> !a -> [b] -> a >strict_foldl = foldl > >of course, there has to be a number of things that must be propagated >whence you start adding these things. like for instance. >.... >How about it? Has there been any other proposals? (like maybe going as >far as a "Strictness Type" system?) I think the Clean type system does stuff like this - it certainly supports strictness analysis and annotations: - see http://www.cs.kun.nl/~clean/ for more details >_______________________________________ >Haskell mailing list >Haskell@haskell.org >http://www.haskell.org/mailman/listinfo/haskell ------------------------------------------------------------------------ Dr. Andrew Butterfield (http://www.cs.tcd.ie/Andrew.Butterfield/) Course Director, B.A. (Mod.) Information & Communications Technology Dept.of Computer Science, Trinity College, Dublin University Tel: +353-1-608-2517, Fax: +353-1-677-2204 ------------------------------------------------------------------------ From simonmar@microsoft.com Thu Mar 14 11:22:25 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 14 Mar 2002 11:22:25 -0000 Subject: un-layout program Message-ID: <9584A4A864BD8548932F2F88EB30D1C608973F0C@TVP-MSG-01.europe.corp.microsoft.com> > does there exist a program that'll take a layed out haskell=20 > program and > output one that uses braces and semis to delimit? You can use GHC's hssource package to parse & then pretty-print the source code - the pretty printer can generate output with explicit layout tokens if you ask for it. The documentation is a bit lacking (well, there isn't any), so grab the source or browse it on the web here: http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/hslibs/hssource/ Cheers, Simon From j_kops@hotmail.com Thu Mar 14 12:45:39 2002 From: j_kops@hotmail.com (jeroen kops) Date: Thu, 14 Mar 2002 13:45:39 +0100 Subject: which to download for SuSE7.0 Message-ID: Can I use hugs98 on mij Linux SuSE7.0 computer? If the awnser is yes, which files do I have to download? Greetings, J. Kops Student University Utrecht (The Netherlands) _________________________________________________________________ Download MSN Explorer gratis van http://explorer.msn.nl/intl.asp. From =?EUC-KR?B?waTBvrHm?=" Hi!!! ^^
    I am a student who study a computer programing.
    I want to have Haskell software to study .
    However, it is very hard to get the Haskell . and I hope you give me the way to get the Heskell.
    If you mail me to show the way to get the Heskell , I would appreciate your kindness.
    Thank you!! ^^
      Á¤Á¾±æ  
       


    "¿ì¸® ÀÎÅͳÝ, Daum" http://www.daum.net


      ¹«·á°ÔÀÓ + ÄûÁî¿Õ µµÀü±îÁö! ½Å³ª´Â ¿ì¸® °×õ±¹~
      ¢Ñ Daum°ÔÀÓÀ¸·Î ¹Ù·Î°¡±â
    From afie@cs.uu.nl Thu Mar 14 13:18:14 2002 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Thu, 14 Mar 2002 14:18:14 +0100 Subject: For the Heskell References: <20020314214723.HM.F0000000003Vgjc@www16.hanmail.net> Message-ID: <00fe01c1cb5a$b2de8ff0$ec50d383@sushi> Hi, Hugs (a Haskell interpreter) can be downloaded at http://cvs.haskell.org/Hugs/pages/downloading.htm Arjan From afie@cs.uu.nl Thu Mar 14 13:22:28 2002 From: afie@cs.uu.nl (Arjan van IJzendoorn) Date: Thu, 14 Mar 2002 14:22:28 +0100 Subject: which to download for SuSE7.0 References: Message-ID: <010401c1cb5b$49d087b0$ec50d383@sushi> Hi Jeroen, > Can I use hugs98 on mij Linux SuSE7.0 computer? I think you can. Download hugs98-Dec2001.tar.gz under Generix Unix at http://cvs.haskell.org/Hugs/pages/downloading.htm and compile it yourself. How to do this, can be found in the file "Install" inside the archive. Greetings, Arjan van IJzendoorn From franka@cs.uu.nl Thu Mar 14 16:14:19 2002 From: franka@cs.uu.nl (Frank Atanassow) Date: Thu, 14 Mar 2002 17:14:19 +0100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020314150534U.chak@cse.unsw.edu.au>; from chak@cse.unsw.edu.au on Thu, Mar 14, 2002 at 03:05:34PM +1100 References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: <20020314171419.B511@cs.uu.nl> "Robert Giegerich" wrote, > I often use Haskell demos in teaching algorithms. The problem is that this > does not integrate well with the rest of the material, e.g. lecture > notes or slides in PDF or HTML. I'd like to integrate explanations and > demos and explorative changes to algorithms. This needs better support. > > Is there something like a Hugs plugin for Netscape? Is DVI OK? The Active-DVI package http://pauillac.inria.fr/activedvi/ allows embedding programs into DVI files, along with a host of other features for presentations (effects, links, transitions, ...). If you look at the demo included with the distribution you will see a slide with a copy of the Ocaml interpreter running inside a DVI page. Files using ActiveDVI specials are still viewable with, for example, xdvi, but of course most of the features are absent or mangled. -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379 From simonmar@microsoft.com Thu Mar 14 17:27:27 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Thu, 14 Mar 2002 17:27:27 -0000 Subject: HGL ang GHC on Win32 Message-ID: <9584A4A864BD8548932F2F88EB30D1C60897405B@TVP-MSG-01.europe.corp.microsoft.com> > That is a shame. I tried both suggestions (specifying=20 > position explicitly > and recompiling with fvia-c -- i had been using O all along)=20 > and neither > worked :(. >=20 > I also tried using 5.03, and got the following warnings: [ message deleted ] It looks like there are some prototypes missing: > C:\DOCUME~1\hdaume\LOCALS~1\Temp\ghc920.hc:59: warning: implicit > declaration of function `prim_rgb' GHC might not generate correct calls to these functions unless there is a visible prototype. In fact, taking this example, the definition of prim_rgb is DWORD prim_rgb(BYTE arg1,BYTE arg2,BYTE arg3) but its FFI declaration says foreign import ccall "prim_rgb" unsafe prim_rgb :: Word32 -> Word32 -> Word32 -> IO (Word32) this looks a bit strange - is there a green-card expert out there to explain what's going on? Why have the BYTEs been turned into Word32s? Cheers, Simon From max630@mail.ru Thu Mar 14 18:37:16 2002 From: max630@mail.ru (Max Kirillov) Date: Fri, 15 Mar 2002 00:37:16 +0600 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020314150534U.chak@cse.unsw.edu.au>; from chak@cse.unsw.edu.au on Thu, Mar 14, 2002 at 03:05:34PM +1100 References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> Message-ID: <20020315003716.A1621@max.home> On Thu, Mar 14, 2002 at 03:05:34PM +1100, Manuel M. T. Chakravarty wrote: > Again, XEmacs with the above mentioned Haskell mode can do > it. Just execute the function `htmlize-buffer' on a buffer > containing the Haskell source. As an example for the > generated output, have a look at > > http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html > > The detailed choice of colours is, of course, adjustable. > At least on a Unix machine, I am quite sure you can use > XEmacs also in batch mode to generate the HTML (eg, as part > of a Makefile), but I haven't actually used it that way yet. 1. Why CSS? Why did I need to enable Java in my Netscape to see the colours? Man, it's just to _indent_ and _paint_! 2. When I hear "translate to HTML" I imagine that underlined words which can be clicked to see, say, definition of function. Sadly, most htmlizers are focused on highlighting rather than navigation. The good news is that could be simply cured with postprocessing of the resulting html file using tags file. There are several tags generators for haskell, both for vim and emacs (ghc distribution contains 2 of them). So the problem can be "reduced to the already seen". Just today I've found the program which does the job for "vim documentation". It uses vim tags file and 2html.vim script which is in vim package. Though the idea is obvious, I've never seen before anybody think of it (maybe I'm the one who need it?). The program is very short perl script. I'll try to adopt it for common files (so, for the haskell too). The address: http://www.erebus.demon.nl/vim/ > Cheers, > Manuel Max. From C.Reinke@ukc.ac.uk Thu Mar 14 19:29:13 2002 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Thu, 14 Mar 2002 19:29:13 +0000 Subject: Hugs plugin, Haskell Browser In-Reply-To: Message from Max Kirillov of "Fri, 15 Mar 2002 00:37:16 +0600." <20020315003716.A1621@max.home> Message-ID: > 2. When I hear "translate to HTML" I imagine that underlined > words which can be clicked to see, say, definition of > function. Sadly, most htmlizers are focused on highlighting > rather than navigation. Why generate HTML pages if noone reads them?-) Take this obscure location, for instance: http://www.haskell.org/libraries/#docu admittedly, Jan Skibinski's Haskell module browser is currently only available via archives, but it wasn't HTML-based anyway, and the other two links still work. Here's another example of text colouring that can be clicked on (few people do, so it has become quite silent on the mailing list, try the first months for more action..): http://haskell.org/mailman/listinfo/haskelldoc Hth, Claus From matt@immute.net Thu Mar 14 22:29:59 2002 From: matt@immute.net (matt hellige) Date: Thu, 14 Mar 2002 16:29:59 -0600 Subject: Strictness (was: Is this tail recursive?) In-Reply-To: ; from sqrtofone@yahoo.com on Wed, Mar 13, 2002 at 10:47:18PM -0600 References: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: <20020314162959.A16282@metro.immute.net> [Jay Cox ] > > (+):: Num a => a -> a -> a therefore sum :: Num a => [a] -> a -> a > now, for any conceivable sum, you generally need both arguments to compute > it (or am I wrong?), so i guess you could say (+) should probably be > strict for both arguments. But how would you tell the compiler that? > > oh wait. > . o O 0 church numerals... peano numerals.... > > data Peano = Zero | Succ (Peano) > > sumpeano blah (Succ x) = sumpeano (Succ blah) x > sumpeano blah Zero = blah > > sumpeano not strict on first argument. > define instance Num for Peano. > > I dont even know if you could talk about strictness in either argument > with church numerals. (and I'm to lazy to remind myself what a church > numeral looks like precisely so that I could find out.) > i suppose this is getting a bit off-topic, but for any instance of Num with an additive identity, (+) probably doesn't need to be strict for both arguments, right? consider: sum 0 x = x sum x y = x + y if the first argument is 0, we don't need to inspect the second argument at all. if i'm correct, this just reinforces your point... m -- matt hellige matt@immute.net http://matt.immute.net From bhuffman@galois.com Thu Mar 14 23:59:39 2002 From: bhuffman@galois.com (Brian Huffman) Date: Thu, 14 Mar 2002 15:59:39 -0800 Subject: Strictness (was: Is this tail recursive?) Message-ID: <200203142359.g2ENxdY09415@localhost.localdomain> At 22:47 13/03/02 -0600, Jay Cox wrote: >Perhaps what could be done about this strictness business is to make a >kind of strictness annotation. Perhaps something that says (force the >second argument of function F before every call to F (including any time F >calls itself)). >... >here's a rough example. !a mean !a will be forced at its application (for >not knowing proper language to call it). > >strict_foldl :: (a -> b -> a) -> !a -> [b] -> a >strict_foldl = foldl > >of course, there has to be a number of things that must be propagated >whence you start adding these things. like for instance. >.... >How about it? Has there been any other proposals? (like maybe going as >far as a "Strictness Type" system?) In Haskell you can produce the desired behavior by using pattern guards. Since the pattern guards always get evaluated before the result does, they can be used to make things more strict. Here is the foldl example: strict x = seq x True foldl' :: (a -> b -> a) -> a -> [b] -> a foldl' f z [] = z foldl' f z (x:xs) | strict z = foldl' f (f z x) xs You can make multiple arguments strict by using && or similar, e.g.: f x y | strict x && strict y = ... f x y | all strict [x,y] = ... Of course, with the second example x and y must have the same type. Hope this helps. - Brian Huffman From sqrtofone@yahoo.com Fri Mar 15 04:10:22 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Thu, 14 Mar 2002 22:10:22 -0600 (CST) Subject: Strictness (was: Is this tail recursive?) In-Reply-To: <5.1.0.14.0.20020314102524.00a23010@mail.cs.tcd.ie> Message-ID: On Thu, 14 Mar 2002, Andrew Butterfield wrote: > I think the Clean type system does stuff like this - it certainly supports > strictness analysis and annotations: > - see http://www.cs.kun.nl/~clean/ for more details Thanks to both you and to Bernard James POPE for the replies. The embarrasing thing (for me) is that I'm ON the Clean mailing list! I should have known or remembered about clean's strictness annotations, though I really haven't ever coded anything in it. I intend to read anything those Clean(ers) happen to have on the subject. Cheers, Jay Cox PS: While I'm at it thanking people, thanks to Bjorn Lisper for relaying the fact that his server isn't censoring my messages from the haskell lists as well! From sqrtofone@yahoo.com Fri Mar 15 04:23:32 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Thu, 14 Mar 2002 22:23:32 -0600 (CST) Subject: Strictness! In-Reply-To: <200203142359.g2ENxdY09415@localhost.localdomain> Message-ID: On Thu, 14 Mar 2002, Brian Huffman wrote: > In Haskell you can produce the desired behavior by using pattern guards. > Since the pattern guards always get evaluated before the result does, they > can be used to make things more strict. Here is the foldl example: > > strict x = seq x True > > foldl' :: (a -> b -> a) -> a -> [b] -> a > foldl' f z [] = z > foldl' f z (x:xs) > | strict z = foldl' f (f z x) xs > > You can make multiple arguments strict by using && or similar, e.g.: > > f x y | strict x && strict y = ... > f x y | all strict [x,y] = ... > > Of course, with the second example x and y must have the same type. > Hope this helps. > > - Brian Huffman Thanks! that looks like a great haskell idiom to use! Jay Cox From chak@cse.unsw.edu.au Fri Mar 15 04:10:03 2002 From: chak@cse.unsw.edu.au (Manuel M. T. Chakravarty) Date: Fri, 15 Mar 2002 15:10:03 +1100 Subject: Hugs plugin, Haskell Browser In-Reply-To: <20020315003716.A1621@max.home> References: <1020313181332.ZM1221@popocatepetl.TechFak.Uni-Bielefeld.DE> <20020314150534U.chak@cse.unsw.edu.au> <20020315003716.A1621@max.home> Message-ID: <20020315151003N.chak@cse.unsw.edu.au> Max Kirillov wrote, > On Thu, Mar 14, 2002 at 03:05:34PM +1100, Manuel M. T. Chakravarty wrote: > > Again, XEmacs with the above mentioned Haskell mode can do > > it. Just execute the function `htmlize-buffer' on a buffer > > containing the Haskell source. As an example for the > > generated output, have a look at > > > > http://www.cse.unsw.edu.au/~chak/haskell/gtk/BoolEd.html > > > > The detailed choice of colours is, of course, adjustable. > > At least on a Unix machine, I am quite sure you can use > > XEmacs also in batch mode to generate the HTML (eg, as part > > of a Makefile), but I haven't actually used it that way yet. > > 1. Why CSS? CSS is fine, ... > Why did I need to enable Java in my Netscape to > see the colours? Man, it's just to _indent_ and _paint_! it is Netscape which is rotten ;-) There is no reason in a Web browser to have to activate extra languages to implement CSS...except bad software design. I'd suggest to get a proper browser like Mozilla http://mozilla.org/ or Galeon http://galeon.sourceforge.net/ (I particularly like the latter.) (Switching on JavaScript is sufficient, btw.) > 2. When I hear "translate to HTML" I imagine that underlined > words which can be clicked to see, say, definition of > function. Sadly, most htmlizers are focused on highlighting > rather than navigation. The good news is that could be > simply cured with postprocessing of the resulting html file > using tags file. There are several tags generators for > haskell, both for vim and emacs (ghc distribution contains 2 > of them). So the problem can be "reduced to the already > seen". It depends what you want. A tool which cross-references variable occurences, I would call a cross reference tool rather than an HTML pretty-printer. Cheers, Manuel From fjh@cs.mu.OZ.AU Fri Mar 15 09:47:49 2002 From: fjh@cs.mu.OZ.AU (Fergus Henderson) Date: Fri, 15 Mar 2002 20:47:49 +1100 Subject: uniqueness typing In-Reply-To: <3C8E86AD.2000801@ucalgary.ca>; from dgharrin@ucalgary.ca on Tue, Mar 12, 2002 at 03:52:29PM -0700 References: <006601c1ca02$d32a61c0$2e30e3c8@windows9> <3C8E86AD.2000801@ucalgary.ca> Message-ID: <20020315204749.A3136@hg.cs.mu.oz.au> On 12-Mar-2002, Dana Harrington wrote: > > I believe Mercury borrowed their uniqueness type (mode) system from > Clean. Nope. The support for unique modes in Mercury was developed before we were aware of Clean. They achieve similar aims, but it's a case of convergent evolution, because we were both trying to solve the same problem, rather than borrowing. (This is in contrast to e.g. Mercury's support for type classes, which was pretty much directly lifted from Haskell.) In fact Clean's support for uniqueness is better than Mercury's. In particular, Clean supports uniqueness polymorphism, whereas Mercury only supports overloading on uniqueness. -- Fergus Henderson | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: | -- the last words of T. S. Garp. From consel@labri.fr Fri Mar 15 09:48:56 2002 From: consel@labri.fr (Charles Consel) Date: Fri, 15 Mar 2002 10:48:56 +0100 Subject: LAST CALL FOR PAPERS: Generators and Components (GCSE/SAIG'02) Message-ID: <3C91C388.4EF9EF98@labri.fr> = LAST CALL FOR PAPERS = Submission Deadline: March 21, 2002 = The First ACM SIGPLAN/SIGSOFT Conference on Generators and Components (GCSE/SAIG'02) = Supported by the National Science Foundation (NSF) Pittsburgh, PA, October 6-8, 2002. = http://www.cs.yale.edu/~taha/gcse-saig/cfp02.html = Invited Speakers: = * Neil Jones, University of Denmark * Catuscia Palamidessi, Penn State University * Janos Sztipanovits, Vanderbilt University = Program generation has the prospect of being an integral part of a wide range of software development processes. Many recent studies investigate different aspects of program generation, including their semantics, their application, and their implementation. Existing theories and systems address both high-level (source) language and low-level (machine) language generation. A number of programming languages now support program generation and manipulation, with different goals, implementation techniques, and targeted at different applications. The goal of this conference is to provide a meeting place for researchers and practitioners interested in this topic. = A particular area of interest is component-based software development, which bears the promise of considerable productivity increases to software development comparable to the introduction of the assembly line in manufacturing. But due to the very same sophistication that makes components useful, their maintenance can be hard. Generative programming presents a promising approach to alleviating the above problems, as changes affecting components can now be more effectively managed during the generation process rather than at the component level. = The goal of this joint event is to foster further cross-fertilization between the software engineering research community on the one hand, and the programming languages community on the other, in addition to supporting the original research goals of both GCSE and SAIG communities. We seek papers both in software engineering and programming languages, and especially those that bridge the gap. Being accessible to both communities at the same time is also valued. = The conference solicits submissions related (but not limited) to: = * Generative Programming: Reuse, meta-programming, partial evaluation, multi-stage and multi-level languages, * Semantics, type systems, symbolic computation, linking and explicit substitution, in-lining and macros, templates, program transformation, * Runtime code generation, compilation, active libraries, synthesis from specifications, development methods, generation of non-code artifacts, formal methods. Reflection. * Component-Based Software Engineering: Reuse, distributed platforms, distributed systems, evolution, analysis and design patterns, development methods, formal methods * Integration of Generative and Component-Based Approaches * Domain Engineering, analysis, and languages * Separation of Concerns: Aspect-Oriented Programming, Intentional * Programming, and Multi-Dimensional Separation of Concerns * Product Lines and generic architectures for that purpose. * Industrial Applications of Components and Generative Programming = Reports on applications of these techniques to real-world problems are especially encouraged, as are submissions that relate ideas and concepts from several of these topics, or bridge the gap between theory and practice. The program committee is happy to advise on the appropriateness of a particular subject. = General Chair: = Walid Taha, Yale University, USA. = Program Chair (GCSE focus): = Don Batory, University of Texas at Austin, USA. = Program Chair (SAIG focus): = Charles Consel, INRIA, LaBRI, France. = Program Committee (GCSE focus): = Jan Bosch , University of Groningen Greg Butler, Concordia University Prem Devanbu, University of California at Davis Cristina Gacek, University of Newcastle upon Tyne Stan Jarzabek, National University of Singapore Kyo Kang, Pohang University of Science and Technology Peter Knauber, Fraunhofer Institute for Experimental Software Engineering Hausi Muller, University of Victoria Nenad Medvidovic, University of Southern California Wolfgang Pree, University of Constance Yannis Smaragdakis, Georgia Institute of Technology Douglas R. Smith , Kestrel Institute = Program Committee (SAIG focus): = Craig Chambers, University of Washington Shigeru Chiba, Tokyo Institute of Technology Pierre Cointe, Ecole des Mines de Nantes Dawson Engler, Stanford University Siau cheng Khoo, National University of Singapore Gregor Kiczales, University of British Columbia Martin Odersky, Ecole Polytechnique F=E9d=E9rale de Lausanne Calton Pu, Georgia Institute of Technology Peter Thiemann, Universit=E4t Freiburg Andrew Tolmach, Portland State University = Submission Details: Authors are invited to submit papers of at most 5000 words (excluding figures), in postscript format (letter or A4), using the electronic submission form by March 21st, 2002. This deadline is firm. Both position and technical papers are welcome (Please indicate at time of submission.) Authors will be notified of acceptance by May 14th, 2002. Final version of the papers must be submitted by July 14, 2002. = Format: The three day conference will contain slots for technical papers (45 minutes) and position papers (30 minutes). Both times include discussion. Position papers are expected to describe important future directions, ongoing work, and survey previous results. This category is best thought of as one for "competitive invited papers". Technical papers are expected to contain novel results. All papers will be reviewed by the program committee for the above-mentioned criteria, in addition to correctness and clarity. Simultaneous submission to other venues is not allowed, as is submission of previously published material. In addition, there will be time allocated for open discussions at the end of the conference. Proceedings will be published as an LNCS volume. = Special Note on Combined Event: While the Program Committee is divided into two focus areas corresponding the parent events (GCSE and SAIG), there will be one unified program committee meeting. At the time of submission, authors must indicate whether they intend the paper for the GCSE audience, SAIG audience, or BOTH. The last category is the default, and is strongly encouraged. Papers submitted explicitly to only one focus will be accepted or rejected by the respective Program Chair. For papers submitted to BOTH, it is enough that one of the two Program Chairs accepts the paper. All members of the PC will allowed to bid for and review all papers, and cross-bidding is encouraged. The conference itself will not be divided along focus lines. Rather, an attempt will be made to ensure that each session is of interest to both parent communities. From simonpj@microsoft.com Fri Mar 15 10:11:13 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 15 Mar 2002 02:11:13 -0800 Subject: ICFP'02: 6 days to go. Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041B2F@RED-MSG-10.redmond.corp.microsoft.com> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Last chance for your ICFP'02 paper: 6 days to go. =20 Don't let me down! Simon =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ICFP 2002 International Conference on Functional Programming October 4-6, 2002, Pittsburgh, USA Final call for papers -------------------------------------------- Submission deadline: 21 March 2002 18:00 UTC -------------------------------------------- Program Chair: Simon Peyton Jones (Microsoft Research) Full call for papers including submission details:=20 http://icfp2002.cs.brown.edu/CfP/ =20 ICFP 2002 seeks original papers on the full spectrum of the art, science, and practice of functional programming. The conference invites submissions on all topics ranging from principles to practice, from foundations to features, and from abstraction to application. The scope covers all languages that encourage programming with functions, including both purely applicative and imperative languages, as well as languages that support objects and concurrency. Topics of interest include, but are not limited to, the following: Foundations: formal semantics, lambda calculus, type theory, monads, continuations, control, state, effects. Design: modules and type systems, concurrency and distribution, components and composition, relations to object-oriented and logic programming, multiparadigm programming. Implementation: abstract machines, compile-time and run-time optimization, just-in-time compilers, memory management, foreign-function and component interfaces. Transformation and analysis: abstract interpretation, partial evaluation, program transformation, theorem proving, specification and verification. Software development techniques for functional programming: design patterns, specification, verification and validation, debugging, test generation, etc. Human productivity of functional programming: visual, graphical (etc) approaches, evaluating language usability, empirical studies of human effectiveness, etc. Applications and domain-specific languages: scientific and numerical computing, symbolic computing and artificial intelligence, systems programming, databases, graphic user interfaces, multimedia programming, Web programming. Practice and experience: functional programming in education and industry, ramifications on other paradigms and computing disciplines. Functional pearls elegant, instructive examples of functional programming. General Chair: Mitchell Wand (Northeastern University) Program Committee Matthias Blume (Lucent)=20 Margaret Burnett (Oregon State University)=20 Manuel Chakravarty (University of New South Wales)=20 Matthew Flatt (University of Utah)=20 Haruo Hosoya (Kyoto University)=20 Uwe Nestmann (EPFL, Lausanne)=20 Chris Okasaki (United States Military Academy)=20 Norman Ramsey (Harvard University)=20 David Sands (Chalmers University)=20 Olin Shivers (Georgia Tech)=20 Stephanie Weirich (Cornell)=20 Joe Wells (Heriot Watt University) From Malcolm.Wallace@cs.york.ac.uk Fri Mar 15 17:42:26 2002 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Fri, 15 Mar 2002 17:42:26 +0000 Subject: ANNOUNCE: Hat 1.12 Message-ID: ------------------------------------ hat-1.12, nhc98-1.12, and hmake-3.02 ------------------------------------ We are pleased to announce a new release of Hat, the Haskell tracing (an debugging) system, together with supporting releases of the nhc98 compiler and the hmake compilation manager. This release of Hat is a major release. It incorporates new trace-browsing tools, and for the first time has support to compile programs for tracing with GHC in addition to nhc98. for information on hat: http://www.cs.york.ac.uk/fp/hat/ for information on nhc98: http://www.cs.york.ac.uk/fp/nhc98/ for information on hmake: http://www.cs.york.ac.uk/fp/hmake/ for downloads: http://www.cs.york.ac.uk/fp/nhc98/download.html (Hat and hmake are packaged together with nhc98 in a single download.) If you haven't already tried out the Hat tracing system, now is a good time to have a go! New features worth noting are: * There is a new tutorial introduction to Hat, showing how to generate program traces, how to explore them, and how they can help you to debug Haskell programs. * All the interactive trace browsing tools are implemented in Haskell, including a new, simpler, textual version of hat-trail. They all inter-operate, and use a similar command syntax. * The trace-generating machinery can now be used with GHC in addition to nhc98: just use `hmake -ghc -hat' instead of `hmake -nhc98 -T'. (However, for the moment, you still need to download and install the nhc98 distribution, even when you intend to trace programs only with GHC.) In addition there have also been many minor bugfixes to nhc98 and hmake. Bug reports should be sent to nhc-bugs@haskell.org. Discussion of the Hat system belongs on nhc-users@haskell.org. Regards, The Hat team at York From ronny@cs.kun.nl Fri Mar 15 18:27:32 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 15 Mar 2002 19:27:32 +0100 Subject: Isn't this tail recursive? In-Reply-To: <1015814162.18982.12.camel@kryptonitespoon.maurers> Message-ID: <5.1.0.14.0.20020315183201.02f3c830@localhost> Another way to evaluate the accumulating counts in each call is to combine them in a data type and use strictness flags for the individual count fields. (See , "Strictness Flags") For example (untested): data Counts = Counts !Int !Int !Int countAll :: String -> Counts countAll str = countAll' str 0 (Counts 0 0 0) // shouldn't this be 1 (start with new word)? where countAll' [] _ counts = counts countAll' (c:cs) newWord (Counts nl nw nc) = case charKind c of Normal -> countAll' cs 0 (Counts nl (nw+newWord) (nc+1)) White -> countAll' cs 1 (Counts nl nw (nc+1)) Newline -> countAll' cs 1 (Counts (nl+1) nw (nc+1)) The function countAll' is now strict in its counts argument. Because of the strictness flags in Counts, each count is evaluated. I think this looks nicer than using local calls to `seq`. Cheers, Ronny Wichers Schreur From ronny@cs.kun.nl Fri Mar 15 18:29:38 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 15 Mar 2002 19:29:38 +0100 Subject: Isn't this tail recursive? In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C6089735C3@TVP-MSG-01.europe .corp.microsoft.com> Message-ID: <5.1.0.14.0.20020315191319.02f20188@localhost> Simon Marlow writes (to the Haskell mailing list) >The function as written is only strict in its list argument, and >its usage site only demands the 'l' argument strictly. So [..] >the compiler can't possibly evaluate the accumulating parameters >of countAll' strictly. The Clean compiler uses an optimisation that works in this case. After observing that main evaluates all elements of the tuple result (because of the shows), the compiler creates a special version of countAll with (Clean) type countAll :: String -> (!Int, !Int, !Int) and the same for countAll`. It than calls the strictness analyzer again for these functions. Cheers, Ronny Wichers Schreur From ronny@cs.kun.nl Fri Mar 15 18:33:50 2002 From: ronny@cs.kun.nl (Ronny Wichers Schreur) Date: Fri, 15 Mar 2002 19:33:50 +0100 Subject: Strictness In-Reply-To: <20020314162959.A16282@metro.immute.net> References: <200203130812.JAA08139@ripper.it.kth.se> Message-ID: <5.1.0.14.0.20020315182620.00b08180@localhost> matt hellige writes (to the haskell mailing list): >[..] consider: > sum 0 x = x > sum x y = x + y > >if the first argument is 0, we don't need to inspect the second >argument at all. But sum returns its second argument, so it's still strict in that argument. Cheers, Ronny Wichers Schreur From max630@mail.ru Fri Mar 15 19:27:28 2002 From: max630@mail.ru (Max Kirillov) Date: Sat, 16 Mar 2002 01:27:28 +0600 Subject: Hugs plugin, Haskell Browser In-Reply-To: ; from C.Reinke@ukc.ac.uk on Thu, Mar 14, 2002 at 07:29:13PM +0000 References: Message-ID: <20020316012728.A1165@max.home> On Thu, Mar 14, 2002 at 07:29:13PM +0000, C.Reinke wrote: > >> 2. When I hear "translate to HTML" I imagine that underlined >> words which can be clicked to see, say, definition of >> function. Sadly, most htmlizers are focused on highlighting >> rather than navigation. > > Why generate HTML pages if noone reads them?-) I said "most"! :) (To be honest, I thought about "all") Well, I mostly referred at multi-lingual html grnerators which come with that unix editors. There are alot of xref tools for every given language, but that zoo is quite hard to maintain, if you have to live with, say, 4 languages. Max. From claus.reinke@talk21.com Fri Mar 15 22:05:55 2002 From: claus.reinke@talk21.com (Claus Reinke) Date: Fri, 15 Mar 2002 22:05:55 -0000 Subject: Hugs plugin, Haskell Browser References: <20020316012728.A1165@max.home> Message-ID: <00d501c1cc6d$9513f820$ae1ffea9@Standard> > >> function. Sadly, most htmlizers are focused on highlighting > >> rather than navigation. .. > I said "most"! :) (To be honest, I thought about "all") just wanted to point out that there have been several hyperlinking HTML documentation generators for Haskell (in fact, from memory I'm quite sure there have been more than the two listed:-). > Well, I mostly referred at multi-lingual html grnerators > which come with that unix editors. There are alot of xref > tools for every given language, but that zoo is quite hard > to maintain, if you have to live with, say, 4 languages. Now that is an entirely different problem. As you've mentioned, tags-generators and "syntax" definitions exist for many language/ editor-combinations, so one could indeed imagine having to write only one extra tool per editor. Another option would be literate programming tools with hyperref support. However, much of the discussion surrounding documentation tools has been on what standard formats programmers would have to adopt so that a tool would be able to extract comments and associate them with the correct declarations. Would you hope programmers of different languages/paradigms to agree on such an issue if they cannot even agree on an editor/a language?-) On an unrelated issue, though within the subject: Haskellers using Vim might want to take a sneak preview of a little hack in which I'm using Hugs as a kind of Vim plugin (hopelessly inefficient in theory, but no problem in practice with last year's machines:). a Vim compiler plugin for Hugs (drop in one of Vim's compiler/ directories) http://www.cs.ukc.ac.uk/people/staff/cr3/tmp/hugs.vim its help file (drop in one of Vim's doc/ directories, and regenerate helptags in that directory; then type :help hugs.vim) http://www.cs.ukc.ac.uk/people/staff/cr3/tmp/hugs.txt (pre-release testers and feedback welcome:-) Cheers, Claus -- Research Opportunity: Refactoring Functional Programs (UKC) Closing date: Friday 22 March 2002 !! http://www.cs.ukc.ac.uk/vacancies_dir/r02-24.html From sqrtofone@yahoo.com Sat Mar 16 02:16:49 2002 From: sqrtofone@yahoo.com (Jay Cox) Date: Fri, 15 Mar 2002 20:16:49 -0600 (CST) Subject: Strictness In-Reply-To: <5.1.0.14.0.20020315182620.00b08180@localhost> Message-ID: Alright. I know the haskell community probably gets tired of my long winded posts. I This post probably shouldn't even be on haskell@haskell.org (more like on haskell-cafe). I also realize that these posts may not mean much to you; many of you may have figured out most of this strictness business long, long ago and you are long bored of me. But I do feel strictness misconceptions and such are a potentially big problem with using haskell. I even at one time decided haskell might not be worth learning (more) about because it seemed like it might be too hard to analyze memory usesage and the like to create efficient programs. I think I may eventually attempt to write a haskell lazyness/strictness FAQ. I feel a bit underqualified for the job, so I'm probably going to need help in verification of what I may say in it. If anything, I hope for some help so that i will not embarass the haskell community! Or, at the very least, I may eventially add something to the haskell wiki. I'm not sure which. Any critique is welcome. On Fri, 15 Mar 2002, Ronny Wichers Schreur wrote: > matt hellige writes (to the haskell mailing list): > > >[..] consider: > > sum 0 x = x > > sum x y = x + y > > > >if the first argument is 0, we don't need to inspect the second > >argument at all. > > But sum returns its second argument, so it's still strict in that > argument. Oh boy. You are right. sum 0 _|_ = _|_, since obviously x = x. but what about sum x _|_? assuming (+) for integers, (+) is strict on both arguments. thus sum x _|_ = x + _|_ = _|_ Thus that definition of sum is strict on both arguments. (Apologies to Matt Hellige for incorrect analysis in private message). That also means my sumpeano isn't just strict on the second argument. data Peano = Zero | Succ (Peano) sumpeano blah (Succ x) = sumpeano (Succ blah) x sumpeano blah Zero = blah If the initial second argument of sumpeano is Zero, then sumpeano IS strict on the second argument, by the same reasoning above. But if it is not, then sumpeano _|_ (Succ x) = sumpeano (Succ _|_) x. When sumpeano finally reaches Zero in the second argument (for a initial non-Zero argument) the result will be a cascade of Succ applications like (Succ.) (Succ.) (Succ.) (Succ.) _|_ which, well, is not equivalent to _|_ (nor will it be unless all applications have been forced.. Therefore sumpeano is, CONDITIONALLY strict in the first argument! (The reader may wonder why I chose the "(Succ.)" notation. I wanted to give pause to the fact that sumpeano is generating Succ "thunks" which will generate Succ (Succ (Succ ...))) etc, and not the actual structure. perhaps I'm trying to be overly accurate for this argument.) In all the literature I've read (which, by the way, is not much) I've never seen such a phrase as conditionaly strict or conditionally lazy. Is such a conseption as being conditionally strict or conditionally lazy fairly useful? Or is this where the phrase "non-strict" comes in? Hmmm, redefining sumpeano in terms of functions of 1 argument, (and switching around the arguments around for the sake of argument) May also give some insight. Either (sumpeano z) is a strict function, or, it isn't. sumpeano' Zero = id -- id _|_ = _|_ sumpeano' (Succ x) = \blah -> (sumpeano' x) (Succ blah) Yet of course there are functions in common use which one could say have arguments which are fully lazy. take the definiton of map. map f [] = [] map f (x:xs) = f x : map f xs f can be bottom easily. take length $ map _|_ [1..5] for example. (for your pretend bottom, you could use error, as in bottom = error "I'm _|_!") This is quite intriguing. I've learned something today. I hope my post proves usefull to somebody else. > Cheers, > > Ronny Wichers Schreur Thanks, Jay Cox From wolfgang@jeltsch.net Sat Mar 16 11:46:07 2002 From: wolfgang@jeltsch.net (Wolfgang Jeltsch) Date: Sat, 16 Mar 2002 12:46:07 +0100 Subject: Strictness In-Reply-To: =?iso-8859-1?B?PFBpbmUuTE5YLjQuMzMuMDIw?= =?iso-8859-1?Q?3151719420=2E5062-100000=40localhost=2Elocaldomain=3E=3B_f?= =?iso-8859-1?Q?rom_sqrtofone=40yahoo=2Ecom_on_Sam=2C_M=E4?= =?iso-8859-1?Q?r?= 16, 2002 at 03:16:49 +0100 References: <5.1.0.14.0.20020315182620.00b08180@localhost> Message-ID: <20020316124607.A1933@localhost> On Saturday, March 16, 2002, 03:16 CET Jay Cox wrote: > [...] > I think I may eventually attempt to write a haskell lazyness/strictness FAQ. Great! I'm very interested in it. > [...] Wolfgang From Jon.Fairbairn@cl.cam.ac.uk Sun Mar 17 19:06:44 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Sun, 17 Mar 2002 19:06:44 +0000 Subject: Standard Library report: List union In-Reply-To: Your message of "Mon, 11 Mar 2002 05:04:28 PST." <1113DDB24D4A2841951BFDF86665EE1901041AC3@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <20721.1016392004@cl.cam.ac.uk> > There's a remark at the beginning of 7.2 that says: > = > delete, (\\), union and intersect preserve the invariant=3D20 > that lists don't contain duplicates, provided that=3D20 > their first argument contains no duplicates. > = > The same applies to unionBy etc. This design is one > you might reasonably disagree with. I'd have thought > it would be more sensible to have the invariant that > *both* arguments to union and intersect are assumed > to be sets (no dups). = That's partly what I was alluding to, but either way I'd have thought that there were clearer definitions, for example: unionBy eq xs ys =3D xs ++ [y | y <- nubBy eq ys, not (any (eq y) xs)] J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From aciego@ctima.uma.es Mon Mar 18 07:58:55 2002 From: aciego@ctima.uma.es (Manuel Ojeda Aciego) Date: Mon, 18 Mar 2002 08:58:55 +0100 Subject: Final CFP: Unification in non-classical logics Message-ID: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D We apologize if you receive this more than once =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Final call for papers Unification in Non-Classical Logics --co-located with ICALP 2002-- July, 12-13, 2002, M=E1laga, Spain http://www.satd.uma.es/aciego/icalp-ws.html =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The workshop on Unification in Non-Classical Logics will be held in M=E1laga, as a workshop of the 29-th International Colloquium on Automata, Languages, and Programming (ICALP 2002), which is a very convenient forum for an open discussion of the subject of non-canonical unification, roughly depicted below. Aims and scope -------------- Unification in non-classical logics, with various approaches to handling generalised terms, has drawn more and more attention in recent years. It turns out to be among the most promising areas of research on non-classical logics and its applications. So far, most popular lines of research include fuzzy unification of (conventional) databases and the use of fuzzy concepts in information retrieval. Some international events based on these topics have been held so far, for instance, the 2nd Intl Workshop on Logic Programming and Soft Computing (LPSC'98), or the special session on Advances in Possibilistic Logic and Related Issues at the IFSA Congress in Vancouver, Canada (2001), have non-classical unification among their topics. This workshop at ICALP is conceived as a forum for the exchange of ideas relevant for the concept of unification in non-classical logics, including, but not limited to, the following topics (practical implementations and experiences as well as theoretical advances): * Unification in multiple-valued and fuzzy logic programming. * Unification based on similarities and fuzzy equivalence relations. * Categorical unification. * Practical use of non-classical unification, e.g. in expert systems and information retrieval. We expect potential participants from the following areas: multiple-valued logic, fuzzy logic, uncertainty in logic programming, categorical applications to computer science. The workshop will have a limited number of presentations and the organizers will apply a refereeing procedure accordingly. The format will be as a set of presentations followed by a round table discussion. As the number of participants is estimated not to be very large, time enough will be allocated for each presentation (between 30 and 40 minutes), thus helping to have a relaxed workshop atmosphere in which discussions are encouraged. Submission ---------- Authors are invited to submit an extended abstract of their papers, presenting original contributions to the workshop themes. The workshop proceedings will be published as an issue in the ENTCS series (Electronic Notes on Theoretical Computer Science). Submissions should be written in English and not exceed 15 pages using the ENTCS style, and sent to the organizers in either PS or PDF form, together with a text-only message containig: title, abstract and keywords, the author's full names, and address and e-mail for correspondence. Simultaneous submission to other meetings with published proceedings is not allowed. Important dates --------------- * 20.03.2002 Workshop paper submission deadline * 21.04.2002 Workshop paper acceptance notification * 10.05.2002 Workshop paper camera-ready deadline Organizing Committee -------------------- Patrik Eklund Manuel Ojeda-Aciego Dept. Computing Science Dept. Matematica Aplicada Umea University Universidad de Malaga mailto:peklund@cs.umu.se mailto:aciego@ctima.uma.es ---------------------------------------------------------- From S.J.Thompson@ukc.ac.uk Mon Mar 18 12:48:38 2002 From: S.J.Thompson@ukc.ac.uk (S.J.Thompson) Date: Mon, 18 Mar 2002 12:48:38 +0000 Subject: Functional and Declarative Programming in Education (FDPE02) Message-ID: Functional and Declarative Programming in Education (FDPE02) A one day workshop at PLI'02 Monday 7 October 2002, Pittsburgh, PA, USA CALL FOR SUBMISSIONS Functional and declarative programming plays an increasingly important role in computing education at all levels. The aim of this workshop is to bring together educators and others who are interested in exchanging ideas on how to use a functional or declarative programming style in the classroom. Submissions are sought in a variety of forms, including: - Standard presentations (30 minutes) - Short talks or "tricks of the trade" presentations (10 minutes) The organisers would also welcome other sorts of submissions, such as software demos, panels, very short talks and so on. Michael Hanus, University of Kiel, Germany Shriram Krishnamurthi, Brown University, RI, USA Simon Thompson, University of Kent, UK More details at the FPDE02 website: FDPE02: http://www.cs.ukc.ac.uk/people/staff/sjt/fdpe02/description.html PLI'02: http://pli2002.cs.brown.edu/ From batory@cs.utexas.edu Mon Mar 18 14:07:58 2002 From: batory@cs.utexas.edu (Don Batory) Date: Mon, 18 Mar 2002 08:07:58 -0600 Subject: Reminder: GCSE/SAIG Submissions Message-ID: <003f01c1ce86$56904700$258d5380@csres.utexas.edu> This is a multi-part message in MIME format. ------=_NextPart_000_003C_01C1CE54.04C61670 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Please excuse multiple listings of this announcement. CALL FOR PAPERS Submission Deadline: March 21, 2002 The First ACM SIGPLAN/SIGSOFT Conference on Generators and Components (GCSE/SAIG'02) Supported by the National Science Foundation (NSF) Pittsburgh, PA, October 6-8, 2002. http://www.cs.yale.edu/~taha/gcse-saig/cfp02.html Invited Speakers: * Neil Jones, University of Denmark * Catuscia Palamidessi, Penn State University * Janos Sztipanovits, Vanderbilt University Program generation has the prospect of being an integral part of a wide range of software development processes. Many recent studies investigate different aspects of program generation, including their semantics, their application, and their implementation. Existing theories and systems address both high-level (source) language and low-level (machine) language generation. A number of programming languages now support program generation and manipulation, with different goals, implementation techniques, and targeted at different applications. The goal of this conference is to provide a meeting place for researchers and practitioners interested in this topic. A particular area of interest is component-based software development, which bears the promise of considerable productivity increases to software development comparable to the introduction of the assembly line in manufacturing. But due to the very same sophistication that makes components useful, their maintenance can be hard. Generative programming presents a promising approach to alleviating the above problems, as changes affecting components can now be more effectively managed during the generation process rather than at the component level. The goal of this joint event is to foster further cross-fertilization between the software engineering research community on the one hand, and the programming languages community on the other, in addition to supporting the original research goals of both GCSE and SAIG communities. We seek papers both in software engineering and programming languages, and especially those that bridge the gap. Being accessible to both communities at the same time is also valued. The conference solicits submissions related (but not limited) to: * Generative Programming: Reuse, meta-programming, partial = evaluation, multi-stage and multi-level languages, * Semantics, type systems, symbolic computation, linking and explicit substitution, in-lining and macros, templates, program = transformation, * Runtime code generation, compilation, active libraries, synthesis = from specifications, development methods, generation of non-code = artifacts, formal methods. Reflection. * Component-Based Software Engineering: Reuse, distributed platforms, distributed systems, evolution, analysis and design patterns, development methods, formal methods * Integration of Generative and Component-Based Approaches * Domain Engineering, analysis, and languages * Separation of Concerns: Aspect-Oriented Programming, Intentional * Programming, and Multi-Dimensional Separation of Concerns * Product Lines and generic architectures for that purpose. * Industrial Applications of Components and Generative Programming Reports on applications of these techniques to real-world problems are especially encouraged, as are submissions that relate ideas and concepts from several of these topics, or bridge the gap between theory and practice. The program committee is happy to advise on the appropriateness of a particular subject. General Chair: Walid Taha, Yale University, USA. Program Chair (GCSE focus): Don Batory, University of Texas at Austin, USA. Program Chair (SAIG focus): Charles Consel, INRIA, LaBRI, France. Program Committee (GCSE focus): Jan Bosch , University of Groningen Greg Butler, Concordia University Prem Devanbu, University of California at Davis Cristina Gacek, University of Newcastle upon Tyne Stan Jarzabek, National University of Singapore Kyo Kang, Pohang University of Science and Technology Peter Knauber, Fraunhofer Institute for Experimental Software Engineering Hausi Muller, University of Victoria Nenad Medvidovic, University of Southern California Wolfgang Pree, University of Constance Yannis Smaragdakis, Georgia Institute of Technology Douglas R. Smith , Kestrel Institute Program Committee (SAIG focus): Craig Chambers, University of Washington Shigeru Chiba, Tokyo Institute of Technology Pierre Cointe, Ecole des Mines de Nantes Dawson Engler, Stanford University Siau cheng Khoo, National University of Singapore Gregor Kiczales, University of British Columbia Martin Odersky, Ecole Polytechnique F=E9d=E9rale de Lausanne Calton Pu, Georgia Institute of Technology Peter Thiemann, Universit=E4t Freiburg Andrew Tolmach, Portland State University Submission Details: Authors are invited to submit papers of at most 5000 words (excluding figures), in postscript format (letter or A4), using the electronic submission form by March 21st, 2002. This deadline is firm. Both position and technical papers are welcome (Please indicate at time of submission.) Authors will be notified of acceptance by May 14th, 2002. Final version of the papers must be submitted by July 14, 2002. Format: The three day conference will contain slots for technical papers (45 minutes) and position papers (30 minutes). Both times include discussion. Position papers are expected to describe important future directions, ongoing work, and survey previous results. This category is best thought of as one for "competitive invited papers". Technical papers are expected to contain novel results. All papers will be reviewed by the program committee for the above-mentioned criteria, in addition to correctness and clarity. Simultaneous submission to other venues is not allowed, as is submission of previously published material. In addition, there will be time allocated for open discussions at the end of the conference. Proceedings will be published as an LNCS volume. Special Note on Combined Event: While the Program Committee is divided into two focus areas corresponding the parent events (GCSE and SAIG), there will be one unified program committee meeting. At the time of submission, authors must indicate whether they intend the paper for the GCSE audience, SAIG audience, or BOTH. The last category is the default, and is strongly encouraged. Papers submitted explicitly to only one focus will be accepted or rejected by the respective Program Chair. For papers submitted to BOTH, it is enough that one of the two Program Chairs accepts the paper. All members of the PC will allowed to bid for and review all papers, and cross-bidding is encouraged. The conference itself will not be divided along focus lines. Rather, an attempt will be made to ensure that each session is of interest to both parent communities. ------=_NextPart_000_003C_01C1CE54.04C61670 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
    Please excuse multiple listings = of this=20 announcement.
     

              &nbs= p;            = ;    =20 CALL FOR PAPERS
     
               &n= bsp;     =20 Submission Deadline: March 21, 2002
     
               &n= bsp;=20 The First ACM SIGPLAN/SIGSOFT Conference=20 on
               &= nbsp;  =20 Generators and Components (GCSE/SAIG'02)
     
              Supported by = the=20 National Science Foundation=20 (NSF)
              &nbs= p;      =20 Pittsburgh, PA, October 6-8, 2002.
     
              http://www.cs.= yale.edu/~taha/gcse-saig/cfp02.html
     
    Invited Speakers:
     
    * Neil Jones, University of Denmark
    * Catuscia Palamidessi, Penn = State=20 University
    * Janos Sztipanovits, Vanderbilt University
     
    Program generation has the prospect of being an integral part of = a
    wide=20 range of software development processes. Many recent = studies
    investigate=20 different aspects of program generation, including their
    semantics, = their=20 application, and their implementation. Existing
    theories and systems = address=20 both high-level (source) language and
    low-level (machine) language=20 generation. A number of programming
    languages now support program = generation=20 and manipulation, with
    different goals, implementation techniques, = and=20 targeted at different
    applications. The goal of this conference is to = provide=20 a meeting
    place for researchers and practitioners interested in this=20 topic.
     
    A particular area of interest is component-based software=20 development,
    which bears the promise of considerable productivity = increases=20 to
    software development comparable to the introduction of the=20 assembly
    line in manufacturing. But due to the very same = sophistication=20 that
    makes components useful, their maintenance can be hard. =20 Generative
    programming presents a promising approach to alleviating = the=20 above
    problems, as changes affecting components can now be more=20 effectively
    managed during the generation process rather than at the=20 component
    level.
     
    The goal of this joint event is to foster further=20 cross-fertilization
    between the software engineering research = community on=20 the one hand,
    and the programming languages community on the other, = in=20 addition to
    supporting the original research goals of both GCSE and=20 SAIG
    communities. We seek papers both in software engineering=20 and
    programming languages, and especially those that bridge the gap.=20 Being
    accessible to both communities at the same time is also = valued.
     
    The conference solicits submissions related (but not limited) = to:
     
       * Generative Programming: Reuse, meta-programming, = partial=20 evaluation,
            multi-stage = and=20 multi-level languages,
       * Semantics, type systems, = symbolic=20 computation, linking and = explicit
           =20 substitution, in-lining and macros, templates, program=20 transformation,
       * Runtime code generation, compilation, = active=20 libraries, synthesis from
           =20 specifications, development methods, generation of non-code=20 artifacts,
            formal = methods. =20 Reflection.
       * Component-Based Software Engineering: = Reuse,=20 distributed platforms,
            = distributed=20 systems, evolution, analysis and design=20 patterns,
            development = methods,=20 formal methods
       * Integration of Generative and = Component-Based=20 Approaches
       * Domain Engineering, analysis, and=20 languages
       * Separation of Concerns: Aspect-Oriented = Programming,=20 Intentional
       * Programming, and Multi-Dimensional = Separation of=20 Concerns
       * Product Lines and generic architectures for = that=20 purpose.
       * Industrial Applications of Components and = Generative=20 Programming
     
    Reports on applications of these techniques to real-world problems=20 are
    especially encouraged, as are submissions that relate ideas=20 and
    concepts from several of these topics, or bridge the gap=20 between
    theory and practice. The program committee is happy to advise = on=20 the
    appropriateness of a particular subject.
     

    General Chair:
     
          Walid Taha, Yale University, = USA.
     
    Program Chair (GCSE focus):
     
          Don Batory, University of Texas at = Austin,=20 USA.
     
    Program Chair (SAIG focus):
     
          Charles Consel, INRIA, LaBRI, = France.
     
    Program Committee (GCSE focus):
     
          Jan Bosch , University of=20 Groningen
          Greg Butler, Concordia=20 University
          Prem Devanbu, University of = California at Davis
          Cristina Gacek, = University=20 of Newcastle upon Tyne
          Stan Jarzabek, = National=20 University of Singapore
          Kyo Kang, = Pohang=20 University of Science and Technology
          = Peter=20 Knauber, Fraunhofer Institute
           = for=20 Experimental Software Engineering
          = Hausi=20 Muller, University of Victoria
          Nenad=20 Medvidovic, University of Southern = California
         =20 Wolfgang Pree, University of Constance
          = Yannis=20 Smaragdakis, Georgia Institute of = Technology
         =20 Douglas R. Smith , Kestrel Institute
     
    Program Committee (SAIG focus):
     
          Craig Chambers, University of=20 Washington
          Shigeru Chiba, Tokyo = Institute of=20 Technology
          Pierre Cointe, Ecole des = Mines de=20 Nantes
          Dawson Engler, Stanford=20 University
          Siau cheng Khoo, National=20 University of Singapore
          Gregor = Kiczales,=20 University of British Columbia
          Martin = Odersky,=20 Ecole Polytechnique F=E9d=E9rale de = Lausanne
         =20 Calton Pu, Georgia Institute of = Technology
         =20 Peter Thiemann, Universit=E4t Freiburg
          = Andrew=20 Tolmach, Portland State University
     
    Submission Details: Authors are invited to submit papers of at = most
    5000=20 words (excluding figures), in postscript format (letter or A4),
    using = the=20 electronic submission form by March 21st, 2002. This
    deadline is = firm. Both=20 position and technical papers are welcome
    (Please indicate at time of = submission.) Authors will be notified of
    acceptance by May 14th, = 2002. =20 Final version of the papers must be
    submitted by July 14, 2002.
     
    Format: The three day conference will contain slots for = technical
    papers=20 (45 minutes) and position papers (30 minutes). Both times
    include=20 discussion.  Position papers are expected to describe
    important = future=20 directions, ongoing work, and survey previous
    results. This category = is best=20 thought of as one for "competitive
    invited papers".  Technical = papers=20 are expected to contain novel
    results.  All papers will be = reviewed by=20 the program committee for the
    above-mentioned criteria, in addition = to=20 correctness and clarity.
    Simultaneous submission to other venues is = not=20 allowed, as is
    submission of previously published material. In = addition,=20 there will
    be time allocated for open discussions at the end of the=20 conference.
    Proceedings will be published as an LNCS volume.
     
    Special Note on Combined Event: While the Program Committee is=20 divided
    into two focus areas corresponding the parent events (GCSE = and=20 SAIG),
    there will be one unified program committee meeting.  At = the time=20 of
    submission, authors must indicate whether they intend the paper = for
    the=20 GCSE audience, SAIG audience, or BOTH.  The last category is=20 the
    default, and is strongly encouraged.  Papers submitted = explicitly=20 to
    only one focus will be accepted or rejected by the respective=20 Program
    Chair.  For papers submitted to BOTH, it is enough that = one of=20 the two
    Program Chairs accepts the paper.  All members of the PC = will=20 allowed
    to bid for and review all papers, and cross-bidding is=20 encouraged.
    The conference itself will not be divided along focus=20 lines.  Rather,
    an attempt will be made to ensure that each = session is=20 of interest to
    both parent communities.
     

     
    ------=_NextPart_000_003C_01C1CE54.04C61670-- From gmh@Cs.Nott.AC.UK Mon Mar 18 14:27:51 2002 From: gmh@Cs.Nott.AC.UK (Graham Hutton) Date: Mon, 18 Mar 2002 14:27:51 +0000 Subject: PhD studentship in Nottingham Message-ID: <20020318142822.80CDF422222@www.haskell.org> Dear all, I'm seeking applicants for a PhD studentship in the area of functional programming, to start on 1st October 2002 for a period of three years. You will normally require a first-class Honours degree (or equivalent qualification) in Computer Science and/or Mathematics, and some experience of functional programming. If you are interested in the possibility of such a PhD position, in the first instance please email your full CV, including the results of all your university examinations to date. Best wishes, Graham +---------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | Foundations of Programming Group Web : www.cs.nott.ac.uk/~gmh | | School of Computer Science and IT | | University of Nottingham | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB Phone : +44 (0)115 951 4220 | | United Kingdom Fax : +44 (0)115 951 4254 | +---------------------------------------------------------------------+ From heringto@cs.unc.edu Mon Mar 18 17:37:12 2002 From: heringto@cs.unc.edu (Dean Herington) Date: Mon, 18 Mar 2002 12:37:12 -0500 Subject: question about concurrency implementation Message-ID: <3C9625C8.1E8FDCD8@cs.unc.edu> I'm curious about the implementation of Concurrent Haskell in GHC and Hugs. Does access to values possibly shared among threads cost the same in Concurrent Haskell as in regular Haskell? I'm guessing the answer is "yes", because Concurrent Haskell is provided by default in GHC. If the costs are the same, does that rely on there being no true concurrency in the current implementations? How would the cost change if true concurrency were provided? Wouldn't thunk evaluation involve mutual exclusion? Dean Herington From ajc99@aber.ac.uk Mon Mar 18 17:43:49 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Mon, 18 Mar 2002 17:43:49 +0000 Subject: using less stack Message-ID: <3C962755.7080109@aber.ac.uk> I have stack problems: my program uses too much stack. I suspect, from removing bits of code, that it's due to a foldr in my program. If I use foldr or foldl on a long list (eg >500 bulky elements for a 3M stack), is this likely to be filling the stack? What is it that gets stored on the stack? If so, is there an obvious refactoring of the fold to use? Amanda -- Amanda Clare http://users.aber.ac.uk/ajc99/ Tel: +44 (0)1970 621787 Fax: +44 (0)1970 622455 Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB From simonpj@microsoft.com Mon Mar 18 17:50:04 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Mon, 18 Mar 2002 09:50:04 -0800 Subject: Haskell 98 report: March release Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041B5A@RED-MSG-10.redmond.corp.microsoft.com> Folks Before I get buried in ICFP submissions I thought I should get out the H98 report draft. It's in the usual place: http://research.microsoft.com/~simonpj/haskell98-revised Main changes since the Dec release are: Much improved informal semantics of pattern matching (3.17). Minor changes to the lexical syntax for white space (!). Two extra productions for expressions, which makes the treatment of sections align with the text in 3.5. Add notes in three places about hard-to-parse constructs.=20 This is my eventual solution to some dark corners in the=20 grammar (Chapter 3). Allow duplicates in the subordinate names of export lists (5.2). Remark that Eq and Ord are strict in both arguments (Appendix D.1).=20 plus quite a few other minor corrections. As ever, your careful proofreading, esp of the new parts, would be most helpful. From simonmar@microsoft.com Mon Mar 18 17:50:10 2002 From: simonmar@microsoft.com (Simon Marlow) Date: Mon, 18 Mar 2002 17:50:10 -0000 Subject: question about concurrency implementation Message-ID: <9584A4A864BD8548932F2F88EB30D1C608AA4458@TVP-MSG-01.europe.corp.microsoft.com> > I'm curious about the implementation of Concurrent Haskell in GHC and > Hugs. Does access to values possibly shared among threads=20 > cost the same > in Concurrent Haskell as in regular Haskell? I'm guessing=20 > the answer is > "yes", because Concurrent Haskell is provided by default in=20 > GHC. "yes" > If the costs are the same, does that rely on there being no true=20 > concurrency in > the current implementations? It depends what you mean by true concurrency: from the point of view of the Haskell programmer, GHC's implementation of concurrency is "almost" preemptive, because we can context-switch at any allocation. Most computation does some allocation, but it's possible to write functions that don't (although these tend to be on the trivial side - an optimised nfib won't allocate, for example). We could artificially cause all computation to do some allocation to avoid this problem, but we haven't found it necessary so far. But I suspect by "true concurrency" you're referring at the kind of concurrent processes that can be executed on multiple CPUs simultaneously. We did investigate doing this a while back, and found that the locking required on thunks was very expensive (slowed down the program by at least 2x on the bog-standard SMP machine we had here). However there are some clever techniques that can be used to reduce the cost - giving each process its own private allocation area and only degrading to full locking for access to the shared portion of the heap is one such technique we experimented with briefly but I don't have any concrete benchmarks I'm afraid. Also you really need a multithreaded garbage collector, which is a lot of work. Cheers, Simon From ajc99@aber.ac.uk Mon Mar 18 17:59:07 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Mon, 18 Mar 2002 17:59:07 +0000 Subject: using less stack References: <3C962755.7080109@aber.ac.uk> Message-ID: <3C962AEB.9070505@aber.ac.uk> Apologies for the typo: that should have been 50000 elements, not 500. Amanda Clare wrote: > I have stack problems: my program uses too much stack. I suspect, from > removing bits of code, that it's due to a foldr in my program. If I use > foldr or foldl on a long list (eg >500 bulky elements for a 3M stack), > is this likely to be filling the stack? What is it that gets stored on > the stack? If so, is there an obvious refactoring of the fold to use? > > Amanda > > -- > Amanda Clare http://users.aber.ac.uk/ajc99/ > Tel: +44 (0)1970 621787 Fax: +44 (0)1970 622455 > Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > > From Jon.Fairbairn@cl.cam.ac.uk Mon Mar 18 19:14:16 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Mon, 18 Mar 2002 19:14:16 +0000 Subject: using less stack In-Reply-To: Your message of "Mon, 18 Mar 2002 17:59:07 GMT." <3C962AEB.9070505@aber.ac.uk> Message-ID: <29465.1016478856@cl.cam.ac.uk> > Apologies for the typo: that should have been 50000 elements, not 500. > = > Amanda Clare wrote: > > I have stack problems: my program uses too much stack. I suspect, fro= m = > > removing bits of code, that it's due to a foldr in my program. If I u= se = > > foldr or foldl on a long list (eg >500 bulky elements for a 3M stack)= , = > > is this likely to be filling the stack? The fold itself won't be filling the stack. Without seeing some of the code it's hard to tell, but the most common cause of this sort of problem is a lack of strictness. foldr (+) 0 [0..5000] doesn't use up stack for the fold, but it builds a suspension for all 5000 additions, and evaluating that /does/ use stack unless the compiler has spotted that (+) is strict. (What compiler/interpreter are you using?) > > What is it that gets stored on = > > the stack? If so, is there an obvious refactoring of the fold to use?= The solution is to stick in $! judiciously and use foldr' (which seems to have got dropped from the standard libraries at some point, so you'll have to write your own) that uses $!. J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From senganb@ia.nsc.com Mon Mar 18 19:19:21 2002 From: senganb@ia.nsc.com (senganb@ia.nsc.com) Date: Mon, 18 Mar 2002 14:19:21 -0500 Subject: Haskell slicing tool? Message-ID: <20020318141921.582b412f.senganb@ia.nsc.com> Are there any tools to perform program slicing on Haskell? I often find myself wanting to find all "fromJusts" invoked from the current function, or all functions that use a particular member of my monad's ADT. Sengan From reid@cs.utah.edu Mon Mar 18 20:47:26 2002 From: reid@cs.utah.edu (Alastair David Reid) Date: 18 Mar 2002 20:47:26 +0000 Subject: question about concurrency implementation In-Reply-To: <3C9625C8.1E8FDCD8@cs.unc.edu> References: <3C9625C8.1E8FDCD8@cs.unc.edu> Message-ID: > I'm curious about the implementation of Concurrent Haskell in GHC > and Hugs. Hugs' implementation of concurrency is non-preemptive wherease GHC's implementation is preemptive (or "almost preemptive") as described by Simon. > Does access to values possibly shared among threads cost the same in > Concurrent Haskell as in regular Haskell? I'm guessing the answer > is "yes", because Concurrent Haskell is provided by default in GHC. The answer is yes for Hugs. > If the costs are the same, does that rely on there being no true > concurrency in the current implementations? Just to be sure we agree on terminology: some people like to distinguish between "parallelism" and "concurrency". Parallelism is a way of going faster but doesn't change your programming model. Implemented correctly, a parallel implementation yields the same results as a sequential implementation - it just runs faster. (This is ignoring the effects of interaction with the outside world, of course - since that can also affect determinism.) Parallel Haskell adds "par" and friends (operations which have no effect on the semantics of your program). Concurrency changes your programming model. A concurrent program is allowed to give different results and interesting interactions (including race conditions) between threads. A concurrent program may run on a single processor. Concurrent Haskell adds forkIO, killThread, MVars, etc (operations which affect not just the semantics of your program but also the way the semantics are defined). You might want to use different words for those concepts but I hope the distinction is clear. (Note that the two concepts are rarely/never separated in imperative languages. Arguably, Esterel is an exception.) Using this terminology, I think what you're asking about is "parallelism" and not "concurrency". -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/ From promos@motolev.com Mon Mar 18 20:57:28 2002 From: promos@motolev.com (promos@motolev.com) Date: Mon, 18 Mar 2002 16:57:28 -0400 Subject: Hello Message-ID: <200203182057.g2IKvS826553@server.angiesshowpalace.com> We Welcome You Angie's Show Palace Your Private Virtual Date Awaits You. Are you tired of those XXX sites that boast they have 10,000 photos and videos that are available on many other adult web sites? We are. Why not have hundreds of photos of our very sexy girls that you can take on your very own virtual dates. We update our site every 3 days.We always have fresh new faces for you. http://www.angiesxxx.com Must be 18 years or older. From cwitty@newtonlabs.com Tue Mar 19 00:07:41 2002 From: cwitty@newtonlabs.com (Carl R. Witty) Date: 18 Mar 2002 16:07:41 -0800 Subject: Strictness! In-Reply-To: Jay Cox's message of "Thu, 14 Mar 2002 22:23:32 -0600 (CST)" References: Message-ID: Jay Cox writes: > On Thu, 14 Mar 2002, Brian Huffman wrote: > > > In Haskell you can produce the desired behavior by using pattern guards. > > Since the pattern guards always get evaluated before the result does, they > > can be used to make things more strict. Here is the foldl example: > > > > strict x = seq x True > > > > foldl' :: (a -> b -> a) -> a -> [b] -> a > > foldl' f z [] = z > > foldl' f z (x:xs) > > | strict z = foldl' f (f z x) xs > > > > You can make multiple arguments strict by using && or similar, e.g.: > > > > f x y | strict x && strict y = ... > > f x y | all strict [x,y] = ... > > > > Of course, with the second example x and y must have the same type. > > Hope this helps. > > > > - Brian Huffman > > Thanks! that looks like a great haskell idiom to use! > > Jay Cox I also like this for trace: f x y | trace (show (x, y)) True = ... (Putting the trace on a separate line like that makes it easy to comment out.) Or, if you've got a function with a lot of cases, you can trace all of them by adding: f x y | trace (show (x, y)) False = undefined above all the other cases. Carl Witty From heringto@cs.unc.edu Tue Mar 19 04:56:27 2002 From: heringto@cs.unc.edu (Dean Herington) Date: Mon, 18 Mar 2002 23:56:27 -0500 (EST) Subject: question about concurrency implementation In-Reply-To: Message-ID: By "true concurrency" I meant "simultaneous execution of multiple threads by multiple processors". This involves both concepts you define: "concurrency" (to have multiple threads) and "parallelism" (to have them execute possibly simultaneously when multiple processors are available). From Simon Marlow's reply, I gather that the current implementations of Concurrent Haskell provide "concurrency" but not "parallelism", and that provision of parallelism is not likely in the near term. I've asked these questions in order to convince myself that multiple threads can (and will) cooperate in lazily evaluating a value they share, without need for any special programming. In particular, I plan to have multiple threads share values whose computations involve uses of `unsafePerformIO` (the safety of which my application's usage pattern guarantees). Thanks to you and others for your helpful replies. Dean On 18 Mar 2002, Alastair David Reid wrote: > > > I'm curious about the implementation of Concurrent Haskell in GHC > > and Hugs. > > Hugs' implementation of concurrency is non-preemptive wherease GHC's > implementation is preemptive (or "almost preemptive") as described by > Simon. > > > Does access to values possibly shared among threads cost the same in > > Concurrent Haskell as in regular Haskell? I'm guessing the answer > > is "yes", because Concurrent Haskell is provided by default in GHC. > > The answer is yes for Hugs. > > > If the costs are the same, does that rely on there being no true > > concurrency in the current implementations? > > Just to be sure we agree on terminology: some people like to > distinguish between "parallelism" and "concurrency". > > Parallelism is a way of going faster but doesn't change your > programming model. Implemented correctly, a parallel implementation > yields the same results as a sequential implementation - it just runs > faster. (This is ignoring the effects of interaction with the outside > world, of course - since that can also affect determinism.) Parallel > Haskell adds "par" and friends (operations which have no effect on the > semantics of your program). > > Concurrency changes your programming model. A concurrent program is > allowed to give different results and interesting interactions > (including race conditions) between threads. A concurrent program may > run on a single processor. Concurrent Haskell adds forkIO, > killThread, MVars, etc (operations which affect not just the semantics > of your program but also the way the semantics are defined). > > You might want to use different words for those concepts but I hope > the distinction is clear. (Note that the two concepts are rarely/never > separated in imperative languages. Arguably, Esterel is an exception.) > > Using this terminology, I think what you're asking about is > "parallelism" and not "concurrency". From ketil@ii.uib.no Tue Mar 19 07:56:40 2002 From: ketil@ii.uib.no (Ketil Z. Malde) Date: 19 Mar 2002 08:56:40 +0100 Subject: question about concurrency implementation In-Reply-To: References: Message-ID: Dean Herington writes: > From Simon Marlow's reply, I gather that the current implementations of > Concurrent Haskell provide "concurrency" but not "parallelism", and that > provision of parallelism is not likely in the near term. Uh, GPH exists, doesn't it? So you can get "parallelism" if you're after performance. The only implementation appears to be based on PVM, so I expect some overhead on SMPs, although I haven't gotten around to actually try it yet. I don't know if or how you can mix the two paradigms. There's also an implementation using threads for asynchronous calls to Win32 libraries, if I understand things correctly. A full thread-based parallel implementation might (or might not) be a logical next step. -kzm -- If I haven't seen further, it is by standing in the footprints of giants From colin@cs.york.ac.uk Tue Mar 19 09:56:49 2002 From: colin@cs.york.ac.uk (Colin Runciman) Date: Tue, 19 Mar 2002 09:56:49 +0000 Subject: Haskell slicing tool? Message-ID: > Are there any tools to perform program slicing on Haskell? > I often find myself wanting to find all "fromJusts" invoked > from the current function, or all functions that use a > particular member of my monad's ADT. Assuming that what you want to see are the applications of these functions that occur at run-time, and the evaluation contexts in which they arise, you could try the Hat tracing tools (http://www.cs.york.ac.uk/fp/hat/). Colin R From ajc99@aber.ac.uk Tue Mar 19 11:15:28 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Tue, 19 Mar 2002 11:15:28 +0000 Subject: using less stack References: <29465.1016478856@cl.cam.ac.uk> Message-ID: <3C971DD0.1030002@aber.ac.uk> Thanks for all the advice. In the end, I couldn't make $! work for me (it always seems to be harder than I think it will be to use it, and $! and deepSeq makes my code run slowly). But a continuation passing style foldl worked wonderfully. I now have: > cpsfold f a [] = a > cpsfold f a (x:xs) = f x a (\y -> cpsfold f y xs) and f takes a continuation, Bob's my uncle, and I have a program that runs quickly in constant space! Amanda -- Amanda Clare http://users.aber.ac.uk/ajc99/ Tel: +44 (0)1970 621787 Fax: +44 (0)1970 622455 Dept. of Computer Science, University of Wales, Aberystwyth, SY23 3DB From dominic.j.steinitz@britishairways.com Tue Mar 19 11:33:11 2002 From: dominic.j.steinitz@britishairways.com (dominic.j.steinitz@britishairways.com) Date: Tue, 19 Mar 2002 11:33:11 +0000 Subject: Gaussian Integers Message-ID: On holiday, I started reading about Gaussian integers (as you do) and I thought this should be a piece of cake for Haskell. I get the following error in Hugs: ERROR "D:\Temp\comptst2.hs" (line 4): Cannot build superclass instance *** Instance : Num (Gaussian a) *** Context supplied : () *** Required superclass : Eq (Gaussian a) and a similar one using GHCi: Could not deduce `Eq b' from the context () Probable fix: Add `Eq b' to the instance declaration context arising from an instance declaration at comptst1.hs:4 I've already declared Gaussian a as being of class Eq so why does it need to be told again? data Integral a => Gaussian a = Gaussian a a deriving (Eq, Show) instance Num (Gaussian a) where Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') negate (Gaussian a b) = Gaussian (negate a) (negate b) fromInteger a = Gaussian (fromIntegral a) 0 From voigt@orchid.inf.tu-dresden.de Tue Mar 19 11:46:43 2002 From: voigt@orchid.inf.tu-dresden.de (Janis Voigtlaender) Date: Tue, 19 Mar 2002 12:46:43 +0100 Subject: Gaussian Integers References: Message-ID: <3C972523.A09DBE6A@tcs.inf.tu-dresden.de> dominic.j.steinitz@britishairways.com wrote: > I've already declared Gaussian a as being of class Eq so why does it need > to be told again? > > data Integral a => Gaussian a = Gaussian a a > deriving (Eq, Show) > > instance Num (Gaussian a) where > Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') > Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') > Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') > negate (Gaussian a b) = Gaussian (negate a) (negate b) > fromInteger a = Gaussian (fromIntegral a) 0 You have only declared Gaussian a as being of class Eq (by deriving) if "a" is of class Integral (as a context in the data declaration). Adding Integral a to your instance should fix the problem: instance Integral a => Num (Gaussian a) where Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') negate (Gaussian a b) = Gaussian (negate a) (negate b) fromInteger a = Gaussian (fromIntegral a) 0 -- Janis Voigtlaender http://wwwtcs.inf.tu-dresden.de/~voigt/ mailto:voigt@tcs.inf.tu-dresden.de From mechvel@math.botik.ru Tue Mar 19 12:05:03 2002 From: mechvel@math.botik.ru (S.D.Mechveliani) Date: Tue, 19 Mar 2002 15:05:03 +0300 Subject: Gaussian integers. Reply Message-ID: dominic.j.steinitz@britishairways.com writes > On holiday, I started reading about Gaussian integers (as you do) and I > thought this should be a piece of cake for Haskell. I get the following > error in Hugs: > [..] > > data Integral a => Gaussian a = Gaussian a a > deriving (Eq, Show) > > instance Num (Gaussian a) where > Gaussian a b - Gaussian a' b' = Gaussian (a-a') (b-b') > Gaussian a b + Gaussian a' b' = Gaussian (a+a') (b+b') > Gaussian a b * Gaussian a' b' = Gaussian (a*a' - b*b') (a*b' + b*a') > negate (Gaussian a b) = Gaussian (negate a) (negate b) > fromInteger a = Gaussian (fromIntegral a) 0 To my mind, it is not good to set `Integral a =>' to data declaration. It is better to set such things in the instance declarations. Try, say data Gaussian a = Gau a a deriving (Eq, Show) instance Integral a => Num (Gaussian a) where Gau a b - Gau a' b' = Gau (a-a') (b-b') ... ------------------------------------------------- scico:~/t> ghci M.hs ... GHC Interactive, version 5.02.2, for Haskell 98. ... M> Gau 1 1 * Gau 1 (-1) Gau 2 0 ----------------- Serge Mechveliani mechvel@botik.ru From simonpj@microsoft.com Tue Mar 19 12:03:40 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Tue, 19 Mar 2002 04:03:40 -0800 Subject: question about concurrency implementation Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041B68@RED-MSG-10.redmond.corp.microsoft.com> Dean | From Simon Marlow's reply, I gather that the current=20 | implementations of Concurrent Haskell provide "concurrency"=20 | but not "parallelism", and that provision of parallelism is=20 | not likely in the near term. That's more or less right. The trouble is that for shared-memory parallelism - you take a performance hit for fine-grain locking - so you need real parallelism to recover that performance All the pieces are there in GHC, mostly implemented; but making it all really work, really reliably, and somewhat portably, is a non-trivial task... and the reward (as I say above) can be elusive. | I've asked these questions in order to convince myself that=20 | multiple threads can (and will) cooperate in lazily=20 | evaluating a value they share, without need for any special=20 | programming. In particular, I plan to have multiple threads=20 | share values whose computations involve uses of=20 | `unsafePerformIO` (the safety of which my application's usage=20 | pattern guarantees). Do make sure you understand Concurrent Haskell (I'm sure you do), which is specifically about multiple threads each of which can perform I/O. (See "Tackling the awkward squad" on my home page.) You are on thin ice with unsafePerformIO, especially when concurrency is involved. Simon From daan@cs.uu.nl Tue Mar 19 14:55:58 2002 From: daan@cs.uu.nl (Daan Leijen) Date: Tue, 19 Mar 2002 15:55:58 +0100 Subject: Haskell puzzles! Message-ID: <018401c1cf56$2e95f080$9650d383@ajam> Hi all, I have put together some interesting Haskell puzzles! Not many people were able to solve all three puzzles so don't be discouraged you don't know all the answers. Have fun, Daan. ----------------------------------------------------- - All three puzzles are "Haskell 98"; you can solve them using the Haskell 98 manual and they should be implementation independent. - "equal" means that two evaluated expression denote the same semantical value; i.e. when typed on the Hugs prompt, I will see the same answer. - All the answers are at the end of this mail. ----------------------------------------------------- 1) Are e1 and e2 equal? > f (x:xs) y = x > g (x:xs) = \y -> x > > e1 = seq (f []) 1 > e2 = seq (g []) 1 ----------------------------------------------------- 2) Are e1 and e2 equal? Is one definition preferred over the other? (And what about "h x = nfib 30" ?) > f = const (nfib 30) > g = \x -> nfib 30 > > e1 = f 1 + f 2 > e2 = g 1 + g 2 ----------------------------------------------------- 3) Are e1 and e2 equal? And what if I typed them on the Hugs prompt? > f = \x -> x + x > g x = x + x > > e1 = f 1.0 + f 2.0 > e2 = g 1.0 + g 2.0 ----------------------------------------------------- Answers at the end of this email..... Answers: ----------------------------------------------------- 1) answer: "e1" equals the value 1, while "e2" is undefined. explanation: This is due to the translation of pattern matching. The functions are de sugared into: > f x' y = case x' of (x:xs) -> x > g x' = case x' of (x:xs) -> (\y -> x) Now, the expression "f []" is a partial application and thus in weak head normal form while "g []" is evaluated and the pattern matching fails. opinion: I think that the pattern matching translation rules are wrong here and we shouldn't push the "case" through the lambda's. However, the current rules are potentially more efficient since all arguments can be collected before matching. ----------------------------------------------------- 2) answer: Yes, "e1" and "e2" are equal. However, the "f" definition is preferred since it potentially shares the computation of "nfib 30". ("e1" will be almost twice as fast as "e2" on most systems). explanation: The Haskell language is only defined to be "non-strict". This means that there are no guarantees about sharing. However, all current Haskell systems use lazy semantics. This means that both "f" and "g" are caf's. When "g" is evaluated, the expression "\x -> nfib 30" is shared and on each call "nfib 30" is re-evaluated. When "f" is evaluated, the application node "const (nfib 30)" is shared and once it is applied it will be updated and "nfib 30" is only evaluated once. Smart compilers like GHC however, will inline definitions like "g" and after common expression elimination we also end up with an efficient version. Same would hold for a full laziness transformation. Note that "h x = nfib 30" behaves exactly like "g" except that it's type is more general due to the monomorphism restriction and defaulting: > f,g :: a -> Integer > h :: Num b => a -> b opinion: I believe that the operational distinction between both definitions is fundamentally important and should be expressible by the user. ----------------------------------------------------- 3) answer: Yes, "e1" and "e2" are equal (6.0). However, when "e1" and "e2" are used outside the scope of "f" and "g", for example when typed on the Hugs prompt, "e1" is not well-typed. explanation: The type of "g" is "Num a => a -> a". One would expect the same type for "f" but unfortunately, the monomorphism restriction prevents this and defaulting tries to resolve the instance. Based on the usage of "f", it will default to "Double" and we get the type "Double -> Double" for "f". However, if we would use it from the Hugs prompt, there is no usage site of "f" and defaulting will resort to the "default defaulting" rules and set the type of "f" to "Integer -> Integer" and the expression "f 1.0" becomes ill typed -- that is, unless I use a "default" declaration in the module, as in: > default (Double) opinion: Clearly, as puzzle 2 shows, we want to have a distinction between shared values and functions. So, we need at least to be warned when the compiler would add a dictionary argument. I would say that an "overloading warning" is more appropriate than a "monomorphism restriction". Anyway, the real culprit here is the horrible defaulting mechanism. I believe that defaulting has no place in Haskell modules and should probably only be used on expressions in a top-level interpreter. From jmaessen@alum.mit.edu Tue Mar 19 15:44:26 2002 From: jmaessen@alum.mit.edu (Jan-Willem Maessen) Date: Tue, 19 Mar 2002 10:44:26 -0500 Subject: Haskell puzzles! Message-ID: <200203191544.KAA00691@lauzeta.mit.edu> Daan Leijen writes: > 1) Are e1 and e2 equal? > > > f (x:xs) y = x > > g (x:xs) = \y -> x > > > > e1 = seq (f []) 1 > > e2 = seq (g []) 1 > ... > 1) > answer: > "e1" equals the value 1, while "e2" is undefined. > ... > opinion: > I think that the pattern matching translation rules > are wrong here and we shouldn't push the "case" through > the lambda's. However, the current rules are potentially > more efficient since all arguments can be collected > before matching. On the contrary, I far prefer the way things are now. Matching arguments as they arrive makes programs far too eager about pattern matching. Consider the following minor variation on your example (which happily also avoids using "seq"): Q) Are e1 and e2 both defined? > f (x:xs) y z = x > g (x:xs) = \y -> \z -> x > > e1 = f [] 1 > e2 = g [] 1 A) No, e1 is defined---pattern matching happens only when all the arguments have arrived. This is nice and lazy---we don't do any work until we know we have to. By contrast, e2 performs the matching as soon as (g []) is applied to 1. We've matched eagerly, and our program fails. opinion: In practice, pattern matches are much more complicated than f and g. There is no easy and convenient way to get the behavior of e1 if matching always works as in e2. Indeed, it's not even clear how to do complex multiple-argument pattern matches if we proceed this way. Meanwhile, there's a simple way to turn f into g if that's what is desired. -Jan-Willem Maessen And I've implemented *Eager* Haskell, too. From Sengan.Baring-Gould@nsc.com Tue Mar 19 18:20:39 2002 From: Sengan.Baring-Gould@nsc.com (Sengan.Baring-Gould@nsc.com) Date: Tue, 19 Mar 2002 13:20:39 -0500 Subject: Haskell slicing tool? In-Reply-To: References: Message-ID: <20020319132039.37e63d70.senganb@ia.nsc.com> On Tue, 19 Mar 2002 09:56:49 +0000 "Colin Runciman" wrote: > > Are there any tools to perform program slicing on Haskell? > > I often find myself wanting to find all "fromJusts" invoked > > from the current function, or all functions that use a > > particular member of my monad's ADT. > > Assuming that what you want to see are the applications of > these functions that occur at run-time, and the evaluation > contexts in which they arise, you could try the Hat > tracing tools (http://www.cs.york.ac.uk/fp/hat/). Actually I was hoping for a static tool. But now HAT works with GHC I'll be trying it out. Thanks. Sengan From ESEJournal@unisannio.it Tue Mar 19 23:56:07 2002 From: ESEJournal@unisannio.it (ESEJournal@unisannio.it) Date: Wed, 20 Mar 2002 00:56:07 +0100 (CET) Subject: Empirical Software Engineering: An International Journal - CALL FOR PAPERS Message-ID: <200203192356.g2JNu7O05682@unisannio.it> *********************************************************** Empirical Software Engineering: An International Journal - CALL FOR PAPERS - *********************************************************** http://www.kluweronline.com/issn/1382-3256 . Consider submitting papers on your latest experiments and field studies! . The journal focuses on software measurement, quality and productivity improvement, and technology evaluation . Empirical studies addressing important software development issues are reported, providing results and data . Check the Journal Contents link for a sample of published articles . Papers can be searched and downloaded on line! . Individual subscription: USD $68 - subscribe on-line Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this message. If you would like to be removed from our list please send an email to ESEJournal@unisannio.it with REMOVE in the subject. From Diego Yanivello" This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C1CF8C.3AAA60A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hi, =20 is there (in Haskell) a function like =20 existFile :: FilePath -> IO (Bool) ? Thanks! ------=_NextPart_000_000E_01C1CF8C.3AAA60A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
    hi,    
        is there (in Haskell) a function=20 like  
            existFile :: FilePath = -> IO=20 (Bool) ?
     
    Thanks!
    ------=_NextPart_000_000E_01C1CF8C.3AAA60A0-- From lennart@augustsson.net Wed Mar 20 00:32:35 2002 From: lennart@augustsson.net (Lennart Augustsson) Date: Wed, 20 Mar 2002 01:32:35 +0100 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> Message-ID: <3C97D8A3.B8CA185@augustsson.net> Using such a function is generally a bad idea because of race conditions. -- Lennart Diego Yanivello wrote: > hi, is there (in Haskell) a function like existFile :: FilePath -> > IO (Bool) ? Thanks! From pixel@mandrakesoft.com Wed Mar 20 00:54:23 2002 From: pixel@mandrakesoft.com (Pixel) Date: 20 Mar 2002 01:54:23 +0100 Subject: finding .... In-Reply-To: <3C97D8A3.B8CA185@augustsson.net> References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> Message-ID: Lennart Augustsson writes: > > Diego Yanivello wrote: > > > > > hi, is there (in Haskell) a function like existFile :: FilePath -> > > > IO (Bool) ? Thanks! > > Using such a function is generally a bad idea because of race conditions. however, real world programs use those tests since you don't need to care *everytime* about race conditions. (of course using this existFile before creating a temporary file is wrong, but existFile has *many* other applications) From hallgren@cse.ogi.edu Wed Mar 20 01:05:25 2002 From: hallgren@cse.ogi.edu (Thomas Hallgren) Date: Tue, 19 Mar 2002 17:05:25 -0800 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> Message-ID: <3C97E055.4030001@cse.ogi.edu> Hi, The standard library module Directory contains doesFileExist :: FilePath -> IO Bool See http://www.haskell.org/onlinelibrary/directory.html Regards, Thomas Hallgren PS If using doesFileExist is a bad idea, then using some of the other functions from the module Directory, e.g. getDirectoryContents, is probablya bad idea too... Lennart Augustsson wrote: >Using such a function is generally a bad idea because of race conditions. > > -- Lennart > >Diego Yanivello wrote: > >>hi, is there (in Haskell) a function like existFile :: FilePath -> >>IO (Bool) ? Thanks! >> From lennart@augustsson.net Wed Mar 20 01:18:05 2002 From: lennart@augustsson.net (Lennart Augustsson) Date: Wed, 20 Mar 2002 02:18:05 +0100 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> Message-ID: <3C97E34D.81449C0C@augustsson.net> Just because many applications use this doesn't make it safe or good. Presumably you are testing for the existence of the file to do something to it (read, create, delete...). It's better to do the operation you want to do and have it fail if the file is missing (or existing if you create). You then just have to handle the exception (that part is already in H98) or proceed with the normal path. I claim the code simpler this way and you avoid any race conditions. -- Lennart Pixel wrote: > Lennart Augustsson writes: > > > > Diego Yanivello wrote: > > > > > > > hi, is there (in Haskell) a function like existFile :: FilePath -> > > > > IO (Bool) ? Thanks! > > > > Using such a function is generally a bad idea because of race conditions. > > however, real world programs use those tests since you don't need to care > *everytime* about race conditions. (of course using this existFile before > creating a temporary file is wrong, but existFile has *many* other > applications) > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From pixel@mandrakesoft.com Wed Mar 20 01:37:03 2002 From: pixel@mandrakesoft.com (Pixel) Date: 20 Mar 2002 02:37:03 +0100 Subject: finding .... In-Reply-To: <3C97E34D.81449C0C@augustsson.net> References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> <3C97E34D.81449C0C@augustsson.net> Message-ID: Lennart Augustsson writes: > Just because many applications use this doesn't make it safe or good. > Presumably you are testing for the existence of the file to do something > to it (read, create, delete...). It's better to do the operation you want to > do and have it fail if the file is missing (or existing if you create). You > then just have to handle the exception (that part is already in H98) or > proceed with the normal path. I claim the code simpler this way and you > avoid any race conditions. I said real-world pbs ;p WARNING, perl below! - checking if devfs is mounted in /dev: -e "/dev/.devfsd" - checking wether there is cdrom drive with devfs: -e "/dev/cdroms/cdrom0" - looking for a file in a PATH-like: if ($f !~ m|/|) { -e "$_/$f" and $f = "$_/$f", last foreach @icon_paths } - if (-e "$f.gz") { # ... the wanted file is gzip'ed, doing whatever is needed } - -x "/bin/sh" or die "cannot open shell - /bin/sh doesn't exist"; fork and return; # doing things # now, and only now exec'ing exec "/bin/sh" - if (! -e '/usr/sbin/showmount') { my $pkg = 'nfs-utils-clients'; $in->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return; $in->do_pkgs->install($pkg); } If you want some more, just ask ;) From lennart@augustsson.net Wed Mar 20 01:42:02 2002 From: lennart@augustsson.net (Lennart Augustsson) Date: Wed, 20 Mar 2002 02:42:02 +0100 Subject: finding .... References: <001101c1cfa5$6102a000$115633c8@s1i4m9> <3C97D8A3.B8CA185@augustsson.net> <3C97E34D.81449C0C@augustsson.net> Message-ID: <3C97E8EA.C0C8326A@augustsson.net> Thank you for making my point. All these are indeed examples of broken code. (Not because it's Perl. :) -- Lennart Pixel wrote: > Lennart Augustsson writes: > > > Just because many applications use this doesn't make it safe or good. > > Presumably you are testing for the existence of the file to do something > > to it (read, create, delete...). It's better to do the operation you want to > > do and have it fail if the file is missing (or existing if you create). You > > then just have to handle the exception (that part is already in H98) or > > proceed with the normal path. I claim the code simpler this way and you > > avoid any race conditions. > > I said real-world pbs ;p > > WARNING, perl below! > > - checking if devfs is mounted in /dev: -e "/dev/.devfsd" > - checking wether there is cdrom drive with devfs: -e "/dev/cdroms/cdrom0" > - looking for a file in a PATH-like: > if ($f !~ m|/|) { -e "$_/$f" and $f = "$_/$f", last foreach @icon_paths } > - > if (-e "$f.gz") { > # ... the wanted file is gzip'ed, doing whatever is needed > } > > - > -x "/bin/sh" or die "cannot open shell - /bin/sh doesn't exist"; > fork and return; > # doing things > # now, and only now exec'ing > exec "/bin/sh" > > - > if (! -e '/usr/sbin/showmount') { > my $pkg = 'nfs-utils-clients'; > $in->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return; > $in->do_pkgs->install($pkg); > } > > If you want some more, just ask ;) > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell From camio@yahoo.com Wed Mar 20 02:37:34 2002 From: camio@yahoo.com (David Sankel) Date: Tue, 19 Mar 2002 18:37:34 -0800 (PST) Subject: finding .... In-Reply-To: Message-ID: <20020320023734.29314.qmail@web13206.mail.yahoo.com> --- Pixel wrote: > Lennart Augustsson writes: > > > > Diego Yanivello wrote: > > > > > > > hi, is there (in Haskell) a function like > existFile :: FilePath -> > > > > IO (Bool) ? Thanks! > > > > Using such a function is generally a bad idea > because of race conditions. > > however, real world programs use those tests since > you don't need to care > *everytime* about race conditions. (of course using > this existFile before > creating a temporary file is wrong, but existFile > has *many* other > applications) Could someone post an example of the creation of a temporary file where race conditions are important? Thanks, David J. Sankel __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/ From juhp@01.246.ne.jp Wed Mar 20 06:00:32 2002 From: juhp@01.246.ne.jp (Jens Petersen) Date: 20 Mar 2002 15:00:32 +0900 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: References: Message-ID: Jens Petersen writes: > > The problem is that the child process doesn't receive all the data which > > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > > somehow, and "hClose vonh" closes the pipe prematurely. > > > > It varies from run to run exactly which data gets through. If I cause the > > child process to read all its input immediately, the problem doesn't > > seem to occur. Normally, it does so gradually, which takes a few seconds. > > > > I'm using GHC 5.02.2 > > Quite possibly could be a bug. Lazy IO is rather subtle I > think, specially when done across pipes. I faced some > similar problem with in POpen recently. You can see how I > solved it (worked round it?) by comparing the latest release > 1.00 with the previous one 0.00.1: > > http://www.01.246.ne.jp/~juhp/haskell/popenhs/ > > In comparison Posix.runProcess allows attaching file handles > to the in, out and error pipes, which can be written to and > read from eagerly I suppose. Also I just rediscovered Manuel Chakravarty's HPL (Haskell Ports Library), which provides a rather elegant, sophisticated approach. http://www.cse.unsw.edu.au/~chak/haskell/ports/ It compiles fine under ghc-5.02.2, and using the BufferMode patch included at the end output seems to be ok, but input of more than 2048 bytes doesn't seem to be being handled reliably. Eg with the test program below: % test-processes ping localhost works (with the aforementioned patch below to Processes.hs), but % cat 4096 | test-processes cat [4096 is a file of 4096 chars] mostly gives no output, but occasionally I see Warning: Ports.listenToPort: Attempted to listen to a closed port! Needs some debugging I guess. :) Jens -- ghc -o test-processes `ports-config --cflags --libs` test-processes.hs module Main where import Processes import Ports import IO (openFile, hGetContents, IOMode(..), hSetBuffering, BufferMode(..)) import Monad (unless) main :: IO() main = do inpt <- getContents withPorts [] $ \ (cmd:args) -> do outpt <- newPort ' ' errpt <- newPort ' ' let p = proc cmd args p inpt outpt errpt putStrLn "output:" out <- listenToPort outpt mapM_ putStrLn $ lines out putStrLn "error:" errclosed <- isClosedPort errpt unless errclosed $ do err <- listenToPort errpt putStr err putStrLn "test finished" Index: Processes.hs =================================================================== RCS file: /home/chakcvs/cvs/ports/lib/Processes.hs,v retrieving revision 1.7 diff -u -r1.7 Processes.hs --- Processes.hs 2001/07/04 16:15:52 1.7 +++ Processes.hs 2002/03/20 05:28:33 @@ -145,6 +145,8 @@ stdoutWriteHandle <- fdToHandle stdoutWriteFD stderrReadHandle <- fdToHandle stderrReadFD stderrWriteHandle <- fdToHandle stderrWriteFD + hSetBuffering stdoutReadHandle LineBuffering + hSetBuffering stderrReadHandle LineBuffering -- -- the child must close the pipe ends that it doesn't use (especially, the -- write end) From Jon.Fairbairn@cl.cam.ac.uk Wed Mar 20 10:18:56 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 20 Mar 2002 10:18:56 +0000 Subject: finding .... In-Reply-To: Your message of "Tue, 19 Mar 2002 18:37:34 PST." <20020320023734.29314.qmail@web13206.mail.yahoo.com> Message-ID: <8240.1016619536@cl.cam.ac.uk> > Could someone post an example of the creation of a > temporary file where race conditions are important? /any/ programme that does this on a multi-process system. Between the test for existence and the creation, some other process could have created a file of the same name. Then the create fails because of insufficient permissions, so the programme has to deal with failure anyway, or it succeeds and stomps on the data belonging to the other process. do possible_handle <- try $ openFile "whatever" ReadMode case possible_handle = of (Right handle) -> do_things_to handle (Left error) -> do whatever you would have done had the existence test returned false is no more complex than a version using an existence test, but to create a file for writing, surely we need an openNewFile primitive? Otherwise we might open on a file that already exists and hit the "stomp" error mentioned above. J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From dfeuer@cs.brown.edu Wed Mar 20 10:26:13 2002 From: dfeuer@cs.brown.edu (David Feuer) Date: Wed, 20 Mar 2002 05:26:13 -0500 Subject: finding .... In-Reply-To: <8240.1016619536@cl.cam.ac.uk>; from Jon.Fairbairn@cl.cam.ac.uk on Wed, Mar 20, 2002 at 10:18:56AM +0000 References: <20020320023734.29314.qmail@web13206.mail.yahoo.com> <8240.1016619536@cl.cam.ac.uk> Message-ID: <20020320052612.B8025@cslab7e.cs.brown.edu> On Wed, Mar 20, 2002, Jon Fairbairn wrote: > > Could someone post an example of the creation of a > > temporary file where race conditions are important? > > /any/ programme that does this on a multi-process system. Occasionally, the presence or absence of a file (usually empty) of a certain name in a certain directory is used for communication between processes on a multi-process system. David From Jon.Fairbairn@cl.cam.ac.uk Wed Mar 20 10:31:28 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 20 Mar 2002 10:31:28 +0000 Subject: using less stack In-Reply-To: Your message of "Tue, 19 Mar 2002 11:15:28 GMT." <3C971DD0.1030002@aber.ac.uk> Message-ID: <8291.1016620288@cl.cam.ac.uk> > Thanks for all the advice. In the end, I couldn't make $! work for me = > (it always seems to be harder than I think it will be to use it, and $!= = > and deepSeq makes my code run slowly). = :-( > But a continuation passing style foldl worked wonderfully. As Jay Cox pointed out by email, my answer was rot because I had confused foldl and foldr > I now have: > = > > cpsfold f a [] =3D a > > cpsfold f a (x:xs) =3D f x a (\y -> cpsfold f y xs) > = > and f takes a continuation, Bob's my uncle, and I have a program that = > runs quickly in constant space! Good. I'm curious to know from other readers whether continuations like this are the only way of solving it, though. J=F3n -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From Jon.Fairbairn@cl.cam.ac.uk Wed Mar 20 10:33:17 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Wed, 20 Mar 2002 10:33:17 +0000 Subject: finding .... In-Reply-To: Your message of "Wed, 20 Mar 2002 05:26:13 EST." <20020320052612.B8025@cslab7e.cs.brown.edu> Message-ID: <8314.1016620397@cl.cam.ac.uk> > On Wed, Mar 20, 2002, Jon Fairbairn wrote: > > > Could someone post an example of the creation of a > > > temporary file where race conditions are important? > > = > > /any/ programme that does this on a multi-process system. > = > Occasionally, the presence or absence of a file (usually empty) of a > certain name in a certain directory is used for communication between > processes on a multi-process system. Hence the need for an atomic openNewFile. -- = J=F3n Fairbairn Jon.Fairbairn@cl.cam.ac.u= k 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!) From olaf@cs.york.ac.uk Wed Mar 20 10:42:15 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Wed, 20 Mar 2002 10:42:15 +0000 Subject: Haskell slicing tool? References: <20020319132039.37e63d70.senganb@ia.nsc.com> Message-ID: <3C986787.830C8F9B@cs.york.ac.uk> Sengan.Baring-Gould@nsc.com wrote: > > > Are there any tools to perform program slicing on Haskell? > > > I often find myself wanting to find all "fromJusts" invoked > > > from the current function, or all functions that use a > > > particular member of my monad's ADT. > Actually I was hoping for a static tool. I'd be interested to learn for what purpose you want this kind of information and also more precisely what you would like such a static tool to do for you. Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From trinder@cee.hw.ac.uk Wed Mar 20 11:51:57 2002 From: trinder@cee.hw.ac.uk (Phil Trinder) Date: Wed, 20 Mar 2002 11:51:57 +0000 (GMT Standard Time) Subject: question about concurrency implementation In-Reply-To: <9584A4A864BD8548932F2F88EB30D1C608AA4458@TVP-MSG-01.europe.corp.microsoft.com> Message-ID: Dean, > > If the costs are the same, does that rely on there being no true > > concurrency in > > the current implementations? > > It depends what you mean by true concurrency: from the point of view of > the Haskell programmer, GHC's implementation of concurrency is "almost" > preemptive, because we can context-switch at any allocation. Most > computation does some allocation, but it's possible to write functions > that don't (although these tend to be on the trivial side - an optimised > nfib won't allocate, for example). We could artificially cause all > computation to do some allocation to avoid this problem, but we haven't > found it necessary so far. > > But I suspect by "true concurrency" you're referring at the kind of > concurrent processes that can be executed on multiple CPUs > simultaneously. We did investigate doing this a while back, and found > that the locking required on thunks was very expensive (slowed down the > program by at least 2x on the bog-standard SMP machine we had here). > However there are some clever techniques that can be used to reduce the > cost - giving each process its own private allocation area and only > degrading to full locking for access to the shared portion of the heap > is one such technique we experimented with briefly but I don't have any > concrete benchmarks I'm afraid. Also you really need a multithreaded > garbage collector, which is a lot of work. We've developed a Haskell extension that exhibit's "true concurrency" on multiple CPUs, it's called Glasgow distributed Haskell (GdH). It's primarily designed for distribution (i.e. multiple stateful threads on multiple processors), but can be used to build parallel programs too. For more info see http://www.cee.hw.ac.uk/~dsg/gdh/ Phil -------------------------------------------------- Phil Trinder Department of Computing and Electrical Engineering Heriot Watt University Riccarton Edinburgh, EH14 4AS E-mail: trinder@cee.hw.ac.uk Teleph: +44 (0)131 451 3435 Depart: +44 (0)131 451 3328 Fasmly: +44 (0)131 451 3327 Intrnt: http://www.cee.hw.ac.uk/~trinder From C.Reinke@ukc.ac.uk Wed Mar 20 18:12:12 2002 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Wed, 20 Mar 2002 18:12:12 +0000 Subject: using less stack In-Reply-To: Message from Jon Fairbairn of "Wed, 20 Mar 2002 10:31:28 GMT." <8291.1016620288@cl.cam.ac.uk> Message-ID: > > > cpsfold f a [] ú > > > cpsfold f a (x:xs) ÿ x a (\y -> cpsfold f y xs) > > > > and f takes a continuation, Bob's my uncle, and I have a program that > > runs quickly in constant space! > > Good. I'm curious to know from other readers whether > continuations like this are the only way of solving it, > though. Actually, and quite apart from it being cumbersome to use, I've got my doubts about whether this cpsfold really does the job (is that just me missing some point?-). Also, I'm curious to know why the usual strict variant of foldl doesn't help in this case? foldl' f a [] = a foldl' f a (x:xs) = (foldl' f $! f a x) xs or, with the recently suggested idiom for strictness, tracing and other annotations:-) annotation = undefined strict a = seq a False foldl' f a l | strict a = annotation foldl' f a [] = a foldl' f a (x:xs) = foldl' f (f a x) xs Claus From hdaume@ISI.EDU Wed Mar 20 18:28:13 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Wed, 20 Mar 2002 10:28:13 -0800 (PST) Subject: using less stack In-Reply-To: Message-ID: > strict a = seq a False > > foldl' f a l | strict a = annotation > foldl' f a [] = a > foldl' f a (x:xs) = foldl' f (f a x) xs Or, perhaps strict a = a `deepSeq` False or strict a = rnf a `seq` False if you prefer the rnf notation instead. depending on what you want... \begin{rant} I think the whole seq thing is very confusing for beginning/intermediate haskell programmers. I was very confused for a long time as to why > (unsafePerformIO (putStrLn "Hello")) `seq` 5 would print "Hello", but > [unsafePerformIO (putStrLn "Hello")] `seq` 5 would not. this goes back to the earlier discussion of "does a haskell programmer need to know how the compiler works." while you could argue this isn't exactly a compiler issue and that the semantics of seq *are* well defined outside any particular compiler, you do need to know something about how the graph reduction happens, etc., in order to understand exactly what is being evaluated on the left hand side of `seq`. I would almost prefer if the semantics of `seq` were instead those of rnf or deepSeq, so long as either (a) we were allowed to derive DeepSeq or NFData, or (b) if the compiler would just do it itself. Yes, this would cut down on the expressions which we could `seq`, but does that really matter. I mean, how often are we going to say: > (+) `seq` 5 What the heck is that supposed to mean? I would almost *prefer* if an expression like that didn't typecheck. Since seq isn't lambda definable anyway, I don't see any particular reason the compiler couldn't just reduce to normal form instead of weak head normal form for seqs. Perhaps artifically introduce an NFData instance for everything so the above doesn't typecheck. But that's just me :) \end{rant} From ajc99@aber.ac.uk Wed Mar 20 18:45:15 2002 From: ajc99@aber.ac.uk (Amanda Clare) Date: Wed, 20 Mar 2002 18:45:15 +0000 Subject: using less stack References: Message-ID: <3C98D8BB.5060001@aber.ac.uk> [cpsfold omitted] > Actually, and quite apart from it being cumbersome to use, I've got > my doubts about whether this cpsfold really does the job (is that > just me missing some point?-). It does the job for me! In practical terms I can see it works. I'm not an expert - I may have this all wrong, but perhaps the point you're looking for is that the arguments to f are brought to the very outside of the expression, and hence available for evaluation. Imagine for [x1,x2,x3,x4] from foldr: f x1 (f x2 (f x3 (f x4 a))) from foldl: f (f (f (f a x1) x2) x3) x4 Neither are available for immediate evaluation. In the case of foldr the end of the list (x4) has to be reached before anything can be evaluated. In the case of foldl the first function to be pulled upon is the outermost f, which then can't do anything useful (in my case) without evaluating its second argument, and so on. with the cpsfold I get f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4) so x1 and a are available immediately for f to use, and f x1 a is the outermost expression so will be evaluated first. See for yourself with the following (difference can be seen in ghc with standard 1M stack): > answer1 = foldr larger 0 [1..500000] > answer2 = foldl larger 0 [1..500000] > answer3 = cpsfold cpslarger 0 [1..500000] > larger x y = if x > y then x else y > cpslarger x y k = if x > y then k x else k y > Also, I'm curious to know why the usual strict variant of foldl > doesn't help in this case? > > foldl' f a [] = a > foldl' f a (x:xs) = (foldl' f $! f a x) xs Because $! and seq only evaluates enough to make sure the answer is not bottom, and if my f is complex then it doesn't do enough. Amanda From olaf@cs.york.ac.uk Wed Mar 20 19:05:37 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Wed, 20 Mar 2002 19:05:37 +0000 Subject: using less stack References: <3C98D8BB.5060001@aber.ac.uk> Message-ID: <3C98DD81.6CE0CEE0@cs.york.ac.uk> > with the cpsfold I get > > f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4) > > so x1 and a are available immediately for f to use, and f x1 a is the > outermost expression so will be evaluated first. Yes, however, if f just calls its continuation without forcing the evaluation of at least its second argument, e.g. f x y k = k (g x y) you get f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4)))) => f x2 (g x1 a) (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4))) => f x3 (g x2 (g x1 a)) (\y3 -> f x4 y4 (\y4 -> y4))) => f x4 (g x3 (g x2 (g x1 a))) (\y4 -> y4) => g x4 (g x3 (g x2 (g x1 a))) like the foldr. > > larger x y = if x > y then x else y > > cpslarger x y k = if x > y then k x else k y Yes, with this definition of `cpslarger' no stack is used, because the comparison forces evaluation. With cpslarger x y k = k (larger x y) it does not work. Still, if your definition of cpslarger is natural for your application, it is a nice solution of the problem. Ciao, Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From C.Reinke@ukc.ac.uk Wed Mar 20 20:32:19 2002 From: C.Reinke@ukc.ac.uk (C.Reinke) Date: Wed, 20 Mar 2002 20:32:19 +0000 Subject: using less stack In-Reply-To: Message from Amanda Clare of "Wed, 20 Mar 2002 18:45:15 GMT." <3C98D8BB.5060001@aber.ac.uk> Message-ID: > > Actually, and quite apart from it being cumbersome to use, I've got > > my doubts about whether this cpsfold really does the job (is that > > just me missing some point?-). > > It does the job for me! In practical terms I can see it works. ..[explanation omitted].. I didn't express myself well: I don't doubt that you solved your problem by using cpsfold, but the cpsfold alone doesn't do the trick. It just translates the implicit continuation (which uses stack space) into an explicit continuation function (which uses heap space). So there's something else going on. As you explained, having the continuation explicit makes it easier to get a handle on what happens next at every step, which is the usual reason for using CPS style. And if neither the cautious evaluate-to-weak-head-normal-form seq nor the all-out evaluate-to-normal-form deepSeq do the job for you, I can well imagine that CPS style permits you to fine-tune evaluation to the needs of your application. But as Olaf has pointed out, having that much control can be a bit of a fragile construction. So I was just wondering about the specific use of fold in your application, and how you've redefined your operator to make use of your CPS version of fold (in order to solve the space problem). Incidentally, cpsfold processes the list in reversed order, which may or may not matter, depending on the operator passed to it. Hugs session for: Prelude.hs R.hs folds.hs Main> foldr (-) 0 [1..4] (1 - (2 - (3 - (4 - 0)))) Main> foldl (-) 0 [1..4] ((((0 - 1) - 2) - 3) - 4) Main> cpsfold (\x y c-> c $ x - y) 0 [1..4] (4 - (3 - (2 - (1 - 0)))) Claus -- Research Opportunity: Refactoring Functional Programs (UKC) Closing date: Friday 22 March 2002 <------- !!! http://www.cs.ukc.ac.uk/vacancies_dir/r02-24.html From post@volker-wysk.de Wed Mar 20 21:08:51 2002 From: post@volker-wysk.de (Volker Wysk) Date: 20 Mar 2002 22:08:51 +0100 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: References: Message-ID: <1016658532.3061.43.camel@volker> On Mit, 2002-03-20 at 07:00, Jens Petersen wrote: > Jens Petersen writes: > > > > The problem is that the child process doesn't receive all the data which > > > the parent sends. It's as if "hPutStr vonh txt" sends the data lazily > > > somehow, and "hClose vonh" closes the pipe prematurely. > > > > > > It varies from run to run exactly which data gets through. If I cause the > > > child process to read all its input immediately, the problem doesn't > > > seem to occur. Normally, it does so gradually, which takes a few seconds. > > > > > > I'm using GHC 5.02.2 > > > > Quite possibly could be a bug. Lazy IO is rather subtle I > > think, specially when done across pipes. I faced some > > similar problem with in POpen recently. You can see how I > > solved it (worked round it?) by comparing the latest release > > 1.00 with the previous one 0.00.1: > > > > http://www.01.246.ne.jp/~juhp/haskell/popenhs/ POpen-1.0.0 contains the same bug which I made. It doesn't ensure that the values which are needed after the call of forkProcess, before that of executeFile, are fully evaluated. So, if they are read lazily from a stream, the newly spawned child process reads data from a stream which it shares with its parent, making it disappear from the parent's input. In this situation, this sure isn't intended. Inserting the following lines just before the line "pid <- forkProcess", in POpen.hs, would force the corresponding values to be evaluated, so no data will be lost. seq (length path) $ seq (sum (map length args)) $ return () when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) (fromJust env))) $ return () when (isJust dir) $ seq (length (fromJust dir)) $ return () I'm also not sure what this part is supposed to do: inr <- if (isJust inpt) then do (inr', inw) <- createPipe hin <- fdToHandle inw hPutStr hin $ fromJust inpt hClose hin return $ Just inr' else return Nothing Doesn't it write the input data to a pipe which no process reads from..?? Volker From sohufm365sina@fm365.com Thu Mar 21 05:54:11 2002 From: sohufm365sina@fm365.com (sohufm365sina@fm365.com) Date: Thu, 21 Mar 2002 05:54:11 Subject: ¹âÁÙÌøÎèÀ¼£¬ÓкñÀñÅÉËÍ------ÊýÂëÀñÆ·£¡ Message-ID: <200202180521.FAA27879@netpower> ÌøÎèÀ¼¹ºÎïÉ̳Ç
     
    ¡¤ËùÓÐÌøÎèÀ¼Ð¡¢ÀÏÓû§¶¼½«Ãâ·Ñ»ñµÃ¼ÛÖµ10ÔªµÄÌøÎèȯ
    ¡¤¹ºÎォ°´"¹ºÎïÿ100ÔªËÍ5Ôª"µÄ·½Ê½»ñÔùÌøÎèȯ
    ¡¤ÌøÎèÀ¼É̳ÇÌØ±ðÔùËÍMP3»ú¡¢ÊÖ»úµÈÌØ±ðÔùÆ·
    1999-2001°æÈ¨ËùÓÐ ÌøÎèÀ¼¹ºÎï³Ç
    °´ÕÕ¹ú¼Ê¹ßÀý£¬Ö»Òª±¾Óʼþ°üÀ¨¡°ÁªÏµÐÅÏ¢¡±ºÍ¡°ÒƳýÐÅÏ¢¡±£¬¾Í²»Ó¦±»¿´×öÀ¬»øÐżþ¡£Èç¹ûÄúÏëÎÒÃÇ´ÓÓʼþÁбíÖÐÒÆ³ýÄúµÄÓʼþµØÖ·£¬ÇëÓÃÄúÏëÒÆ³ýµÄÐÅÏäµã´Ë·¢ÐÅ£¬ÐżþÖ÷Ì⣺¡°Remove"£¬Èç¹û±¾Óʼþ¸øÄú´øÀ´Á˲»±ã£¬ÎÒÃÇÉî±íǸÒâ¡£
    Under Bill s.1618 Title III passed by the 105th U.S. Congress this mail cannot be considered Spam as long as we include contact information and a remove link for removal from our mailing list. To be removed from our mailing list reply with "remove" and include your "original email address/addresses" in the subject heading send to here. Include complete address/addresses and/or domain to be removed. We will immediately update it accordingly. We apologize for the inconvenience if any caused.
    From rakdver@hotmail.com Thu Mar 21 07:44:51 2002 From: rakdver@hotmail.com (Zdenek Dvorak) Date: Thu, 21 Mar 2002 07:44:51 +0000 Subject: Haskell puzzles! Message-ID: Hello. >- All the answers are at the end of this mail. > >----------------------------------------------------- >1) Are e1 and e2 equal? > > > f (x:xs) y = x > > g (x:xs) = \y -> x > > > > e1 = seq (f []) 1 > > e2 = seq (g []) 1 Should not these be f (x:xs) y = y g (x:xs) = \y -> y ? Otherwise, both e1 and e2 are obviously undefined. Zdenek Dvorak _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com From kyagrd@bawi.org Thu Mar 21 08:52:15 2002 From: kyagrd@bawi.org (Ahn Ki-yung) Date: Thu, 21 Mar 2002 17:52:15 +0900 Subject: Hugs Bug ! Message-ID: <3C999F3F.97BF994D@bawi.org> Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!} Prelude> f 1 where f x = x : f x ==================== in unix/linux proper error msg comes out and back to interpreter. ERROR - Control stack overflow =========== but in windows 2000 Then suddnly interpreter fails and the red (X) popup window pops up. hugs.exe - application programm error unknown software exception (0xc000fd) ... blabla From rjmh@cs.chalmers.se Thu Mar 21 09:18:21 2002 From: rjmh@cs.chalmers.se (John Hughes) Date: Thu, 21 Mar 2002 10:18:21 +0100 (MET) Subject: using less stack Message-ID: <200203210918.KAA02073@muppet30.cs.chalmers.se> \begin{rant} I think the whole seq thing is very confusing for beginning/intermediate haskell programmers. I was very confused for a long time as to why > (unsafePerformIO (putStrLn "Hello")) `seq` 5 would print "Hello", but > [unsafePerformIO (putStrLn "Hello")] `seq` 5 would not. ... I would almost prefer if the semantics of `seq` were instead those of rnf or deepSeq, so long as either (a) we were allowed to derive DeepSeq or NFData, or (b) if the compiler would just do it itself. Yes, this would cut down on the expressions which we could `seq`, but does that really matter. ... \end{rant} Well, seq isn't there to enable sequencing of unsafe IO. It's there to enable space optimisation. When heap profiling was first developed for Haskell, it fairly soon became clear that fine control of evaluation order was often the key to fixing space leaks. (Note: "fine control" includes making things lazier at times via ~ patterns, but also making things stricter at times). Seq is designed so that you can take ANY expression and move its evaluation where you want. If we only had deepSeq, we could only move an expression together with all of its subexpressions -- not good if a lazy list needs to be forced a little earlier! As for putting seq in a class excluding functions, that would mean that if you happened to use a function to represent an abstract data type, you would suddenly be unable to control the evaluation order of programs using that abstract data type -- and so potentially, unable to fix space leaks in them. That would make functions a kind of second class citizen: you would always know, when choosing a representation for an ADT, that if you chose a function then that would have an impact on space debugging later... If one is going to provide control of evaluation order (and it IS important), why surround it with complex rules and restrictions, when seq provides it simply for every single expression in the language? Space debugging is a bit of a hobby horse of mine, and I know it is considered by many to be something of a black art. It isn't so hard really: just run the heap profiler, find the leaks, and often the fix involves changing evaluation order. Use seq or ~ to do so. (There can be other fixes also, but these are a good start). I can't emphasize too much how useful the heap profiler is for building good intuitions about how programs are evaluated. I'd strongly advise intermediate Haskell programmers to spend some time using it: one learns a LOT! John Hughes From trinder@cee.hw.ac.uk Thu Mar 21 09:19:44 2002 From: trinder@cee.hw.ac.uk (Phil Trinder) Date: Thu, 21 Mar 2002 09:19:44 +0000 (GMT Standard Time) Subject: question about concurrency implementation In-Reply-To: Message-ID: Dean, Alastair Reid wrote: > > Just to be sure we agree on terminology: some people like to > > distinguish between "parallelism" and "concurrency". > > > > Parallelism is a way of going faster but doesn't change your > > programming model. Implemented correctly, a parallel implementation > > yields the same results as a sequential implementation - it just runs > > faster. (This is ignoring the effects of interaction with the outside > > world, of course - since that can also affect determinism.) Parallel > > Haskell adds "par" and friends (operations which have no effect on the > > semantics of your program). > > > > Concurrency changes your programming model. A concurrent program is > > allowed to give different results and interesting interactions > > (including race conditions) between threads. A concurrent program may > > run on a single processor. Concurrent Haskell adds forkIO, > > killThread, MVars, etc (operations which affect not just the semantics > > of your program but also the way the semantics are defined). We distinguish between parallel, concurrent and distributed depending on the number of processors and whether threads are *stateful*, i.e. access stateful objects like Mvars or Files, or *stateless*. That is: Sequential, e.g. Haskell 98: 1 PE, 1 Stateful thread, 0 stateless threads Concurrent, e.g. Concurrent Haskell: 1 PE, N Stateful thread, 0 stateless threads Parallel, e.g. GpH: N PEs, 1 Stateful thread, N stateless threads Distributed, e.g. GdH: N PEs, N Stateful thread, N stateless threads In fact these languages form an inclusion hierarchy, e.g. GdH is a superset of both GpH and Concurrent Haskell: GdH / \ GpH Conc. Haskell \ / Haskell 98 Dean Herington wrote: > I've asked these questions in order to convince myself that multiple > threads can (and will) cooperate in lazily evaluating a value they share, > without need for any special programming. In particular, I plan to have > multiple threads share values whose computations involve uses of > `unsafePerformIO` (the safety of which my application's usage pattern > guarantees). The key issue is whether the 'values' are stateful (e.g. Mvars or Files) or stateless (e.g. a shared Haskell variable). Sharing stateless objects between parallel, concurrent, or distributed threads preserves sequential semantics, but sharing stateful objects can introduce non-determinism, unless you have additional properties. Phil -------------------------------------------------- Phil Trinder Department of Computing and Electrical Engineering Heriot Watt University Riccarton Edinburgh, EH14 4AS E-mail: trinder@cee.hw.ac.uk Teleph: +44 (0)131 451 3435 Depart: +44 (0)131 451 3328 Fasmly: +44 (0)131 451 3327 Intrnt: http://www.cee.hw.ac.uk/~trinder From wflp2002@dimi.uniud.it Wed Mar 20 19:43:40 2002 From: wflp2002@dimi.uniud.it (WFLP2002 Organizing Committee) Date: Wed, 20 Mar 2002 20:43:40 +0100 Subject: [E-CFP] WFLP2002 - deadline EXTENSION Message-ID: --============_-1195469066==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Dear Colleague The submission deadline for the WFLP 2002 has been extended till March 27, 2002 WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming. WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration. For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/ Papers are due by March 27, 2002. This is a firm deadline. You can submit papers following the electronic submission process at: http://www.dimi.uniud.it/~wflp2002/submit/ We hope that this "Call For Papers" will be useful for your work. Please forward the following to anybody who you think may be interested. Our apologies if you received multiple copy of this. -- WFLP 2002 Organizing Committee http://www.dimi.uniud.ut/~wflp2002/ --============_-1195469066==_ma============ Content-Type: text/html; charset="us-ascii" [E-CFP] WFLP2002 - deadline EXTENSION
    Dear Colleague

    The submission deadline for the WFLP 2002 has been extended till
          March 27, 2002
    WFLP 2002 is the 11th international workshop on functional and (constraint) logic programming.  WFLP 2002 aims to bring together researchers interested in functional programming, (constraint) logic programming, as well as their integration.  For further details about the workshop please visit the web site http://www.dimi.uniud.it/~wflp2002/

    Papers are due by March 27, 2002. This is a firm deadline.

    You can submit papers following the electronic submission process at:

    http://www.dimi.uniud.it/~wflp2002/submit/

    We hope  that this  "Call For  Papers" will be  useful for  your work.
    Please  forward  the  following  to  anybody  who  you  think  may  be
    interested.  Our apologies if you received multiple copy of this.
    -- 
    
    WFLP 2002 Organizing Committee
    http://www.dimi.uniud.ut/~wflp2002/
    --============_-1195469066==_ma============-- From gmh@Cs.Nott.AC.UK Thu Mar 21 11:57:20 2002 From: gmh@Cs.Nott.AC.UK (Graham Hutton) Date: Thu, 21 Mar 2002 11:57:20 +0000 Subject: using less stack Message-ID: <20020321115730.2DA034223CC@www.haskell.org> > In the case of foldr the end of the list has to be > reached before anything can be evaluated. This is perhaps a good time to point out the common missconception that foldr can only be used to define functions that process the elements of lists in right-to-left order. For a discussion of this point, see section 5 of my JFP tutorial paper on foldr, which (amonst other things) shows how to sum a list of numbers in left-to-right order using foldr: http://www.cs.nott.ac.uk/~gmh/fold.pdf Graham +----------------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | Foundations of Programming Group Web : http://www.cs.nott.ac.uk/~gmh | | School of Computer Science and IT | | University of Nottingham | | Jubilee Campus, Wollaton Road | | Nottingham NG8 1BB Phone : +44 (0)115 951 4220 | | United Kingdom Fax : +44 (0)115 951 4254 | +----------------------------------------------------------------------------+ From rjchaaft@cs.uu.nl Thu Mar 21 13:38:05 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Thu, 21 Mar 2002 14:38:05 +0100 Subject: Haskell puzzles! In-Reply-To: Message-ID: <4.3.0.20020321143034.00b30018@pop.students.cs.uu.nl> Zdenek Dvorak wrote: >>----------------------------------------------------- >>1) Are e1 and e2 equal? >> >> > f (x:xs) y = x >> > g (x:xs) = \y -> x >> > >> > e1 = seq (f []) 1 >> > e2 = seq (g []) 1 > >Should not these be > >f (x:xs) y = y >g (x:xs) = \y -> y >? >Otherwise, both e1 and e2 are obviously undefined. That seems to be obvious, but e1 is NOT undefined! That's the point Daan makes. seq forces it's first argument and returns the second one. However, because f is partially parametrized, seq doesn't change anything in f and just returns 1. The right-hand-side of f is not involved at all! In e2 though, g is fully parametrized, so seq behaves as you expect and the pattern match failes. Rijk-Jan From rjchaaft@cs.uu.nl Thu Mar 21 14:04:35 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Thu, 21 Mar 2002 15:04:35 +0100 Subject: Hugs Bug ! In-Reply-To: <3C999F3F.97BF994D@bawi.org> Message-ID: <4.3.0.20020321150155.00b2cef8@pop.students.cs.uu.nl> >but in windows 2000 > >Then suddnly interpreter fails and >the red (X) popup window pops up. > >hugs.exe - application programm error > > unknown software exception (0xc000fd) ... blabla Are you sure you have the very very very latest download? There have been some undocumented updates of the December 2001 release of Hugs. Download the very latest release and try it again. I tried you expression on Win2000, with Hugs Dec 2001, downloaded last week, and it runs in constant space for an unlimited time. Rijk-Jan From petersen@redhat.com Thu Mar 21 14:20:17 2002 From: petersen@redhat.com (Jens Petersen) Date: 21 Mar 2002 23:20:17 +0900 Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: <1016658532.3061.43.camel@volker> References: <1016658532.3061.43.camel@volker> Message-ID: Hi Volker, Volker Wysk writes: > On Mit, 2002-03-20 at 07:00, Jens Petersen wrote: > > Jens Petersen writes: > > > > > > The problem is that the child process doesn't > > > > receive all the data which the parent sends. It's as > > > > if "hPutStr vonh txt" sends the data lazily somehow, > > > > and "hClose vonh" closes the pipe prematurely. > > > > > > > > It varies from run to run exactly which data gets > > > > through. If I cause the child process to read all > > > > its input immediately, the problem doesn't seem to > > > > occur. Normally, it does so gradually, which takes a > > > > few seconds. > > > > > > > > I'm using GHC 5.02.2 > > > > > > Quite possibly could be a bug. Lazy IO is rather subtle I > > > think, specially when done across pipes. I faced some > > > similar problem with in POpen recently. You can see how I > > > solved it (worked round it?) by comparing the latest release > > > 1.00 with the previous one 0.00.1: > > > > > > http://www.01.246.ne.jp/~juhp/haskell/popenhs/ > > POpen-1.0.0 contains the same bug which I made. It doesn't ensure that > the values which are needed after the call of forkProcess, before that > of executeFile, are fully evaluated. So, if they are read lazily from a > stream, the newly spawned child process reads data from a stream which > it shares with its parent, making it disappear from the parent's input. > In this situation, this sure isn't intended. Perhaps you could give an explicit example? > Inserting the following lines just before the line "pid <- forkProcess", > in POpen.hs, would force the corresponding values to be evaluated, so no > data will be lost. > > seq (length path) $ seq (sum (map length args)) $ return () > when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) > (fromJust env))) $ return () > when (isJust dir) $ seq (length (fromJust dir)) $ return () Hmmm, I don't really see why this is necessary. Don't the lazy values of "path", "env" and "dir" just get evaluated when they're needed here as normal? (If what you say is true though it would be simpler just to use "$!" or "!"s for strict evaluation I guess.) I would be more worried about the input stream string not being complete when the input handle is closed. > I'm also not sure what this part is supposed to do: > > inr <- if (isJust inpt) then > do > (inr', inw) <- createPipe > hin <- fdToHandle inw > hPutStr hin $ fromJust inpt > hClose hin > return $ Just inr' > else > return Nothing It returns the output end of a pipe containing the input string if one is given. > Doesn't it write the input data to a pipe which no process reads > from..?? Nope, "doTheBusiness" dup2's it to the stdin of the subprocess: (outr, outw) <- createPipe (errr, errw) <- createPipe pid <- forkProcess case pid of Nothing -> doTheBusiness inr outw errw -- *** Just p -> do -- close other end of pipes in here when (isJust inr) $ fdClose $ fromJust inr fdClose outw fdClose errw hout <- fdToHandle outr outstrm <- hGetContents hout herr <- fdToHandle errr errstrm <- hGetContents herr return (outstrm, errstrm , p) where doTheBusiness :: Maybe Fd -- stdin -> Fd -- stdout -> Fd -- stderr -> IO (String, String, ProcessID) -- (stdout, stderr) doTheBusiness inr outw errw = do maybeChangeWorkingDirectory dir when (isJust inr) $ dupTo (fromJust inr) stdInput -- *** dupTo outw stdOutput dupTo errw stdError executeFile path True args env -- for typing, should never actually run error "executeFile failed!" Jens From anatoli@yahoo.com Thu Mar 21 16:35:27 2002 From: anatoli@yahoo.com (anatoli) Date: Thu, 21 Mar 2002 08:35:27 -0800 (PST) Subject: Lambda over types. Message-ID: <20020321163527.92822.qmail@web14201.mail.yahoo.com> I apologise in case this doesn't make any sense. ghc -fglasgow-exts -fallow-undecidable-instances allows constructs which amount to lambda abstraction over types. I've written a small untyped lambda calculus interpreter in the Haskell class/instance sublanguage, just to prove this point. (The terms are Haskell *types*.) Using this interpreter as a basis, and adapting it as necessary, I can now write arbitrary "functions" [1] that take types to types. But of course it's a pain to write them like that. Maybe, after all, it does make sense to have a dedicated lambda-over-types Haskell extension which is convenient to use? [1] - I cannot produce an equivalent of > type Foo a b c = a b c but I can do an equivalent of this: > fun :: T1 -> T2 -> T3 -> T1 T2 T3 -- anatoli __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ From anatoli@yahoo.com Thu Mar 21 17:37:46 2002 From: anatoli@yahoo.com (anatoli) Date: Thu, 21 Mar 2002 09:37:46 -0800 (PST) Subject: Lambda over types. In-Reply-To: Message-ID: <20020321173746.48681.qmail@web14202.mail.yahoo.com> --0-681966285-1016732266=:42373 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hal Daume III wrote: > I'd be interested in seeing how you do this. I attempted such a thing a > while back but was unsuccessful. Attached are two interpreters: one for untyped lambda calculus, and one for an Unlambda-style language (combinators). Of course pure lambda terms are not very useful Haskell types. You may use your own types as primitive terms by defining instances of Subst and/or Eval of them. -- anatoli __________________________________________________ Do You Yahoo!? Yahoo! Movies - coverage of the 74th Academy Awards® http://movies.yahoo.com/ --0-681966285-1016732266=:42373 Content-Type: application/x-unknown; name="lambda.lhs" Content-Transfer-Encoding: base64 Content-Description: lambda.lhs Content-Disposition: attachment; filename="lambda.lhs" VGhlIGNsYXNzIG1ldGhvZHMsIGxhbWJkYVN1YnN0IGFuZCBsYW1iZGFFdmFs LCBhcmUKZm9yIGRlYnVnZ2luZyBmcm9tIEh1Z3MvZ2hjaSBwcm9tcHQuClRv IGV2YWx1YXRlIGEgdGVybSwgdHlwZToKCkxhbWJkYT46dCBsYW1iZGFFdmFs IDx0ZXJtPgoKZm9yIGluc3RhbmNlCgpMYW1iZGE+OnQgbGFtYmRhRXZhbCAo QSAoTCBYIFgpIChMIFkgWikpCkwgWSBaCkxhbWJkYT46dCBsYW1iZGFFdmFs IChBIChMIFggKEEgWCBYKSkgKEwgWCAoQSBYIFgpKSkKPGRvZXMgbm90IHRl cm1pbmF0ZT4KCj4gbW9kdWxlIExhbWJkYSB3aGVyZQoKVmFyaWFibGVzIAoK PiBkYXRhIFggPSBYCj4gZGF0YSBZID0gWQo+IGRhdGEgWiA9IFoKPiBkYXRh IFQgPSBUCgpMYW1iZGEgYWJzdHJhY3Rpb24gOiBceC0+eQoKPiBkYXRhIEwg eCB5ID0gTCB4IHkKCkFwcGxpY2F0aW9uIDogeCB5Cgo+IGRhdGEgQSB4IHkg PSBBIHggeQoKU3Vic3RpdHV0aW9uCgo+IGNsYXNzIFN1YnN0IHYgZSB0IHIg fCB2IGUgdCAtPiByIHdoZXJlCj4gICBsYW1iZGFTdWJzdCA6OiB2IC0+IGUg LT4gdCAtPiByCj4gICBsYW1iZGFTdWJzdCA9IHVuZGVmaW5lZAoKVHJpdmlh bCBzdWJzdGl0dXRpb25zCgo+IGluc3RhbmNlIFN1YnN0IFggYSBYIGEKPiBp bnN0YW5jZSBTdWJzdCBYIGEgWSBZCj4gaW5zdGFuY2UgU3Vic3QgWCBhIFog Wgo+IGluc3RhbmNlIFN1YnN0IFggYSBUIFQKCj4gaW5zdGFuY2UgU3Vic3Qg WSBhIFggWAo+IGluc3RhbmNlIFN1YnN0IFkgYSBZIGEKPiBpbnN0YW5jZSBT dWJzdCBZIGEgWiBaCj4gaW5zdGFuY2UgU3Vic3QgWSBhIFQgVAoKPiBpbnN0 YW5jZSBTdWJzdCBaIGEgWCBYCj4gaW5zdGFuY2UgU3Vic3QgWiBhIFkgWQo+ IGluc3RhbmNlIFN1YnN0IFogYSBaIGEKPiBpbnN0YW5jZSBTdWJzdCBaIGEg VCBUCgo+IGluc3RhbmNlIFN1YnN0IFQgYSBYIFgKPiBpbnN0YW5jZSBTdWJz dCBUIGEgWSBZCj4gaW5zdGFuY2UgU3Vic3QgVCBhIFogWgo+IGluc3RhbmNl IFN1YnN0IFQgYSBUIGEKClNjb3BlIHJ1bGVzCgo+IGluc3RhbmNlICAgICAg ICAgICAgICAgICAgU3Vic3QgWCBhIChMIFggYikgKEwgWCBiKQo+IGluc3Rh bmNlIFN1YnN0IFggYSBiIGMgPT4gU3Vic3QgWCBhIChMIFkgYikgKEwgWSBj KQo+IGluc3RhbmNlIFN1YnN0IFggYSBiIGMgPT4gU3Vic3QgWCBhIChMIFog YikgKEwgWiBjKQo+IGluc3RhbmNlIFN1YnN0IFggYSBiIGMgPT4gU3Vic3Qg WCBhIChMIFQgYikgKEwgVCBjKQoKPiBpbnN0YW5jZSBTdWJzdCBZIGEgYiBj ID0+IFN1YnN0IFkgYSAoTCBYIGIpIChMIFggYykKPiBpbnN0YW5jZSAgICAg ICAgICAgICAgICAgIFN1YnN0IFkgYSAoTCBZIGIpIChMIFkgYikKPiBpbnN0 YW5jZSBTdWJzdCBZIGEgYiBjID0+IFN1YnN0IFkgYSAoTCBaIGIpIChMIFog YykKPiBpbnN0YW5jZSBTdWJzdCBZIGEgYiBjID0+IFN1YnN0IFkgYSAoTCBU IGIpIChMIFQgYykKCj4gaW5zdGFuY2UgU3Vic3QgWiBhIGIgYyA9PiBTdWJz dCBaIGEgKEwgWCBiKSAoTCBYIGMpCj4gaW5zdGFuY2UgU3Vic3QgWiBhIGIg YyA9PiBTdWJzdCBaIGEgKEwgWSBiKSAoTCBZIGMpCj4gaW5zdGFuY2UgICAg ICAgICAgICAgICAgICBTdWJzdCBaIGEgKEwgWiBiKSAoTCBaIGIpCj4gaW5z dGFuY2UgU3Vic3QgWiBhIGIgYyA9PiBTdWJzdCBaIGEgKEwgVCBiKSAoTCBU IGMpCgo+IGluc3RhbmNlIFN1YnN0IFQgYSBiIGMgPT4gU3Vic3QgVCBhIChM IFggYikgKEwgWCBjKQo+IGluc3RhbmNlIFN1YnN0IFQgYSBiIGMgPT4gU3Vi c3QgVCBhIChMIFkgYikgKEwgWSBjKQo+IGluc3RhbmNlIFN1YnN0IFQgYSBi IGMgPT4gU3Vic3QgVCBhIChMIFogYikgKEwgWiBjKQo+IGluc3RhbmNlICAg ICAgICAgICAgICAgICAgU3Vic3QgVCBhIChMIFQgYikgKEwgVCBiKQoKQXBw bGljYXRpb24gc3Vic3RpdHV0aW9uCgo+IGluc3RhbmNlIChTdWJzdCB2IGUg dCByLCBTdWJzdCB2IGUgdCcgcicpID0+IFN1YnN0IHYgZSAoQSB0IHQnKSAo QSByIHInKQoKRXZhbHVhdGlvbiBydWxlcwoKPiBjbGFzcyBFdmFsIGUgZScg fCBlIC0+IGUnIHdoZXJlCj4gICBsYW1iZGFFdmFsIDo6IGUgLT4gZScKPiAg IGxhbWJkYUV2YWwgPSB1bmRlZmluZWQKClZhcmlhYmxlcyBldmFsdWF0ZSB0 byB0aGVtc2VsdmVzCgo+IGluc3RhbmNlIEV2YWwgWCBYCj4gaW5zdGFuY2Ug RXZhbCBZIFkKPiBpbnN0YW5jZSBFdmFsIFogWgo+IGluc3RhbmNlIEV2YWwg VCBUCgpTbyBpcyBsYW1iZGEgYWJzdHJhY3Rpb24KCj4gaW5zdGFuY2UgRXZh bCAoTCB2IGUpIChMIHYgZSkKCkFwcGxpY2F0aW9uIG9mIGxhbWJkYSBhYnN0 cmFjdGlvbiBpcyBldmFsdWF0ZWQgdmlhIHN1YnN0aXR1dGlvbgoKPiBpbnN0 YW5jZSAoU3Vic3QgdiBnIGUgciwgRXZhbCByIHInKSA9PiBFdmFsIChBIChM IHYgZSkgZykgcicKCkFwcGxpY2F0aW9uIG9mIGFwcGxpY2F0aW9uOiBldmFs dWF0ZSB0aGUgZnVuY3Rpb24gYW5kIHJldHJ5CkhlcmUgbGllcyB0aGUgdW5k ZWNpZGFiaWxpdHkuCgo+IGluc3RhbmNlIChFdmFsIChBIGIgYykgZCwgRXZh bCAoQSBkIGUpIGYpID0+IEV2YWwgKEEgKEEgYiBjKSBlKSBmCgo= --0-681966285-1016732266=:42373 Content-Type: application/x-unknown; name="unlambda.lhs" Content-Transfer-Encoding: base64 Content-Description: unlambda.lhs Content-Disposition: attachment; filename="unlambda.lhs" UXVhc2ktVW5sYW1iZGEgaW50ZXJwcmV0ZXIgaW4gSGFza2VsbCBjbGFzc2Vz IQpTZWUgbGFtYmRhLmxocyBmb3IgaW5zaWdodC4KCj4gbW9kdWxlIFVubGFt YmRhIHdoZXJlCgo+IGRhdGEgSyAgICAgICAgPSBLCj4gZGF0YSBLMSB4ICAg ICA9IEsxIHgKCj4gZGF0YSBTICAgICAgICA9IFMKPiBkYXRhIFMxIHggICAg ID0gUzEgeAo+IGRhdGEgUzIgeCB5ICAgPSBTMiB4IHkKCj4gZGF0YSBJICAg ICAgICA9IEkKCj4gZGF0YSBWICAgICAgICA9IFYKCj4gZGF0YSBBcHAgZiBn ICA9IEFwcCBmIGcKCj4gY2xhc3MgRXZhbCBmIGcgfCBmIC0+IGcgd2hlcmUK PiAgIHVubGFtYmRhRXZhbCA6OiBmIC0+IGcKPiAgIHVubGFtYmRhRXZhbCA9 IHVuZGVmaW5lZAoKPiBjbGFzcyBBcHBseSBmIGcgaCB8IGYgZyAtPiBoIHdo ZXJlCj4gICB1bmxhbWJkYUFwcGx5IDo6IGYgLT4gZyAtPiBoCj4gICB1bmxh bWJkYUFwcGx5ID0gdW5kZWZpbmVkCgo+IGluc3RhbmNlIEV2YWwgSyBLCj4g aW5zdGFuY2UgRXZhbCAoSzEgeCkgKEsxIHgpCj4gaW5zdGFuY2UgRXZhbCBT IFMKPiBpbnN0YW5jZSBFdmFsIChTMSB4KSAoUzEgeCkKPiBpbnN0YW5jZSBF dmFsIChTMiB4IHkpIChTMiB4IHkpCj4gaW5zdGFuY2UgRXZhbCBJIEkKPiBp bnN0YW5jZSBFdmFsIFYgVgoKPiBpbnN0YW5jZSAoRXZhbCB4IHgnLCBFdmFs IHkgeScsIEFwcGx5IHgnIHknIHopID0+IEV2YWwgKEFwcCB4IHkpIHoKCj4g aW5zdGFuY2UgQXBwbHkgSyB4IChLMSB4KQo+IGluc3RhbmNlIEFwcGx5IChL MSB4KSB5IHgKCj4gaW5zdGFuY2UgQXBwbHkgUyB4IChTMSB4KQo+IGluc3Rh bmNlIEFwcGx5IChTMSB4KSB5IChTMiB4IHkpCgo+IGluc3RhbmNlIEFwcGx5 IEkgeCB4Cj4gaW5zdGFuY2UgQXBwbHkgViB4IFYKCj4gLS0gVGhlIHVuZGVj aWRhYmxlIHBhcnQgCj4gaW5zdGFuY2UgRXZhbCAoQXBwIChBcHAgeCB6KSAo QXBwIHkgeikpIHQgPT4gQXBwbHkgKFMyIHggeSkgeiB0Cgo= --0-681966285-1016732266=:42373-- From icalp2002@informatica.uma.es Thu Mar 21 18:19:43 2002 From: icalp2002@informatica.uma.es (icalp2002@informatica.uma.es) Date: Thu, 21 Mar 2002 19:19:43 +0100 Subject: ICALP2002: accepted papers and preliminary program Message-ID: This is a multi-part message in MIME format. --------------9F1656E3A2720904ECEA2E70 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Dear Sir/Madam, I'm sending you the following information: -the list of accepted papers for ICALP'2002 (an HTML table with two columns; authors and title) -the preliminary program of ICALP'2002 is available on http://sirius.lcc.uma.es/ICALP2002/PreliminarySchedule.html (and on the "news" of ICALP2002 pages: http://www.lcc.uma.es/ICALP2002) -the preliminary program of the satellite event "Global Computing" (in the same link). I consider that this conference can be of your interest. The registration will be open in a few days. Best regards, Rafael Morales --------------9F1656E3A2720904ECEA2E70 Content-Type: text/html; charset=us-ascii; name="tableAceptICALP2002.htm" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tableAceptICALP2002.htm" Track A

    Track A

     

    Peter Hertling;

    A Banach-Mazur Computable but not Markov Computable Function on the Computable Real Numbers

    Seth Pettie;

    A Faster All-pairs Shortest Path Algorithm for Real-weighted Sparse Graphs

    Juhani Karhumäki; Leonid P. Lisovik;

    A surprising undecidability result: The equivalence problem for finite substitutions on $ab^*c$

    Doerr Benjamin;

    Antirandomizing the Wrong Game

    Piotr Berman; Marek Karpinski; Yakov Nekrich;

    Approximating Huffman Codes in Parallel

    Marek Karpinski; Piotr Berman;

    Approximation Hardness of Bounded Degree MIN-CSP and MIN-BISECTION

    Nathan Segerlind;

    Bounded Depth Frege with Counting Principles Polynomially Simulates Nullstellensatz Refutations

    Rolf Fagerberg; Gerth Stølting Brodal;

    Cache Oblivious Distribution Sweeping

    Udo Adamy;

    Call Control in Rings

    Jurdzinski Tomasz;

    Church-Rosser Languages vs. UCFL

    Vincenzo Liberatore;

    Circular Arrangements

    Victor Dalmau;

    Constraint Satisfaction Problems in Non-Deterministic Logarithmic Space

    Joseph (Seffi) Naor;

    Control Message Aggregation in Group Communication Protocols

    John Hitchcock;

    Correspondence Principles for Effective Dimensions

    Aggelos Kiayias; Moti Yung;

    Cryptographic Hardness based on the Decoding of Reed-Solomon Codes

    Colin Stirling;

    Deciding DPDA equivalence is primitive recursive

    Yoshiharu Kohayakawa; Brendan Nagle; Vojtech Rodl;

    Efficient testing of hypergraphs

    Peter Sanders; Rene Beier; Naveen Sivadasan; Edgar Ramos;

    Energy Optimal Routing in Radio Networks Using Geometric Data Structures

    Dima Grigoriev; Edward A. Hirsch; Dmitrii V. Pasechnik;

    Exponential Lower Bound for Static Semi-Algebraic Proofs

    Rajeev Raman;

    Exponential structures for cache-oblivious algorithms

    Karhan Akcoglu;

    Fast Universalization of Investment Strategies with Provably Good Relative Returns

    Moses Charikar; Kevin Chen; Martin Farach-Colton;

    Finding Frequent Items in Data Streams

    Thore Husfeldt;

    Finding a Path of Superlogarithmic Length

    Xiaotie Deng; Guojun Li; Zimao Li; Bin ma; Lusheng Wang;

    Genetic Design of Drug without Side-effect

    Leszek Gasieniec; Andrzej Lingas;

    Gossiping with bounded size messages in unknown ad-hoc radio networks

    Elias Koutsoupias; Christos Papadimitriou; Alex Fabrikant;

    Heuristically Optimized Trade-offs: A New Paradigm for Power Laws in the Internet

    Martin Strauss; Sudipto Guha; Piotr Indyk; Muthu Muthukrishnan;

    Histogramming Data Streams with Fast Per-Item Processing

    Papazian Christophe;

    Hyperbolic Recognition by Cellular Automata

    Camil Demetrescu; Giuseppe F. Italiano;

    Improved Bounds and New Trade-Offs for Dynamic All Pairs Shortest Paths

    Jonas Holmerin;

    Improved Inapproximability Results for Vertex Cover on k-regular Hyper-graphs

    V.S. Anil Kumar Kumar;

    Improved Results for Stackelberg Scheduling Strategies

    Tomasz Radzik;

    Improving time bounds on maximum generalised flow computation

    Lars Engebretsen; Jonas Holmerin; Alexander Russell;

    Inapproximability Results for Equations Over Finite Groups

    Sebastian Bala;

    Intersection of Regular Language and Star Hierarchy

    Ryuhei Uehara;

    Linear Time Algorithms on Chordal Bipartite and Strongly Chordal Graphs

    Moses Charikar; Piotr Indyk; Rina Panigrahy;

    New Algorithms for Subset Query, Partial Match, Orthogonal Range Searching and Related Problems

    Steve Seiden; Leah Epstein; Rob van Stee;

    New Bounds for Variable-Sized and Resource Augmented Online Bin Packing

    Nicola Galesi; Juan Luis Esteban; Jochen Messner;

    On the Complexity of Resolution with Bounded Conjunctions

    Conrado Martinez; Amalia Duch;

    On the average performance of orthogonal range search in multidimensional data structures

    Sylvain Lombardy;

    On the construction of reversible automata for reversible languages

    Rasmus Pagh; Anna Östlin;

    One-Probe Search

    Xiaodong Wu; Danny Chen;

    Optimal Net Surface Problems with Applications

    Andreas Jakoby; Maciej Liskiewicz;

    Paths Problems in Symmetric Logarithmic Space

    Eyal Kushilevitz; Yuval Ishai;

    Perfect Constant-Round Secure Computation via Perfect Randomizing Polynomials

    Andrzej Lingas; Artur Czumaj; Hairong Zhao;

    Polynomial-Time Approximation Schemes for the Euclidean Survivable Network Design Problem

    Marek Chrobak; Leah Epstein; John Noga; Jiri Sgall; Rob van Stee; Tomas Tichy; Nodari Vakhania;

    Preemptive Scheduling in Overloaded Systems

    Amr Elmasry;

    Priority queues, pairing and adaptive sorting

    Chris Pollett; Farid Ablayev; Cris Moore;

    Quantum and Stochastic Branching Programs of Bounded Width

    Philippe Flajolet;

    Random Sampling from Boltzmann Principles

    Vasco Brattka;

    Random numbers and an incomplete immune recursive set

    Harald Räcke; Micah Adler; Naveen Sivadasan; Christian Sohler; Berthold Vöcking;

    Randomized Pursuit-Evasion in Graphs

    Kazuo Iwama;

    Removable On-Line Knapsack Problems

    Peter Damaschke;

    Scheduling search procedures

    Carlo Fantozzi; Andrea Pietracaprina; Geppino Pucci;

    Seamless Integration of Parallelism and Memory Hierarchy

    Gerth Stølting Brodal; Rune Bang Lyngsø; Anna Östlin; Christian N. S. Pedersen;

    Solving the String Statistics Problem in Time $O(n\log n)$

    Ugo Vaccaro; Pavol Hell; Ladislav Stacho; Luisa Gargano;

    Spanning trees with bounded number of branch vertices

    Wolfgang Merkle;

    The Kolmogorov-Loveland stochastic sequences are not closed under selecting subsequences

    Robert A. Hearn; Erik D. Demaine;

    The Nondeterministic Constraint Logic Model of Computation: Reductions and Applications

    Ollinger Nicolas;

    The Quest for Small Universal Cellular Automata

    Dimitrios Fotakis; Spyros Kontogiannis; Elias Koutsoupias; Marios Mavronicolas; Paul Spirakis;

    The Structure and Complexity of Nash Equilibria for a Selfish Routing Game

    Noam Nisan;

    The communication complexity of approximate set packing and covering

    Mikolaj Bojanczyk;

    Two-Way Alternating Automata and Finite Models

    Mohamed Mosbah; Nicolas Bonichon; Bertrand Le Saec;

    Wagner's theorem on Realizers

    John Hitchcock; Jack Lutz;

    Why Computational Complexity Requires Stricter Martingales

     

     

     

     

    Track B

     

    Philippa Gardner;

    A Spatial Logic for Querying Graphs

    Rosu Grigore;

    A Total Approach to Partial Algebraic Specification

    Paul Gastin;

    An Elementary Expressively Complete Temporal Logic for Mazurkiewicz Traces

    Lohrey Markus;

    Axiomatising Divergence

    Marco Kick;

    Bialgebraic Modelling of Timed Processes

    Alex Simpson;

    Comparing functional paradigms for exact real-number computation

    Bharat Adsul; Milind Sohoni;

    Expressively Complete Tractable Linear Time Temporal Logics over Traces

    Luke Ong;

    Games Characterizing Levy-Longo Trees

    Zeitoun Marc; muscholl anca; genest blaise; seidl helmut;

    Infinite-state High-Level MSCs: Model-Checking and Realizability

    James Worrell; Keye Martin; Mike Mislove;

    Measuring the Probabilistic Powerdomain

    Michal Bielecki; Hidders Jan; Jan Paredaens; Jerzy Tyszkiewicz; Jan Van den Bussche;

    Navigating with a Browser

    Colcombet Thomas;

    On Families of Graphs Having a Decidable First Order Theory with Reachability

    Dietrich Kuske; Markus Lohrey;

    On the theory of one-step rewriting in trace monoids

    Jiri Srba;

    Strong Bisimilarity and Regularity of Basic Process Algebra is PSPACE-Hard

    Thierry Cachat;

    Symbolic Strategy Synthesis for Games on Pushdown Graphs

    Franck van Breugel;

    Testing Labelled Markov Processes

    J. B. Wells Wells;

    The Essence of Principal Typings

    Freddy Mang; Thomas A. Henzinger; Orna Kupferman; Sriram Krishnan;

    The Synthesis of Uninitialized Systems

    Klaus Wich;

    Universal Inherence of cycle-free context-free Ambiguity Functions

    --------------9F1656E3A2720904ECEA2E70-- From post@volker-wysk.de Thu Mar 21 23:31:35 2002 From: post@volker-wysk.de (Volker Wysk) Date: Fri, 22 Mar 2002 00:31:35 +0100 (CET) Subject: Bug in IO libraries when sending data through a pipe? In-Reply-To: Message-ID: Hi On 21 Mar 2002, Jens Petersen wrote: > Volker Wysk writes: > > POpen-1.0.0 contains the same bug which I made. It doesn't ensure that > > the values which are needed after the call of forkProcess, before that > > of executeFile, are fully evaluated. So, if they are read lazily from a > > stream, the newly spawned child process reads data from a stream which > > it shares with its parent, making it disappear from the parent's input. > > In this situation, this sure isn't intended. > > Perhaps you could give an explicit example? I haven't tried it, but it's exactly the same thing. > > Inserting the following lines just before the line "pid <- forkProcess", > > in POpen.hs, would force the corresponding values to be evaluated, so no > > data will be lost. > > > > seq (length path) $ seq (sum (map length args)) $ return () > > when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) > > (fromJust env))) $ return () > > when (isJust dir) $ seq (length (fromJust dir)) $ return () > > Hmmm, I don't really see why this is necessary. Don't the > lazy values of "path", "env" and "dir" just get evaluated > when they're needed here as normal? (If what you say is > true though it would be simpler just to use "$!" or "!"s for > strict evaluation I guess.) Yes, and that's *after* forkProcess. So when they are computed from the lazily read contents of a stream, the newly spawned child will read data from a stream which it shares with its parent. > > I'm also not sure what this part is supposed to do: > > > > inr <- if (isJust inpt) then > > do > > (inr', inw) <- createPipe > > hin <- fdToHandle inw > > hPutStr hin $ fromJust inpt > > hClose hin > > return $ Just inr' > > else > > return Nothing > > It returns the output end of a pipe containing the input > string if one is given. > > > Doesn't it write the input data to a pipe which no process reads > > from..?? > > Nope, "doTheBusiness" dup2's it to the stdin of the subprocess: [...] But hPutStr, followed by hClose, won't complete until all the input string has been written, while no process is listening. Volker From bhuffman@galois.com Fri Mar 22 00:21:43 2002 From: bhuffman@galois.com (Brian Huffman) Date: Thu, 21 Mar 2002 16:21:43 -0800 Subject: catch (fail "...") Message-ID: <200203220021.g2M0LiX09437@localhost.localdomain> Hi, Here is a problem I came across recently, revealing a difference between ghci and Hugs: hugs> catch (error "not ok") (\e -> putStrLn "ok") Program error: not ok ghci> catch (error "not ok") (\e -> putStrLn "ok") *** Exception: not ok hugs> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") ok ghci> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") ok hugs> catch (fail "not ok") (\e -> putStrLn "ok") Program error: not ok ghci> catch (fail "not ok") (\e -> putStrLn "ok") ok As I expected, neither of them can catch "error", and both of them can catch "ioError". But only ghci can catch the "fail". It seems to me that ghc has made a convenient choice here, because if I need to raise an IO exception, it is easier to type "fail s" than "ioError (userError s)". However, the online Haskell report says that for IO, fail s = error s, which is what Hugs does. (http://www.haskell.org/onlinereport/standard-prelude.html#$iMonad$$IO) Does anyone know the reasoning behind the design choice made in the report, or why the ghc implementation is different? I am mainly concerned about portability issues: particularly, is it a good idea to use fail for raising IO exceptions? Thanks - Brian Huffman From senganb@ia.nsc.com Fri Mar 22 03:10:14 2002 From: senganb@ia.nsc.com (senganb@ia.nsc.com) Date: Thu, 21 Mar 2002 22:10:14 -0500 Subject: Haskell slicing tool? In-Reply-To: <3C986787.830C8F9B@cs.york.ac.uk> References: <20020319132039.37e63d70.senganb@ia.nsc.com> <3C986787.830C8F9B@cs.york.ac.uk> Message-ID: <20020321221014.6c7b7fdb.senganb@ia.nsc.com> On Wed, 20 Mar 2002 10:42:15 +0000 "Olaf Chitil" wrote: > Sengan.Baring-Gould@nsc.com wrote: > > > > > Are there any tools to perform program slicing on Haskell? > > > > I often find myself wanting to find all "fromJusts" invoked > > > > from the current function, or all functions that use a > > > > particular member of my monad's ADT. > > > Actually I was hoping for a static tool. > > I'd be interested to learn for what purpose you want this kind of > information and also more precisely what you would like such a static > tool to do for you. > > Olaf I looked at for what I use the "#" command in vim over the last 2 days, and when it becomes insufficient: * Upwards slicing: - to see what parameters a function is actually given (can be quite a long way from where the parameter is actually constructed, versus simply passed around). - to find dead code (function results that are never used) * Downwards slicing - to debug code (which head failed? One of those under function f, but what are they?) - which instance of (>>=) is it that I'm using here? * Complex queries: A := set of all functions refered to by f1's definition B := set of all functions refered to by f2's definition C := set of functions I'm interested in D := intersection of A, B and C D would then be the functions used both by A and B of the set I'm interested in C. In general the answer is to understand, debug and refactor code in larger projects (my current project weighs 4500 lines of Haskell for instance). Sengan From hallgren@cse.ogi.edu Fri Mar 22 04:09:25 2002 From: hallgren@cse.ogi.edu (Thomas Hallgren) Date: Thu, 21 Mar 2002 20:09:25 -0800 Subject: stripcomments 1.0 References: Message-ID: <3C9AAE75.1000508@cse.ogi.edu> Hi, There now is a program that strips comments and blank lines properly. You can get the Haskell source code from: http://www.cse.ogi.edu/~hallgren/stripcomments/ How hard it is to do a real job of course depends on what you start from. I happened to have a lexer for Haskell, that was really easy to reuse for this purpose! Regards, Thomas Hallgren Nicholas Nethercote wrote: >On Mon, 18 Mar 2002, Kevin Glynn wrote: > >> > Are there any programs to strip comments and blank lines from a Haskell >> > source file, that work on normal and literate programs? >> >>Doing a real job is 'hard' >> >I'm surprised there aren't programs out there that do this properly. > From kyagrd@bawi.org Fri Mar 22 04:24:35 2002 From: kyagrd@bawi.org (Ahn Ki-yung) Date: Fri, 22 Mar 2002 13:24:35 +0900 Subject: Typo: Hugs Bug ! >> it was + References: <3C999F3F.97BF994D@bawi.org> Message-ID: <3C9AB203.C6916529@bawi.org> Prelude> f 1 where f x = x : f x [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, ,1,1,{Interrupted!} Prelude> f 1 where f x = x + f x ==================== in unix/linux proper error msg comes out and back to interpreter. ERROR - Control stack overflow =========== but in windows 2000 Then suddnly interpreter fails and the red (X) popup window pops up. hugs.exe - application programm error unknown software exception (0xc000fd) ... blabla From petersen@redhat.com Fri Mar 22 05:37:00 2002 From: petersen@redhat.com (Jens Petersen) Date: 22 Mar 2002 14:37:00 +0900 Subject: popen lazy args and input pipe In-Reply-To: References: Message-ID: Volker Wysk writes: > On 21 Mar 2002, Jens Petersen wrote: > > Volker Wysk writes: > > > POpen-1.0.0 contains the same bug which I made. It doesn't ensure that > > > the values which are needed after the call of forkProcess, before that > > > of executeFile, are fully evaluated. So, if they are read lazily from a > > > stream, the newly spawned child process reads data from a stream which > > > it shares with its parent, making it disappear from the parent's input. > > > In this situation, this sure isn't intended. Ok, I agree this is a potential if unlikely problem. I can't really think of any useful examples though. I guess using "$!"s in the call to popen would solve this part. > > Perhaps you could give an explicit example? > > I haven't tried it, but it's exactly the same thing. Well, an explicit example using your "pipeto" or popen would be helpful. > > > Inserting the following lines just before the line "pid <- forkProcess", > > > in POpen.hs, would force the corresponding values to be evaluated, so no > > > data will be lost. > > > > > > seq (length path) $ seq (sum (map length args)) $ return () > > > when (isJust env) $ seq (sum (map (\(a,b) -> length a + length b) > > > (fromJust env))) $ return () > > > when (isJust dir) $ seq (length (fromJust dir)) $ return () I would prefer not to add strict evaluation to POpen unless it's absolutely necessary. I guess I really need a testcase for this problem. If you have one please send it to me. I should really add some unit tests to popenhs. > > Hmmm, I don't really see why this is necessary. Don't the > > lazy values of "path", "env" and "dir" just get evaluated > > when they're needed here as normal? (If what you say is > > true though it would be simpler just to use "$!" or "!"s for > > strict evaluation I guess.) > > Yes, and that's *after* forkProcess. So when they are computed from > the lazily read contents of a stream, the newly spawned child will read > data from a stream which it shares with its parent. Btw I guess one can say that popen inherits this problem from "Posix.runProcess". But usually "path", "env" and "dir" are not streams, just strings, right? Even for args I feel pushed to think of a real example where it could be a problem. Something like "xargs" taking a long stream of arguments from stdin, but arguments instead?? (Most shells have restrictions on the size of argv I think though.) Are you're referring to these comments from Posix.lhs, or you've rediscovered them? -- ***NOTE***: make sure you completely force the evaluation of the path -- and arguments to the child before calling runProcess. If you don't do -- this *and* the arguments from runProcess are read in from a file lazily, -- be prepared for some rather weird parent-child file I/O behaviour. -- -- [If you don't force the args, consider the case where the -- arguments emanate from a file that is read lazily, using -- hGetContents or some such. Since a child of a fork() -- inherits the opened files of the parent, the child can -- force the evaluation of the arguments and read them off the -- file without any problems. The problem is that while the -- child share a file table with the parent, it has separate -- buffers, so a child may fill up its (copy of) the buffer, -- but only read it partially. When the *parent* tries to read -- from the shared file again, the (shared) file offset will -- have been stepped on by whatever number of chars that was -- copied into the file buffer of the child. i.e., the unused -- parts of the buffer will *not* be seen, resulting in -- random/unpredicatable results. -- -- Based on a true (, debugged :-) story. -- ] Reading this again I start to understand the problem you're describing a little better. Perhaps something does need to be done about it, as you say. ;-) > But hPutStr, followed by hClose, won't complete until all > the input string has been written, while no process is > listening. Oops, you're right! Indeed popen hangs on input greater than 4kB on my system. Thank you very much for reporting this. Jens From rjchaaft@cs.uu.nl Fri Mar 22 09:26:52 2002 From: rjchaaft@cs.uu.nl (Rijk J. C. van Haaften) Date: Fri, 22 Mar 2002 10:26:52 +0100 Subject: Typo: Hugs Bug ! >> it was + In-Reply-To: <3C9AB203.C6916529@bawi.org> References: <3C999F3F.97BF994D@bawi.org> Message-ID: <4.3.0.20020322102518.00b380b8@pop.students.cs.uu.nl> Ahn Ki-yung wrote: >Prelude> f 1 where f x = x : f x >[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, >,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, >,1,1,{Interrupted!} > >Prelude> f 1 where f x = x + f x --> Immediate (!) crash Indeed, I could reproduce this on my computer (Win2000; Hugs Dec 2001 of last week). Rijk-Jan van Haaften From Keith.Wansbrough@cl.cam.ac.uk Fri Mar 22 09:34:08 2002 From: Keith.Wansbrough@cl.cam.ac.uk (Keith Wansbrough) Date: Fri, 22 Mar 2002 09:34:08 +0000 Subject: Lambda over types. In-Reply-To: Your message of "Thu, 21 Mar 2002 08:35:27 PST." <20020321163527.92822.qmail@web14201.mail.yahoo.com> Message-ID: anatoli writes: > ghc -fglasgow-exts -fallow-undecidable-instances allows = > constructs which amount to lambda abstraction over types. = > I've written a small untyped lambda calculus interpreter = > in the Haskell class/instance sublanguage, just to prove > this point. (The terms are Haskell *types*.) Cool! Some time ago I wrote a Turing machine evaluator in Haskell types with un= decidable instances. It's described at http://www.chttp://www.cl.cam.ac.uk/~kw217/research/misc/undec.html Enjoy! --KW 8-) -- = Keith Wansbrough http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory. From simonpj@microsoft.com Fri Mar 22 10:29:22 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Fri, 22 Mar 2002 02:29:22 -0800 Subject: catch (fail "...") Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041BD4@RED-MSG-10.redmond.corp.microsoft.com> This is an inconsistency that was fixed in the revised Haskell98=20 report (Apr 2001). See http://research.microsoft.com/~simonpj/haskell98-revised In the bug list look for Page 90. It looks as though Hugs hasn't quite caught up with this change. Simon | -----Original Message----- | From: Brian Huffman [mailto:bhuffman@galois.com]=20 | Sent: 22 March 2002 00:22 | To: haskell@haskell.org | Subject: catch (fail "...") |=20 |=20 | Hi, |=20 | Here is a problem I came across recently, revealing a=20 | difference between ghci=20 | and Hugs: |=20 | hugs> catch (error "not ok") (\e -> putStrLn "ok") | Program error: not ok | ghci> catch (error "not ok") (\e -> putStrLn "ok") | *** Exception: not ok |=20 | hugs> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") | ok | ghci> catch (ioError (userError "not ok")) (\e -> putStrLn "ok") | ok |=20 | hugs> catch (fail "not ok") (\e -> putStrLn "ok") | Program error: not ok | ghci> catch (fail "not ok") (\e -> putStrLn "ok") | ok |=20 | As I expected, neither of them can catch "error", and both of=20 | them can catch=20 | "ioError". But only ghci can catch the "fail". It seems to me=20 | that ghc has=20 | made a convenient choice here, because if I need to raise an=20 | IO exception, it=20 | is easier to type "fail s" than "ioError (userError s)". |=20 | However, the online Haskell report says that for IO, fail=A0s=A0=3D=A0 | error=A0s, which=20 | is what Hugs does.=20 | (http://www.haskell.org/onlinereport/standard-prelude.html#$iM onad$$IO) Does anyone know the reasoning behind the design choice made in the = report,=20 or why the ghc implementation is different? I am mainly concerned about=20 portability issues: particularly, is it a good idea to use fail for = raising=20 IO exceptions? Thanks - Brian Huffman _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell From reid@cs.utah.edu Fri Mar 22 16:48:56 2002 From: reid@cs.utah.edu (Alastair Reid) Date: 22 Mar 2002 16:48:56 +0000 Subject: Hugs Bug ! In-Reply-To: <3C999F3F.97BF994D@bawi.org> References: <3C999F3F.97BF994D@bawi.org> Message-ID: Ahn Ki-yung reports: > {Apparently inessential details of program supressed] > > in unix/linux proper error msg comes out and back to interpreter. > > ERROR - Control stack overflow > > =========== > but in windows 2000 > > Then suddnly interpreter fails and > the red (X) popup window pops up. > > hugs.exe - application programm error > > unknown software exception (0xc000fd) ... blabla This is a known problem in Hugs to do with overflows of the C stack. The problem is: - Hugs evaluation is done on the C stack and so some kinds of evaluation can cause stack overflows. - OSs and C are pretty poor at detecting or avoiding stack overflows. The reason you didn't see this in Unix is: - Unix apparently assigns a different stack-size limit to Hugs. (I think you can tune stack size in Windows but forget how.) - Hugs uses a 2nd stack 'the control stack' during evaluation. This is a normal C array which Hugs knows the size of so it can detect overflow in that stack. Often, when you run out of C stack space, you were about to run out of control stack space anyway and when you run out of control stack space you were about to run out of C stack space. (In other words, running out of either usually indicates a problem in your program which will not be solved by tweaking stack sizes.) Hope this helps. -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/ From mark.wogahn@yale.edu Fri Mar 22 19:43:19 2002 From: mark.wogahn@yale.edu (Mark Wogahn) Date: Fri, 22 Mar 2002 14:43:19 -0500 Subject: Haskell server switchover Message-ID: <3C9B8957.5070901@yale.edu> Hi All, I will be bringing the haskell server down tomorrow morning (Sat Mar 23 ) between 08:00 and 8:30 to do some needed service. It should be back online no later than 9:00. Sorry for any inconvenience. -Mark -- Mark Wogahn / mark.wogahn@yale.edu Workstation Support Services (WSS) Department of Computer Science 51 Prospect Street, New Haven, CT 06520 Phone: (203) 432-1264 Fax: (203) 432-0593 -------------------------------------------------------- "Nothing is static, everything is falling apart" Chuck Palahniuk - "Fight Club" From tom-list-haskell@moertel.com Fri Mar 22 23:38:00 2002 From: tom-list-haskell@moertel.com (Tom Moertel) Date: Fri, 22 Mar 2002 18:38:00 -0500 Subject: ANNOUNCE: Red Hat RPMs of Haskell Mode for Emacs Message-ID: <3C9BC058.F19E08DB@moertel.com> I have packaged the Haskell Mode for Emacs at http://www.haskell.org/haskell-mode/ into RPMs for Red Hat Linux 7.2 (and similar platforms). Once the packages are installed, Haskell Mode is automatically enabled when you start up Emacs. Integration with Hugs is the default, but a quick change to your .emacs file will cause Haskell Mode to use GHCi instead. You can find the RPMs here: http://www.moertel.com/~thor/emacs-haskell-mode/ Cheers, Tom P.S. I have also made the RPM .spec file available. If somebody can add it to the official haskell-mode tarball on haskell.org, people can build RPMs directly from the tarball using "rpm -ta haskell-mode-(VERS).tar.gz". From gkamsteeg@freeler.nl Sat Mar 23 16:01:21 2002 From: gkamsteeg@freeler.nl (Gertjan Kamsteeg) Date: Sat, 23 Mar 2002 17:01:21 +0100 Subject: using less stack References: <3C98D8BB.5060001@aber.ac.uk> Message-ID: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> You don't have to define cpsfold explicitly recursively since it can be expressed in terms of foldr: cpsfold f a xs = foldr (\x k y -> f x y k) id xs a The following definition would even be better (but not equivalent): cpsfold' f a xs = foldr (\x k y -> f y x k) id xs a The list members are now 'consumed' left-to-right by f, with initial value a. So, answer4 = foldr (\x k a -> if x > a then k x else k a) id [1..500000] 0 also works without a crash or insufficient stack space. Gertjan ----- Original Message ----- From: "Amanda Clare" To: "C.Reinke" Cc: Sent: Wednesday, March 20, 2002 7:45 PM Subject: Re: using less stack > [cpsfold omitted] > > > Actually, and quite apart from it being cumbersome to use, I've got > > my doubts about whether this cpsfold really does the job (is that > > just me missing some point?-). > > It does the job for me! In practical terms I can see it works. I'm not > an expert - I may have this all wrong, but perhaps the point you're > looking for is that the arguments to f are brought to the very outside > of the expression, and hence available for evaluation. Imagine for > [x1,x2,x3,x4] > from foldr: f x1 (f x2 (f x3 (f x4 a))) > from foldl: f (f (f (f a x1) x2) x3) x4 > > Neither are available for immediate evaluation. In the case of foldr the > end of the list (x4) has to be reached before anything can be evaluated. > In the case of foldl the first function to be pulled upon is the > outermost f, which then can't do anything useful (in my case) without > evaluating its second argument, and so on. > > with the cpsfold I get > > f x1 a (\y1 -> f x2 y1 (\y2 -> f x3 y3 (\y3 -> f x4 y4 (\y4 -> y4) > > so x1 and a are available immediately for f to use, and f x1 a is the > outermost expression so will be evaluated first. > > See for yourself with the following (difference can be seen in ghc with > standard 1M stack): > > > answer1 = foldr larger 0 [1..500000] > > answer2 = foldl larger 0 [1..500000] > > answer3 = cpsfold cpslarger 0 [1..500000] > > > larger x y = if x > y then x else y > > cpslarger x y k = if x > y then k x else k y > > > > > Also, I'm curious to know why the usual strict variant of foldl > > doesn't help in this case? > > > > foldl' f a [] = a > > foldl' f a (x:xs) = (foldl' f $! f a x) xs > > Because $! and seq only evaluates enough to make sure the answer is not > bottom, and if my f is complex then it doesn't do enough. > > Amanda > > _______________________________________________ > Haskell mailing list > Haskell@haskell.org > http://www.haskell.org/mailman/listinfo/haskell > From hdaume@ISI.EDU Sun Mar 24 00:35:18 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Sat, 23 Mar 2002 16:35:18 -0800 (PST) Subject: using less stack In-Reply-To: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> Message-ID: Hi, > You don't have to define cpsfold explicitly recursively since it can be > expressed in terms of foldr: Is this generally considered good design? That is, is it generally preferred to express functions in a nonrecursive style if that can be done using standard library functions like foldr and map and filter, etc? Okay, obviousloy everything *can* be done in that manner, so I guess my question is why should we write something using foldr when, imo, the explicitely recursive version is easier to parse (as a human). - Hal From reid@cs.utah.edu Sun Mar 24 02:58:49 2002 From: reid@cs.utah.edu (Alastair Reid) Date: 24 Mar 2002 02:58:49 +0000 Subject: using less stack In-Reply-To: References: Message-ID: Gertjan Kamsteeg writes: >> You don't have to define cpsfold explicitly recursively since it >> can be expressed in terms of foldr: Hal Daume III writes: > Is this generally considered good design? [...] Three different attempts at an answer: As with all code-factoring it's in the eye of the beholder. If what you want to do is trace execution in detail, the less factored code is easier to understand. If what you want to do is understand the difference between 5 different recursive traversals of a list, then isolating those differences (by suppressing the invariant fact of recursion) is better. More concretely, some prefer to avoid the recursive formulations because: 1) It is trickier to reason about. Functional programmers (especially Squiggol afficianados) have all kinds of cunning ways to reason about programs written using standard library functions such as foldr. The techniques for reasoning directly about recursive functions are somewhat cruder and harder. 2) The ability to recursivly invoke the function from _anywhere_ in the function body has been compared (with some justification) to the use of goto in unstructured programming. If you buy into this line of reasoning then foldr, scanr, map, etc. are to functional programming as while, repeat and for are to structured programming. [These two points are connected!] And, finally, my personal preference is: - use explicit recursion when I don't understand what I'm doing well enough to know which standard recursive pattern it fits into (because it normally always fits a standard pattern). - use higher-order functions when I know what I'm doing or where setting up the infrastructure for the recursion costs more than coding it directly. -- Alastair Reid Reid Consulting (UK) Ltd From Christine Hall Sun Mar 24 13:37:49 2002 From: Christine Hall (Christine Hall) Date: Sun, 24 Mar 2002 21:37:49 +0800 (CST) Subject: http://haskell.org Message-ID: <37CR1000016979@emaserver.trafficmagnet.net> --16881215.1016977069281.JavaMail.SYSTEM.emaserver Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi I visited http://haskell.org, and noticed that you're not listed on some search engines! I think we can offer you a service which can help you increase traffic and the number of visitors to your website. I would like to introduce you to TrafficMagnet.net. We offer a unique technology that will submit your website to over 300,000 search engines and directories every month. You'll be surprised by the low cost, and by how effective this website promotion method can be. To find out more about TrafficMagnet and the cost for submitting your website to over 300,000 search engines and directories, visit www.TrafficMagnet.net. I would love to hear from you. Best Regards, Christine Hall Sales and Marketing E-mail: christine@trafficmagnet.net http://www.TrafficMagnet.net This email was sent to haskell@haskell.org. I understand that you may NOT wish to receive information from me by email. To be removed from this and other offers, simply go to the link below: http://emaserver.trafficmagnet.net/trafficmagnet/www/optoutredirect?UC=Lead&UI=199707 --16881215.1016977069281.JavaMail.SYSTEM.emaserver Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
    Hi

    I visited http://haskell.org, and noticed that you're not listed on some search engines! I think we can offer you a service which can help you increase traffic and the number of visitors to your website.

    I would like to introduce you to TrafficMagnet.net. We offer a unique technology that will submit your website to over 300,000 search engines and directories every month.


    You'll be surprised by the low cost, and by how effective this website promotion method can be.

    To find out more about TrafficMagnet and the cost for submitting your website to over 300,000 search engines and directories, visit www.TrafficMagnet.net.

    I would love to hear from you.


    Best Regards,

    Christine Hall
    Sales and Marketing
    E-mail: christine@trafficmagnet.net
    http://www.TrafficMagnet.net

     

    This email was sent to haskell@haskell.org.
    I understand that you may NOT wish to receive information from me by email.
    To be removed from this and other offers, simply click here.
    . --16881215.1016977069281.JavaMail.SYSTEM.emaserver-- From gkamsteeg@freeler.nl Sun Mar 24 13:38:44 2002 From: gkamsteeg@freeler.nl (Gertjan Kamsteeg) Date: Sun, 24 Mar 2002 14:38:44 +0100 Subject: using less stack References: Message-ID: <002e01c1d339$582cc450$2797153e@gertjan1> From: "Alastair Reid" > > Gertjan Kamsteeg writes: > >> You don't have to define cpsfold explicitly recursively since it > >> can be expressed in terms of foldr: > > Hal Daume III writes: > > Is this generally considered good design? [...] > > Three different attempts at an answer: > > As with all code-factoring it's in the eye of the beholder. > > If what you want to do is trace execution in detail, the less factored > code is easier to understand. > > If what you want to do is understand the difference between 5 > different recursive traversals of a list, then isolating those > differences (by suppressing the invariant fact of recursion) is > better. > I agree. However, although *functionally* every list traversing function should be expressible in terms of foldr (because foldr represents the type theoretical elimination rule for lists in most type systems with inductive types (and without element depending types)), it's not just a matter of taste. Execution clearly *does* depend on how things are defined. When I said 'can be expressed', I meant extensionally equivalent, including behavior w.r.t. reductions. For example, if, in the Prelude, foldr had been defined in terms of foldl: foldr f a xs = foldl (\h x y -> h (f x y)) id xs a my definition of cpsfold in terms of foldr wouldn't go through. That is, some stack would again overflow. What I wanted to say is that the fact that Amanda's answer1 (maximum in terms of foldr) didn't work wasn't caused by the definition of foldr in the Prelude. Besides, (re)factoring is fun. So, here's another one (foldl in terms of foldr): foldl f a xs = foldr (\x h y -> h (f y x)) id xs a BTW, there may be another reason for expressing list traversing functions in terms of foldr: if one uses only functions representing 'standard' elimination rules, it is guaranteed that all reduction sequences eventually terminate. Gertjan From ru@river.org Sun Mar 24 20:23:23 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sun, 24 Mar 2002 12:23:23 -0800 Subject: using less stack In-Reply-To: References: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> Message-ID: Hal Daume III writes: >> You don't have to define cpsfold explicitly recursively since it can be >> expressed in terms of foldr: > >Is this generally considered good design? That is, is it generally >preferred to express functions in a nonrecursive style if that can be done >using standard library functions like foldr and map and filter, >etc? One answer that Alastair Reid did not mention is that the nonrecursive style usually benefits from the deforestation optimization whereas IIUC the explicitly recursive style never does in contemporary compilers. Another answer, which I give because the factor does not enter enough into the thinking of academic language designers, is that the nonrecursive style inhibits adoption of Haskell by making it slightly more difficult for the average programmer or programmer-wannabe to learn --"slightly" because with recursion, lists and monadic interfaces Haskell already has a lot of significant learning barriers to adoption, and the nonrecursive style of definition is easier to learn (get used to) than any one of those last 3. -- Richard Uhtenwoldt From ru@river.org Sun Mar 24 20:59:50 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sun, 24 Mar 2002 12:59:50 -0800 Subject: a survey of language popularity In-Reply-To: References: <003c01c1d284$1a08e0b0$6e92153e@gertjan1> Message-ID: So, how popular is Haskell compared to other languages? Here are some Google search results that suggest how many web pages are devoted to particular langauges. (Google tells you how many pages match your query.) A better survey of language popularity would include newsgroup and mailing list traffic, but no time, no time. In this modest survey, Haskell is a little more popular than O'Caml, a little less popular than Eiffel (an OOPL) 5 to 6 times less popular than Smalltalk; 8 to 10 times less popular than Python, which is itself at least 2 and a half or 3 times less popular than Perl. On second thought, Eiffel and Smalltalk might be considerably more popular than suggested by page counts because the other languages surveyed have 100% open-source documentation. eg, in the GHC results I saw lots of duplicates of essentially the same document. This is characteristic of open-source-code-licensed content. In contrast, Eiffel and Smalltalk have commercial vendors, whose documentation is (I would think) underrepresented in this modest survey because of having licenses that restrict copying. perl 9,600,000 perl language OR program OR variable OR object 1,490,000. python -monty -snake -venom 809,000 python program OR language OR variable OR object 630,000 smalltalk 361,000 (say 10% false hits. 325,000 real.) lisp cmucl OR "common lisp" OR heap OR cdr OR cons OR lambda OR closure OR scheme 188,000 eiffel object OR program OR variable OR string -tower 74,700 (I say there's a few false hits there. 71,000 real hits.) ghc haskell OR compiler 63,100 ghc haskell OR compiler OR functional OR fp 66,800 haskell fp OR "programming" OR monad OR monadic OR functional OR lambda 63,600 haskell "programming" OR monad OR monadic OR functional OR lambda 55,500 (I say 63,000 is the most accurate) caml 88,700 (I can see some false hits) "objective caml" OR ocaml OR o'caml 41,700. (42,000) note that there is at least one open-source Linux package, unison, a file sync utility, written in O'Caml. no Linux packages written in Haskell except for Haskell compilers. other info useful for measuring language popularity.
  • sloc in various RedHat 7.2 packages
  • lines of code in Debian
  • Counting Debian //
  • [E-Lang] popularity of programming languages among open source hackers // weak survey, of Sourceforge projects. see also Oct 2001 e-lang. -- Richard Uhtenwoldt From A.Simon@ukc.ac.uk Mon Mar 25 00:04:11 2002 From: A.Simon@ukc.ac.uk (Axel Simon) Date: Mon, 25 Mar 2002 00:04:11 +0000 (GMT) Subject: Announce: Gtk2Hs - A Haskell binding for Gtk2 Message-ID: Note: This is not gtk+hs. Gtk2Hs is a rewrite of gtk+hs. It is a binding to the recently released version of Gtk2 with a couple of improvements over gtk+hs: - Automatic memory management. - Nearly complete coverage of widget functions and their signals, including the new text and list widgets. - The convenience wrapper MoGuL (Monad Gui Library) makes it possible to create and lookup named widgets in a type safe way. - Unicode support. - Object-oriented calling convention for widget functions. - Pragmatically uses both c2hs and hsc acquire information about the C files. Automatically generates callback handlers and the widget type hierarchy. - Needs ghc version 5.00 or later, makes use of the --make flag and complies quite quickly (12 mins). I am currently only providing CVS access to the sources. Find them at: https://sourceforge.net/cvs/?group_id=49207 At the moment it does not compile on Solaris due to the 4 parameter restriction of GHC for dynamic callbacks. Feedback is very welcome, a good place to send it to is: gtk2hs-users@lists.sourceforge.net Share and enjoy, Axel. From svb@doc.ic.ac.uk Mon Mar 25 13:28:15 2002 From: svb@doc.ic.ac.uk (Steffen van Bakel) Date: Mon, 25 Mar 2002 13:28:15 +0000 Subject: ITRS'02 call for papers Message-ID: <0203251328.AA157444@Schiele> --PopOver-2.0.150-1017062895-3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline (Apologies for multiple copies) (Second) Call for Papers Workshop on Intersection Types and Related Systems (ITRS '02) Copenhagen, Denmark Friday, July 26 2002 http://www.doc.ic.ac.uk/~itrs02/ Co-located with FLoC '02, the third Federated Logic Conference to be held in Copenhagen, Denmark (July 22 to August 1 2002) http://floc02.diku.dk/ IMPORTANT DATES/DEADLINES: Submission of papers: Sunday, April 7 2002 Notification of acceptance: Thursday, April 25 2002 Workshop: Friday, July 26 2002 OVERALL TOPIC AND FORMAT OF WORKSHOP: Intersection type disciplines originated in 1980 to overcome the limitations of Curry's type assignment system and to provide a characterisation of the strongly normalising terms of the Lambda Calculus. Since then, intersection types disciplines were used in a series of papers for characterising evaluation properties and semantics. Types also support reliable reasoning in many areas such as logic, programming languages, linguistics, etc. A _polymorphic_ type stands for some number of instance types, and the use of type systems for non-trivial purposes generally requires polymorphic types. In this context, roughly speaking, intersection types could be seen as to provide type polymorphism by listing type instances. This differs from the more widely used ("forall") quantified types, which provide type polymorphism by giving a type scheme that can be instantiated into various type instances. (A similar relationship holds between union types and existential types, the duals of intersection types and universal types.) Although intersection types were initially intended for use in analyzing and/or synthesizing lambda models as well as in analyzing normalization properties, over the last twenty years the scope of theoretical research on intersection types has broadened. Recently, there have been a number of breakthroughs in the use of intersection types (and similar technology) for practical purposes such as program analysis. The ITRS '02 workshop will be held to bring together researchers working on both the theory and practice of systems with intersection types and related systems (e.g., union types, refinement types, etc.). The workshop will last one full day and will contain a long talk by each invited speaker, a panel discussion, and a short (approx. 25 minutes) talk for each accepted paper. POSSIBLE TOPICS FOR SUBMITTED PAPERS: Researchers are invited to submit original papers on topics in the spirit of the workshop. Possible topics for submitted papers include, but are not limited to: * Formal properties of systems with intersection types: principal typings, normalization properties (for normal forms, head-normal forms, weak head-normal forms, etc.), type inference algorithms. * Results for clearly related systems, e.g., systems with union types, refinement types, or singleton types. * Connections with not-so-clearly related approaches such as abstract interpretation and constraints. * Applications to lambda calculus and similar systems, e.g., denotational semantics, analysis/synthesis of lambda models (domains), characterization of operational properties, etc. * Applications for programming languages, e.g., program analysis (flow, strictness, totality, etc.), accurate type error messages, increased flexibility with static typing, separate compilation and modularity, optimizing transformations, types for objects, etc. * Applications for other areas, e.g., database query languages, program extraction from proofs, type systems for natural languages. INVITED SPEAKER (confirmed) Frank Pfenning (Carnegie Mellon University, USA) REGISTRATION FEE 50 Euro for the workshop; an additional 80 Euro will be charged to participants who haven't registered for one of the main FLoC conferences (but only once, not per workshop) PROGRAM COMMITTEE: Steffen van Bakel (Chair) (Imperial College, London, UK) Franco Barbanera (Universita` di Catania, Italia) Mario Coppo (Universita` di Torino, Italia) Luca Roversi (Universita` di Torino, Italia) Lyn Turbak (Wellesley College (MA) USA) Pawel Urzyczyn (Uniwersytet Warszawski, Polska) Joe Wells (Heriot-Watt University, Edinburgh, Scotland) SUBMISSION INSTRUCTIONS: TOPIC: A submitted paper must describe work that does not substantially overlap with work that has been previously published or is currently being considered elsewhere (e.g., another workshop, conference, or journal). Feel free to consult the program chair on the appropriateness of a topic or the possibility of conflict with another publication. PRINTED APPEARANCE: The paper must be written in English. The paper (including bibliography) should not exceed 15 pages. The paper should a font size no smaller than 11pt and standard TeX spacing. It is recommended to include full proofs of any theorems in appendices if they will not fit in 15 pages. However, any appendices beyond the 15-page limit should not be needed for judging the paper and will not be included in the proceedings. PAPER ELECTRONIC FORMAT: The paper should be in PostScript or PDF. Every effort should be made to ensure that only portable PostScript features are used (e.g., avoid using non-standard built-in fonts). For other formats, ask the program chair well in advance of the deadline. For TeX, the class file itrspaper.cls is recommended for use (available at http://www.doc.ic.ac.uk/~itrs02/itrspaper.cls). ADMINISTRATIVE INFORMATION: The first page of the paper should include (1) the title, (2) the list of authors, (3) a brief abstract (fewer than 200 words), (4) a short list of key words/topics, and (5) the name, e-mail address, and postal address of the corresponding author. This information should be repeated at the Paper Submission Page available at the workshop's website =3D = (http://www.doc.ic.ac.uk/~itrs02/). SUBMISSION: Papers can be submitted electronically via the Paper Submission Page available at the workshop's website =3D = (http://www.doc.ic.ac.uk/~itrs02/). VENUE: The workshop is colocated with the FLoC '02 conference, which will be held in Copenhagen, Denmark. CONTACT INFORMATION: Web: http://www.doc.ic.ac.uk/~itrs02/ Program chair: Steffen van Bakel e-mail: itrs02@doc.ic.ac..uk telephone: +44 20 7495 8263 fax: +44 20 7581 8024 postal: Department of Computing Imperial College 180 Queens's Gate London SW7 2BZ, UK --PopOver-2.0.150-1017062895-3 Content-Type: text/enriched; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Courier(Apologies for multiple copies) (Second) Call for Papers Workshop on Intersection Types and Related Systems (ITRS '02) Copenhagen, Denmark Friday, July 26 2002 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/ Co-located with FLoC '02, the third Federated Logic Conference to be held in Copenhagen, Denmark (July 22 to August 1 2002) 0000,0000,ffff= http://floc02.diku.dk/ IMPORTANT DATES/DEADLINES: Submission of papers: Sunday, April 7 2002 Notification of acceptance: Thursday, April 25 2002 Workshop: Friday, July 26 2002 OVERALL TOPIC AND FORMAT OF WORKSHOP: Intersection type disciplines originated in 1980 to overcome the limitations of Curry's type assignment system and to provide a characterisation of the strongly normalising terms of the Lambda Calculus. Since then, intersection types disciplines were used in a series of papers for characterising evaluation properties and semantics. Types also support reliable reasoning in many areas such as logic, programming languages, linguistics, etc. A _polymorphic_ type stands for some number of instance types, and the use of type systems for non-trivial purposes generally requires polymorphic types. In this context, roughly speaking, intersection types could be seen as to provide type polymorphism by listing type instances. This differs from the more widely used ("forall") quantified types, which provide type polymorphism by giving a type scheme that can be instantiated into various type instances. (A similar relationship holds between union types and existential types, the duals of intersection types and universal types.) Although intersection types were initially intended for use in analyzing and/or synthesizing lambda models as well as in analyzing normalization properties, over the last twenty years the scope of theoretical research on intersection types has broadened. Recently, there have been a number of breakthroughs in the use of intersection types (and similar technology) for practical purposes such as program analysis. The ITRS '02 workshop will be held to bring together researchers working on both the theory and practice of systems with intersection types and related systems (e.g., union types, refinement types, etc.). The workshop will last one full day and will contain a long talk by each invited speaker, a panel discussion, and a short (approx. 25 minutes) talk for each accepted paper. POSSIBLE TOPICS FOR SUBMITTED PAPERS: Researchers are invited to submit original papers on topics in the spirit of the workshop. Possible topics for submitted papers include, but are not limited to: * Formal properties of systems with intersection types: principal typings, normalization properties (for normal forms, head-normal forms, weak head-normal forms, etc.), type inference algorithms. * Results for clearly related systems, e.g., systems with union types, refinement types, or singleton types. * Connections with not-so-clearly related approaches such as abstract interpretation and constraints. * Applications to lambda calculus and similar systems, e.g., denotational semantics, analysis/synthesis of lambda models (domains), characterization of operational properties, etc. * Applications for programming languages, e.g., program analysis (flow, strictness, totality, etc.), accurate type error messages, increased flexibility with static typing, separate compilation and modularity, optimizing transformations, types for objects, etc. * Applications for other areas, e.g., database query languages, program extraction from proofs, type systems for natural languages. INVITED SPEAKER (confirmed) Frank Pfenning (Carnegie Mellon University, USA) REGISTRATION FEE 50 Euro for the workshop; an additional 80 Euro will be charged to participants who haven't registered for one of the main FLoC conferences (but only once, not per workshop) PROGRAM COMMITTEE: Steffen van Bakel (Chair) (Imperial College, London, UK) Franco Barbanera (Universita` di Catania, Italia) Mario Coppo (Universita` di Torino, Italia) Luca Roversi (Universita` di Torino, Italia) Lyn Turbak (Wellesley College (MA) USA) Pawel Urzyczyn (Uniwersytet Warszawski, Polska) Joe Wells (Heriot-Watt University, Edinburgh, Scotland) SUBMISSION INSTRUCTIONS: TOPIC: A submitted paper must describe work that does not substantially overlap with work that has been previously published or is currently being considered elsewhere (e.g., another workshop, conference, or journal). Feel free to consult the program chair on the appropriateness of a topic or the possibility of conflict with another publication. PRINTED APPEARANCE: The paper must be written in English. The paper (including bibliography) should not exceed 15 pages. The paper should a font size no smaller than 11pt and standard TeX spacing. It is recommended to include full proofs of any theorems in appendices if they will not fit in 15 pages. However, any appendices beyond the 15-page limit should not be needed for judging the paper and will not be included in the proceedings. PAPER ELECTRONIC FORMAT: The paper should be in PostScript or PDF. Every effort should be made to ensure that only portable PostScript features are used (e.g., avoid using non-standard built-in fonts). For other formats, ask the program chair well in advance of the deadline. For TeX, the class file itrspaper.cls is recommended for use (available at 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/itrspaper.cls). ADMINISTRATIVE INFORMATION: The first page of the paper should include (1) the title, (2) the list of authors, (3) a brief abstract (fewer than 200 words), (4) a short list of key words/topics, and (5) the name, e-mail address, and postal address of the corresponding author. This information should be repeated at the Paper Submission Page available at the workshop's website =3D (= 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/). SUBMISSION: Papers can be submitted electronically via the Paper Submission Page available at the workshop's website =3D (= 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/). VENUE: The workshop is colocated with the FLoC '02 conference, which will be held in Copenhagen, Denmark. CONTACT INFORMATION: Web: 0000,0000,ffff= http://www.doc.ic.ac.uk/~itrs02/ Program chair: Steffen van Bakel e-mail: 0000,0000,ffff= itrs02@doc.ic.ac..uk telephone: +44 20 7495 8263 fax: +44 20 7581 8024 postal: Department of Computing Imperial College 180 Queens's Gate London SW7 2BZ, UK --PopOver-2.0.150-1017062895-3-- From heringto@cs.unc.edu Mon Mar 25 20:00:58 2002 From: heringto@cs.unc.edu (Dean Herington) Date: Mon, 25 Mar 2002 15:00:58 -0500 Subject: instance Read Dynamic ? Message-ID: <3C9F81FA.833184A6@cs.unc.edu> The type `Dynamic` is an instance of `Show` but not of `Read`. Is there some reason `Dynamic` could not be made an instance of `Read`? Has anyone extended `Dynamic` in that way? Dean Herington From bhuffman@galois.com Mon Mar 25 20:55:48 2002 From: bhuffman@galois.com (Brian Huffman) Date: Mon, 25 Mar 2002 12:55:48 -0800 Subject: instance Read Dynamic ? In-Reply-To: <3C9F81FA.833184A6@cs.unc.edu> References: <3C9F81FA.833184A6@cs.unc.edu> Message-ID: <200203252055.g2PKtmF02271@localhost.localdomain> On Monday 25 March 2002 12:00 pm, Dean Herington wrote: > The type `Dynamic` is an instance of `Show` but not of `Read`. Is there > some reason `Dynamic` could not be made an instance of `Read`? Has > anyone extended `Dynamic` in that way? Here is a snippet of code from the GHC Dynamic library; you will notice that Dynamic objects contain a TypeRep and a data object, but the data object is ignored by show (as it must be, since the Obj could be anything, showable or not): data Dynamic = Dynamic TypeRep Obj instance Show Dynamic where -- the instance just prints the type representation. showsPrec _ (Dynamic t _) = showString "<<" . showsPrec 0 t . showString ">>" It is impossible to make a matching Read instance, because you lose information when you show a Dynamic object; there is no way a read function can reconstruct the data object's value. It probably wouldn't be too difficult to make a readable version of Dynamic, but it would only be able to hold datatypes that were instances of Read and Show. I'd be interested to see if anyone else has implemented anything like this; it seems like it could be pretty useful. - Brian Huffman From bahadirsevinc@firat.edu.tr Tue Mar 26 10:44:35 2002 From: bahadirsevinc@firat.edu.tr (=?iso-8859-9?B?QmFoYWT9ciBTRVbdTsc=?=) Date: Tue, 26 Mar 2002 12:44:35 +0200 Subject: Little problem Message-ID: Hello I have little problem. I want to solve this equation f(n-1) = f(n)+n f(6)=6 => f(2)=? Can anybody help me please ? Best regards.. Bahadýr SEVÝNÇ From bahadirsevinc@firat.edu.tr Tue Mar 26 13:51:21 2002 From: bahadirsevinc@firat.edu.tr (=?iso-8859-9?B?QmFoYWT9ciBTRVbdTsc=?=) Date: Tue, 26 Mar 2002 15:51:21 +0200 Subject: I need some help Message-ID: Hello I am writing a whole program which is analyz a elegtromagnetic wave. This is ok but in the program I use a lot of constant for example pi,epsilon etc. I want to ask that how I use a constant in Haskell ? However the user of the program give some argument then program is starting. And I want to use this arguments for example at the end of the program. What will I do. Thanks Baha Electrical & Electronics Engineer Bahadýr SEVÝNÇ Fýrat University Informatics Department & Computer Center Elazýð / Türkiye 23169 Tlf: +90 424 2370000-5011 From jadrian@mat.uc.pt Tue Mar 26 15:46:13 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Tue, 26 Mar 2002 15:46:13 +0000 Subject: I need some help In-Reply-To: References: Message-ID: <20020326154911.A7B2A422221@www.haskell.org> [Obs: moving to haskell cafe] [beware, huge answer follows] > Hello > I am writing a whole program which is analyz a elegtromagnetic wave. This > is ok but in the program I use a lot of constant for example pi,epsilon > etc. I want to ask that > how I use a constant in Haskell ? Defining constants it's easy, examples. -- with no type signature epsilon = 3.1 -- with explicit type signature epsilon2 :: Double epsilon2 = 3.1 -- specifying the type but no type signature epsilon3 = 3.1 :: Double (by the way, wouldn't it make sense not to get a warning about missing type signature in this last case. I know there is no signature there but still...) > However the user of the program give some argument then program is > starting. And I want to use this arguments for example at the end of the > program. What will I do. Good question. I've had a bad time with this, some in this list proably got tired of me saying the same thing over and over again... those of you might want to skip the rest of my mail :-) If you want the user to be able to chose those values, then they are NOT constants, period. Yes their values won't chnage during the rest of the algorithm, but that doesn't makes it constants, so you can't declare them that way. What *can* you do. 1. One *awfull* option is to pass thos values as arguments to all your functions. Yes signatures will get monstruous, it will complicate the developing process etc, 2. Instead of passing all those variables, group them in a record - data type with named fields - and pass that record arround. (http://www.haskell.org/onlinereport/exps.html#sect3.15) Signatures will get better. It's kind of weird though, to always have to pass around that record. Things can get quite messy, IMO. -- foo f :: Double -> Double -> Double f x y = eta*x - epsilon^2*y -- foo2 f :: Options -> Double -> Double -> Double f opt x y = (eta opt)* (epsilon opt)^2*y And this is just a very simple example, it can get much worst. 3. Implicit parameters. (At least in Ghc, what about others?) Now this is the closest to an elegant solution. *Read both*: http://citeseer.nj.nec.com/246042.html http://www.cs.chalmers.se/~rjmh/Globals.ps f :: (?eta::Double, ?epsilon::Double)=> Double -> Double -> Double f x y = ?eta*x - ?epsilon^2*y Now you don't have to specify eta and epsilon in the type signature itself, but in the context - no passing around extra (not natural) parameters. It makes an huge diference IMO when developing your algorithms. Still signatures wil get even bigger than if you just passed them as parameters, you can't even type the context like: (?eta, ?epsilon::Double) So that is just awfull! Once again records will help. f :: (?opt::Options)=> Double -> Double -> Double f x y = (eta ?opt) *x - (epsilon ?opt)^2*y It still lokes quite bad. I *hate* the field projection functions, and I hate the '?'!! So you could simply rename you data opt fields and declare, eta :: (?opt:: Options) => Double eta = etaF ?opt epsilon :: (?opt:: Options) => Double epsilon = epsilonF ?opt Now f could be written like: f :: (?opt::Options)=> Double -> Double -> Double f x y = eta*x - epsilon^2*y Which differs from the first f function only in the context. It is *almost* good enough for me :-) "Why the almost?" you ask... Well, implicit parameters are not only non-standard features, but also experimental features (right?), so you they can change anytime. -------------------------------------------------------------------------------------- NOTE: some of you might wanna quit reading here, I keep complaining about this stuff, you are probably tired of it :-) -------------------------------------------------------------------------------------- In a couple of days you will also want to use more than one record, because grouping certain constants together doesn't feel right, and contexts will get bigger. Also, you will want to use global variables and instead of a record you will use an STRef to a record, and very small signatures will have in they're context something like: (?opt :: STRef s Opt). And then you will need to update some option fields, and you will want to use modifySTRef, and you will need to create an applyField function to every damn field of the record... So you will start asking 1. (when) will we have implicit contexts available? 2. wouldn't it be good to have, besides the data projection functions, some update and apply field functions, automaticly derived when declaring the data type? [yes am actually *asking* if *anyone agrees* with me? haven't had any feedback on this one, so I don't no wether it is a good or just plain dumb idea] IMVHO, it is of extreme importance and *urgent* to get implicit parameters right. This question about how to use this 'user difined constants' is a *simple* question and should have a *very simple* and standard answer. The same goes to global variables. We need them in certain situations and it is supposed to be, and it can be from my experience, *simple*. J.A. From feuer@his.com Tue Mar 26 17:31:44 2002 From: feuer@his.com (Feuer) Date: Tue, 26 Mar 2002 12:31:44 -0500 Subject: first-class modules Message-ID: <3CA0B080.F9E26CB9@his.com> A number of people have discussed the use of implicit parameters to mimic global variables in Haskell. I am wondering if any have done the same for a first-class module system such as that proposed by Shields and Jones. It seems to make a tremendous amount of sense to do it that way: 1. semi-constant values: Things that are calculated or input at the beginning of the program could be handled by Main.main, which would pass the results to the Second module, whose main function it could then call. This seems much more natural than the implicit parameter approach for this purpose. 2. others: whenever a group of functions are likely to share a particular argument, they can be grouped in a module for greater convenience. For example, a library of mathematical functions that should all share a certain precision indicator could be grouped in a module: the user of the module could instantiate it once with the right precision and then use all the functions at that precision. David Feuer (please reply to dfeuer@cs.brown.edu) From Jon.Fairbairn@cl.cam.ac.uk Tue Mar 26 18:07:36 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Tue, 26 Mar 2002 18:07:36 +0000 Subject: first-class modules In-Reply-To: Your message of "Tue, 26 Mar 2002 12:31:44 EST." <3CA0B080.F9E26CB9@his.com> Message-ID: <19893.1017166056@cl.cam.ac.uk> David Feuer wrote: > A number of people have discussed the use of implicit parameters to > mimic global variables in Haskell. I am wondering if any have done the= > same for a first-class module system such as that proposed by Shields > and Jones. It seems to make a tremendous amount of sense to do it that= > way: > = > 1. semi-constant values: Things that are calculated aren't a problem unless they depend on something that's input at run-time. > or input at the beginning of the program could be handled > by Main.main, which would pass the results to the Second > module, whose main function it could then call. This > seems much more natural than the implicit parameter > approach for this purpose. This approach could also solve the "here document" question. If we allow modules that define a value rather than names and are in a range of different syntaxes, we can import the value at the point of use. Having foreign values in files would allow things such as the import of a font metric file as a constant, which would be much nicer than reading it from a file and having to pass it around. J=F3n From lmp@di.fct.unl.pt Tue Mar 26 18:00:02 2002 From: lmp@di.fct.unl.pt (Luis Moniz Pereira) Date: Tue, 26 Mar 2002 18:00:02 +0000 Subject: Postdoc positions at CENTRIA Message-ID: <3CA0B722.3C22958B@di.fct.unl.pt> Please post The Research Center for Artificial Intelligence (CENTRIA) at the Universidade Nova de Lisboa (UNL) offers as of now several post-doctoral research positions, in the areas of: Machine Learning. Neural Networks. Data Mining. Text Mining. each for nine months to a year (yearly extensions possible), starting immediately or within the next few months. Candidates must hold a doctoral degree and may apply by sending us their CV and other relevant information, namely regarding availability date and duration of stay AS SOON AS POSSIBLE. Salaries are negotiable, starting at 1,500 Euros net per month, up to 2,000 Euros. Further information at: http://centria.di.fct.unl.pt/~nmm/PostDoc/ -- Professor Luis Moniz Pereira http://centria.di.fct.unl.pt/~lmp/ Director AI Centre CENTRIA http://centria.fct.unl.pt/ Departamento de Informatica Ph (+351) 21 294 8533 Fax 21 294 8541 Universidade Nova de Lisboa Secretary: (+351) 21 294 8536 2829-516 Caparica, Portugal Email: lmp@di.fct.unl.pt From jadrian@mat.uc.pt Tue Mar 26 20:02:59 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Tue, 26 Mar 2002 20:02:59 +0000 Subject: first-class modules In-Reply-To: <3CA0B080.F9E26CB9@his.com> References: <3CA0B080.F9E26CB9@his.com> Message-ID: <20020326200610.AD2844220B5@www.haskell.org> > On Tuesday 26 March 2002 17:31, you wrote: > A number of people have discussed the use of implicit parameters to > mimic global variables in Haskell.  I am wondering if any have done the > same for a first-class module system such as that proposed by Shields > and Jones.  It seems to make a tremendous amount of sense to do it that > way: > > 1.  semi-constant values:  Things that are calculated or input at the > beginning of the program could be handled by Main.main, which would pass > the results to the Second module, whose main function it could then > call.  This seems much more natural than the implicit parameter approach > for this purpose. It seems nice for that *specific* purpose. What I like about implicit parameters is the fact that they are a more general approach, and that is IMO very important. You, might for instance, decide that maybe it would be a good idea to, under certain specific conditions, change one of those "semi-constant" values. Imagine some AI algortithm, you iterate some learning function 'learnF' over and over again. Now you realize that under certain conditions maybe the learning rate (used in learnF) should be changed. Chaging your implementation would be easy with implicit parameters. J.A. From mpool02@multiparadigm.org Wed Mar 27 07:07:29 2002 From: mpool02@multiparadigm.org (MPOOL 2002) Date: Wed, 27 Mar 2002 08:07:29 +0100 Subject: MPOOL 2002 - FINAL CALL FOR PAPERS Message-ID: <3CA16FB1.52B0189E@multiparadigm.org> We apologize if you have received this CfP multiple times. -------------------------------------------------------------------- CALL FOR PARTICIPATION Workshop on MULTIPARADIGM PROGRAMMING WITH OO LANGUAGES (MPOOL 2002, June 11) at the EUROPEAN CONFERENCE ON OBJECT-ORIENTED PROGRAMMING (ECOOP 2002, Malaga, Spain, June 10-14) While OO has become ubiquitously employed for design, implementation, and even conceptualization, many practitioners recognize the concomitant need for other programming paradigms according to problem domain. We seek answers to the question of how to address the need for other programming paradigms in the general context of OO languages. Specific areas of interest include, but are not limited to: * non-OO programming with OO languages; * merging functional/logic/OO/other programs (language crossbinding); * non-OO programming at the meta level (e.g. template metaprogramming) * module systems vs. object systems * OO design patterns and their relation to functional patterns * type system relationships across languages * theoretical foundations of multiparadigm programming with OO languages The deadline for the submission of a 5+ pages abstract is 8 April 2002 Prospective authors are invited to submit abstracts in PDF or postscript. Any common encoding (MIME or uuencode) or compression (zip, gzip) is acceptable. Authors of accepted papers are responsible for submitting the final version using the Springer LNCS LaTeX template (http://www.springer.de/comp/lncs/authors.html) by May 2, to ensure prompt printing of the proceedings. Submission and email correspondence to mpool02@multiparadigm.org. ORGANIZATION This workshop is a joint organization by the John von Neumann Institute for Computing (NIC) at Research Centre Juelich, Los Alamos National Laboratory, and the Georgia Institute of Technology. PROGRAM COMMITTEE Gerald Baumgartner (Ohio State University, Ohio, USA) Kei Davis (Los Alamos National Laboratory, New Mexico, USA) Jaakko Jaervi (Indiana University, Indiana, USA) Peter Van Roy (Universite catholique de Louvain, Belgium) Yannis Smaragdakis (Georgia Institute of Technology, Georgia, USA) Joerg Striegnitz (John von Neumann Institute for Computing, Germany) FURTHER INFORMATION MPOOL'2002: http://www.multiparadigm.org/mpool2002 ECOOP'2002: http://ecoop2002.lcc.uma.es From romildo@uber.com.br Wed Mar 27 15:30:05 2002 From: romildo@uber.com.br (=?iso-8859-1?Q?Jos=E9?= Romildo Malaquias) Date: Wed, 27 Mar 2002 12:30:05 -0300 Subject: Mutable arrays in Haskell 98 Message-ID: <20020327153005.GA14181@darling.home.br> Hello. I would like to use muttable arrays in Haskell 98, with the GHC _and_ NHC98 compilers. By muttable arrays I mean arrays with in-place updates, as with the MArray arrays (which are not Haskell 98 conformant) found in GHC. Is such array implmentation available? Regards. Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br From Malcolm.Wallace@cs.york.ac.uk Wed Mar 27 15:58:46 2002 From: Malcolm.Wallace@cs.york.ac.uk (Malcolm Wallace) Date: Wed, 27 Mar 2002 15:58:46 +0000 Subject: Mutable arrays in Haskell 98 In-Reply-To: <20020327153005.GA14181@darling.home.br> References: <20020327153005.GA14181@darling.home.br> Message-ID: <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> José Romildo Malaquias writes: > I would like to use muttable arrays in Haskell 98, with the GHC > _and_ NHC98 compilers. By muttable arrays I mean arrays with > in-place updates, as with the MArray arrays (which are not > Haskell 98 conformant) found in GHC. Is such array implmentation > available? Both compilers have libraries supporting the `IOArray' type, implemented with in-place update, although obviously the operations must be threaded through the IO monad. module IOExtras -- called IOExts in ghc ( ... , IOArray -- data IOArray ix elt -- mutable arrays , newIOArray -- :: Ix ix => (ix,ix) -> elt -> IO (IOArray ix elt) , boundsIOArray -- :: Ix ix => IOArray ix elt -> (ix, ix) , readIOArray -- :: Ix ix => IOArray ix elt -> ix -> IO elt , writeIOArray -- :: Ix ix => IOArray ix elt -> ix -> elt -> IO () , freezeIOArray -- :: Ix ix => IOArray ix elt -> IO (Array ix elt) , module Ix -- re-export Ix for the benefit of IOArrays -- instance Eq (IOArray ix elt) ) Regards, Malcolm From jadrian@mat.uc.pt Wed Mar 27 16:29:59 2002 From: jadrian@mat.uc.pt (Jorge Adriano) Date: Wed, 27 Mar 2002 16:29:59 +0000 Subject: Little problem In-Reply-To: References: Message-ID: <20020327163346.0ABEA42221A@www.haskell.org> [moving to haskell-cafe] > Hello > I have little problem. I want to solve this equation > > f(n-1) = f(n)+n > f(6)=6 This is a simple recursive definition.. By the way, are you sure you didn't meant: f(n-1)=f(n)+(n-1) > => f(2)=? Not exactly sure what you're after here. You could simply do: f(2) =f(3)+3 =f(4)+4+3 =f(5)+5+4+3 =f(6)+6+5+4+3 =6+6+5+4+3 =24 anyway it's simple to see, or even prove by induction, that f(n) = (\sum_{i=n+1}^{7} i) -1 = (n+8)(7-n)/2 - 1 If I'm rigth and you're formula is suposed to be f(n-1) = f(n)+n it is even easier. J.A. From romildo@uber.com.br Wed Mar 27 23:16:44 2002 From: romildo@uber.com.br (=?iso-8859-1?Q?Jos=E9?= Romildo Malaquias) Date: Wed, 27 Mar 2002 20:16:44 -0300 Subject: Mutable arrays in Haskell 98 In-Reply-To: <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> References: <20020327153005.GA14181@darling.home.br> <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <20020327231644.GA8755@darling.home.br> On Wed, Mar 27, 2002 at 03:58:46PM +0000, Malcolm Wallace wrote: > José Romildo Malaquias writes: > > > I would like to use muttable arrays in Haskell 98, with the GHC > > _and_ NHC98 compilers. By muttable arrays I mean arrays with > > in-place updates, as with the MArray arrays (which are not > > Haskell 98 conformant) found in GHC. Is such array implmentation > > available? > > Both compilers have libraries supporting the `IOArray' type, > implemented with in-place update, although obviously the operations > must be threaded through the IO monad. > > module IOExtras -- called IOExts in ghc > ( ... > , IOArray -- data IOArray ix elt -- mutable arrays > , newIOArray -- :: Ix ix => (ix,ix) -> elt -> IO (IOArray ix elt) > , boundsIOArray -- :: Ix ix => IOArray ix elt -> (ix, ix) > , readIOArray -- :: Ix ix => IOArray ix elt -> ix -> IO elt > , writeIOArray -- :: Ix ix => IOArray ix elt -> ix -> elt -> IO () > , freezeIOArray -- :: Ix ix => IOArray ix elt -> IO (Array ix elt) > > , module Ix -- re-export Ix for the benefit of IOArrays > -- instance Eq (IOArray ix elt) > ) I am having difficults in defining a map function over an IOArray object. My attempt was mapIOArray :: Ix ix => (a -> b) -> IOArray ix a -> IO (IOArray ix b) mapIOArray f v = do w <- newIOArray bounds ???????????? mapping w (range bounds) where bounds = boundsIOArray v mapping w (i:is) = do x <- readIOArray v i writeIOArray w i (f x) mapping w is mapping w [] = return w But I do not know what to use to replace the ????????????. Is there a polymorphic value in Haskell that can be of any type? Is it indeed possible to have such function without resorting to another intermediate data structure (like a list)? Regards, Romildo -- Prof. José Romildo Malaquias Departamento de Computação http://iceb.ufop.br/~romildo Universidade Federal de Ouro Preto romildo@iceb.ufop.br Brasil romildo@uber.com.br From mtullsen@cse.ogi.edu Wed Mar 27 23:41:52 2002 From: mtullsen@cse.ogi.edu (Mark Tullsen) Date: Wed, 27 Mar 2002 15:41:52 -0800 Subject: Mutable arrays in Haskell 98 References: <20020327153005.GA14181@darling.home.br> <20020327155846.247487df.Malcolm.Wallace@cs.york.ac.uk> <20020327231644.GA8755@darling.home.br> Message-ID: <3CA258C0.9E53EBF6@cse.ogi.edu> José Romildo Malaquias wrote: > ... > My attempt was > > mapIOArray :: Ix ix => (a -> b) -> IOArray ix a -> IO (IOArray ix b) > mapIOArray f v = do w <- newIOArray bounds ???????????? > mapping w (range bounds) > where > bounds = boundsIOArray v > mapping w (i:is) = do x <- readIOArray v i > writeIOArray w i (f x) > mapping w is > mapping w [] = return w > > But I do not know what to use to replace the ????????????. Is there > a polymorphic value in Haskell that can be of any type? > Yes, use "undefined" from the Prelude: undefined :: a undefined | False = undefined - Mark From sas02@clip.dia.fi.upm.es Thu Mar 28 01:30:07 2002 From: sas02@clip.dia.fi.upm.es (sas02@clip.dia.fi.upm.es) Date: Thu, 28 Mar 2002 02:30:07 +0100 Subject: 2002 Static Analysis Symposium (SAS'02) Call for Papers Message-ID: <200203280130.g2S1U7B30799@clip.dia.fi.upm.es> (Apologies for multiple postings) ---------------------------------------------------------------------- CALL FOR PAPERS (SAS'02) The 9th International Static Analysis Symposium September 17 - 20 2002, Madrid, Spain http://clip.dia.fi.upm.es/SAS02 Submission deadline: May 5, 2002 ---------------------------------------------------------------------- Static Analysis is increasingly recognized as a fundamental tool for high performance implementations and verification systems of high-level programming languages. The series of Static Analysis Symposia has served as the primary venue for presentation of theoretical, practical, and application advances in the area. The Ninth International Static Analysis Symposium (SAS'02) will be held at the Technical University of Madrid, do-located with Logic-based Program Development and Transformation (LOPSTR'02) and the APPIA-GULP-PRODE Joint Conference on Declarative Programming (AGP'02). Previous symposia were held in Paris, Santa Barbara, Venice, Pisa, Paris, Aachen, Glasgow and Namur. The technical program for SAS'02 will consist of invited lectures, tutorials, panels, presentations of refereed papers, and software demonstrations. Contributions are welcome on all aspects of Static Analysis, including, but not limited to: * abstract interpretation, * data flow analysis, * verification systems, * program specialization, * abstract domains, * optimizing compilers, * theoretical frameworks, * type inference, * abstract model checking, * complexity analysis, * abstract testing, * security analysis. Submissions can address any programming paradigm, including concurrent, constraint, functional, imperative, logic and object-oriented programming. Survey papers that present some aspect of the above topics with a new coherence are also welcome. Papers must describe original work, be written and presented in English, and must not substantially overlap with papers that have been published or that are simultaneously submitted to a journal or a conference with refereed proceedings. Submission Instructions ----------------------- All submissions must be performed electronically at http://clip.dia.fi.upm.es/SAS02/submission.html. Submitted papers should be at most 15 pages excluding bibliography and well-marked appendices. Program committee members are not required to read the appendices, and thus papers should be intelligible without them. The proceedings will be published by Springer-Verlag in the Lecture Notes in Computer Science series (see http://www.springer.de/comp/lncs/authors.html for the LNCS author instructions). Thus, adhering to that style already in the submission is strongly encouraged. Papers should be submitted either in PostScript or PDF format and they should be interpretable by Ghostscript or Acrobat Reader. Papers must be printable on either A4 paper or US letter, and preferably on both. Important Dates --------------- May 5, 2002 Submission deadline June 10, 2002 Notification June 30, 2002 Final version Sept 17-20, 2002 SAS'02 Program Committee ----------------- Manuel Hermenegildo (Chair) Technical University of Madrid, Spain German Puebla (Co-chair) Technical University of Madrid, Spain Radhia Cousot Ecole Polytechnique, France Saumya Debray The University of Arizona, USA Manuel Fahndrich Microsoft Research, USA Roberto Giacobazzi Univerity of Verona, Italy Chris Hankin Imperial College, UK Giorgio Levi Univerity of Pisa, Italy Kim Marriott Monash University, Australia Alan Mycroft Cambridge University, United Kingdom Ganesan Ramalingam IBM T.J. Watson Research Center, USA Martin Rinard Massachusetts Institute of Technology, USA Shmuel Sagiv Tel-Aviv Univerisity, Israel Reinhard Wilhelm Universitat des Saarlandes, Germany Contact Info ------------ Email: sas02@clip.dia.fi.upm.es Fax: + 34 91 352 4819 Phone: + 34 91 336 7448 Post: Manuel Hermenegildo (Ref.: SAS'02) Facultad de Informatica Universidad Politecnica de Madrid 28660 Boadilla del Monte Madrid, Spain ---------------------------------------------------------------------- -- From whitejbiii@ornl.gov Thu Mar 28 15:37:48 2002 From: whitejbiii@ornl.gov (James B. White III (Trey)) Date: Thu, 28 Mar 2002 10:37:48 -0500 Subject: ">>" and "do" notation Message-ID: <3CA338CD.D807BA87@ornl.gov> I recently discovered that Hugs converts "do" notation as follows. do {e;stmts} = e >>= \_ -> do {stmts} To me, this is inconsistent with the definition given in the Haskell 98 Report. do {e;stmts} = e >> do {stmts} It "hard wires" the default definition of ">>" into "do" notation. If you provide your own definition of ">>", which is completely legal in Haskell, the "do" translation in Hugs disagrees with the definition in the Report. In other words, the following two statements produce different results. do {e;stmts} = e >>= \_ -> do {stmts} do {e;stmts} = e >> do {stmts} When I reported this as a bug, I got responses stating that the definition of "do {e;stmts}" in the Report is merely a suggestion, and that the default definition of ">>" in the "Monad" class is a law of Monads and should not be redefined in instances. I strongly disagree with these responses. I think the default definition of ">>" is just that, a default, and not a law. This view is consistent with every other default definition in a class; it is there for convenience but may be redefined. If it is a law, why are users given the power to change it! Also, I think that the Report *specifies* the translation of "do" to ">>", not merely suggests it. This is the only interpretation that makes sense to me. The above claims---that the contents of the Report are mere suggestions and that default definitions are laws---baffle me. I beg the community to reassure me or enlighten me. If my thoughts are wrong, then I assert that the Report needs revision. ">>" should no longer be a class function with a default value that can be changed; it should be syntactic sugar built into Haskell, like "do" notation. Let me just restate my argument for emphasis: a Monad instance should be able to define its own ">>" operator, and "do" notation should honor this redefinition! -- James B. White III (Trey) Center for Computational Sciences Oak Ridge National Laboratory whitejbiii@ornl.gov From simonpj@microsoft.com Thu Mar 28 15:28:46 2002 From: simonpj@microsoft.com (Simon Peyton-Jones) Date: Thu, 28 Mar 2002 07:28:46 -0800 Subject: Do-notation Message-ID: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> James White has noticed that the draft Haskell 98 report gives the following translation for do-notation: do {e} =3D e do {e;stmts} =3D e >> do {stmts}=20 do {p <- e; stmts} =3D let ok p =3D do {stmts} ok _ =3D fail "..." in e >>=3D ok =20 On the face of it, that makes do-notation depend on the definitions of both (>>) and (>>=3D) in the monad. This makes a difference if someone defines an instance of the Monad class in which (>>) is not defined to be (\x y -> x >>=3D \_ -> y). I am certain that was not the intention of the authors. So one possibility is to change the second line to read do {e;stmts} =3D e >>=3D (\ _ -> do {stmts}) and that is what I *propose* to do. =20 However, James implies that in his monad (>>) has a different meaning than its usual one, and Haskell 98 allows that because (>>) is one of the class operations (not a good design choice I think). I'm quite reluctant to make the meaning of do-notation dependent on such differences. James, can you convince us that doing so would be a good idea? Simon =20 From whitejbiii@ornl.gov Thu Mar 28 16:20:50 2002 From: whitejbiii@ornl.gov (James B. White III (Trey)) Date: Thu, 28 Mar 2002 11:20:50 -0500 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <3CA342E4.DDECC8E9@ornl.gov> Simon Peyton-Jones wrote: > However, James implies that in his monad (>>) has a different meaning > than its usual one, and Haskell 98 allows that because (>>) is one of > the class operations (not a good design choice I think). I'm quite > reluctant to make the meaning of do-notation dependent on such > differences. James, can you convince us that doing so would be a good > idea? I didn't see this before sending off my previous rant. My apologies. Having separate definitions for ">>=" and ">>" is more flexible. With the definition of a default for ">>" in the Monad class, having them separate is no less convenient. More flexible, no less convenient---where is the design flaw? I thought it was a design triumph, fully in the spirit of elegance I associate with Haskell. Are there Monad laws that this breaks? If not, why impose an unnecessary constraint? Let me describe my practical motivation for a separate definition for ">>". I am experimenting with using Haskell to build program generators for embedded domain-specific languages. The goal is to generate high-performance Fortran codes from high-level specifications. I am using a Monad to hold the state of the generation. One thing maintained in the state is a list of declared variables and a list of busy, or in-scope, variables. The generator automatically adds variable declarations as needed. By differentiating between monadic statements that return an argument (>>=) and those that don't (>>), the generator can easily determine when variables go out of scope. Within the definition of ">>", it can free these variables (in a logical, not physical, sense) to be reused. This is critical because it allows me to generate code using large temporary arrays efficiently. As far as I can tell, this use of ">>" breaks no monad laws. In Hugs, it works fine if I use ">>" directly instead of "do". For the aesthetic acceptance of my user base, I need it to work with "do" notation. -- James B. White III (Trey) Center for Computational Sciences Oak Ridge National Laboratory whitejbiii@ornl.gov From olaf@cs.york.ac.uk Thu Mar 28 16:27:19 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Thu, 28 Mar 2002 16:27:19 +0000 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> Message-ID: <3CA34467.24B420F9@cs.york.ac.uk> > I am certain that was not the intention of the authors. So one > possibility is to change the second line to read > > do {e;stmts} = e >>= (\ _ -> do {stmts}) > > and that is what I *propose* to do. > > However, James implies that in his monad (>>) has a different meaning > than its usual one, and Haskell 98 allows that because (>>) is one of > the class operations (not a good design choice I think). I'm quite > reluctant to make the meaning of do-notation dependent on such > differences. I disagree. Hugs should be changed, not the report. In my opinion (>>) is a class operation, because there may be more efficient implementations of (>>) than the default one (\x y -> x >>= \_ -> y). The do notation should profit from a more efficient implementation. I do think that James steps on very dangerous ground if his implementation of (>>) is semantically different from (\x y -> x >>= \_ -> y). This semantic equality is a law of the monad class, that users expect to hold. However, the language (implementation) cannot enforce it; in particular, compilers cannot use such laws for optimisations. The programmer has the freedom to break such laws. The situation is similar with classes such as Eq and Ord. You expect x /= y == not (x == y), but it is not enforced. Actually, the report currently doesn't say that the given default definitions are laws which are expected to hold (except where a comment says otherwise, see class Enum). I think such a statement should be added to the report. Happy Easter, Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From nilsson@cs.yale.edu Thu Mar 28 16:48:25 2002 From: nilsson@cs.yale.edu (nilsson@cs.yale.edu) Date: Thu, 28 Mar 2002 11:48:25 -0500 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> Message-ID: <3CA34959.81A5C949@cs.yale.edu> Olaf Chitil wrote: > > I am certain that was not the intention of the authors. So one > > possibility is to change the second line to read > > > > do {e;stmts} = e >>= (\ _ -> do {stmts}) > > > > and that is what I *propose* to do. > > > > However, James implies that in his monad (>>) has a different meaning > > than its usual one, and Haskell 98 allows that because (>>) is one of > > the class operations (not a good design choice I think). I'm quite > > reluctant to make the meaning of do-notation dependent on such > > differences. > > I disagree. Hugs should be changed, not the report. In my opinion (>>) > is a class operation, because there may be more efficient > implementations of (>>) than the default one (\x y -> x >>= \_ -> y). > The do notation should profit from a more efficient implementation. I agree with Olaf (and James). Incidentally, similar concerns occur in the context of the arrows framework. Ross Paterson, in response to a request from us at Yale, recently changed some derived arrow combinators into default methods of the arrow classes in his implementation of the framework to allow more efficient, instance specific, implementations of these combinators. Our request was prompted by our work of (A)FRP, an embedded language. /Henrik -- Henrik Nilsson Yale University Department of Computer Science nilsson@cs.yale.edu From sof@galois.com Thu Mar 28 17:46:59 2002 From: sof@galois.com (Sigbjorn Finne) Date: Thu, 28 Mar 2002 09:46:59 -0800 Subject: catch (fail "...") Message-ID: <010b01c1d680$8f6ce180$8132a8c0@sofxp> Simon Peyton-Jones simonpj@microsoft.com writes: > > This is an inconsistency that was fixed in the revised Haskell98=20 > report (Apr 2001). See > http://research.microsoft.com/~simonpj/haskell98-revised > > In the bug list look for Page 90. > > It looks as though Hugs hasn't quite caught up with this change. Yes, the Feb 2001 release (which Brian was/is using) unfortunately didn't foresee the future change to the Report :-) The current release, Dec 2001, does the prescribed thing. --sigbjorn From ross@soi.city.ac.uk Thu Mar 28 18:44:39 2002 From: ross@soi.city.ac.uk (Ross Paterson) Date: Thu, 28 Mar 2002 18:44:39 +0000 Subject: Do-notation In-Reply-To: <3CA34959.81A5C949@cs.yale.edu> References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> <3CA34959.81A5C949@cs.yale.edu> Message-ID: <20020328184438.GA2702@soi.city.ac.uk> On Thu, Mar 28, 2002 at 11:48:25AM -0500, nilsson@cs.yale.edu wrote: > Incidentally, similar concerns occur in the context of the arrows framework. > Ross Paterson, in response to a request from us at Yale, recently changed > some derived arrow combinators into default methods of the arrow classes in > his implementation of the framework to allow more efficient, instance > specific, implementations of these combinators. Our request was prompted > by our work of (A)FRP, an embedded language. Yes, but in that case the specific implementations are required to be denotationally equal to the default versions. And surely that was the original intention here. Section 6.3.6 of the Report needs an additional equation: m >> k = m >>= \_ -> k Then Hugs and GHC would be correct but suboptimal. There's a similar glitch in the claim in section 3.5 of the Report that (+ (- exp)) is a substitute for (\x -> x - exp), which is true only if x - y = x + negate y In that case the claim could be simply dropped. From olaf@cs.york.ac.uk Thu Mar 28 19:10:54 2002 From: olaf@cs.york.ac.uk (Olaf Chitil) Date: Thu, 28 Mar 2002 19:10:54 +0000 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> <3CA34959.81A5C949@cs.yale.edu> <20020328184438.GA2702@soi.city.ac.uk> Message-ID: <3CA36ABE.B5D61A5F@cs.york.ac.uk> Ross Paterson wrote: > Yes, but in that case the specific implementations are required to be > denotationally equal to the default versions. And surely that was > the original intention here. Section 6.3.6 of the Report needs an > additional equation: > > m >> k = m >>= \_ -> k > > Then Hugs and GHC would be correct but suboptimal. I agree that this equation should be in the report, but note that there is no *requirement* that the monad laws hold for user defined instances. The report merely states that they *should* hold. Maybe we should be more clear what this word *should* means. I understand it as meaning that the term "monad" suggests that these laws hold, that a programmer should have very good reasons for breaking any of them and if a law is broken a big warning should be attached to the code, because any user of a monad expects it to fulfill the laws. However, because the laws cannot be checked by an implementation, no implementation is allowed to make use of them. In particular, the laws may accidentally have been broken and if an implementation makes use of the laws, then the behaviour of the resulting computation may be completely incomprehensible. (Just to make clear that I don't advocate breaking these laws; but then I'm not a fan of monads anyway...) Olaf -- OLAF CHITIL, Dept. of Computer Science, The University of York, York YO10 5DD, UK. URL: http://www.cs.york.ac.uk/~olaf/ Tel: +44 1904 434756; Fax: +44 1904 432767 From nilsson@cs.yale.edu Thu Mar 28 19:15:20 2002 From: nilsson@cs.yale.edu (nilsson@cs.yale.edu) Date: Thu, 28 Mar 2002 14:15:20 -0500 Subject: Do-notation References: <1113DDB24D4A2841951BFDF86665EE1901041C4F@RED-MSG-10.redmond.corp.microsoft.com> <3CA34467.24B420F9@cs.york.ac.uk> <3CA34959.81A5C949@cs.yale.edu> <20020328184438.GA2702@soi.city.ac.uk> Message-ID: <3CA36BC8.FE6C8B7F@cs.yale.edu> > Yes, but in that case the specific implementations are required to be > denotationally equal to the default versions. Yes, obviously. My only point was that I believe (>>) should remain a class operation. /Henrik -- Henrik Nilsson Yale University Department of Computer Science nilsson@cs.yale.edu From hdaume@ISI.EDU Thu Mar 28 21:27:42 2002 From: hdaume@ISI.EDU (Hal Daume III) Date: Thu, 28 Mar 2002 13:27:42 -0800 (PST) Subject: Z_n in Haskell Message-ID: Suppose I want to define integers modulo n, I could do this something like: data Zn = Zn Integer Integer -- modulus, number instance Num Zn where (Zn m1 n1) + (Zn m2 n2) | m1 == m2 = Zn m1 (n1 + n2 `mod` m1) | otherwise= error "differing moduli" ...etc... However, I'd really like it if, say, addition on Zn-s of different "n" values were caught by the typechecker and disallowed. One solution to this problem would be to do something like: class Modulus m where modulus :: T m -> Integer data Zn m = Zn (T m) Integer instance Modulus m => Num (Zn m) where (Zn m1 n1) + (Zn m2 n2) = (Zn m1 ((n1 + n2) `mod` (modulus m1))) data T a = T data Mod5 data Mod7 instance Modulus (Mod5) where modulus _ = 5 instance Modulus (Mod7) where modulus _ = 7 then we get: Modulus> (Zn (T :: T Mod5) 3) + (Zn (T :: T Mod5) 4) 2 but it fails when the moduli are different: Modulus> (Zn (T :: T Mod5) 3) + (Zn (T :: T Mod7) 4) Ambiguous type variable(s) `a' in the constraint `Show a' arising from use of `print' at In a 'do' expression pattern binding: print it :1: Couldn't match `Mod7' against `Mod5' Expected type: T Mod7 Inferred type: T Mod5 In an expression with a type signature: T :: T Mod7 In the first argument of `Zn', namely `(T :: T Mod7)' Unfortunately, this solution isn't very pretty. We have to define a new datatype for each modulus and make it an instance of Modulus. Is there a better way to do this? - Hal -- Hal Daume III "Computer science is no more about computers | hdaume@isi.edu than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume From ken@digitas.harvard.edu Thu Mar 28 21:43:59 2002 From: ken@digitas.harvard.edu (Ken Shan) Date: Thu, 28 Mar 2002 13:43:59 -0800 Subject: Z_n in Haskell In-Reply-To: References: Message-ID: <20020328214359.GB2215@ccshan.stanford.edu> --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2002-03-28T13:27:42-0800, Hal Daume III wrote: > Suppose I want to define integers modulo n, I could do this something Check out the message "Modular arithmetic" earlier on haskell-cafe (http://www.haskell.org/pipermail/haskell-cafe/2001-August/002132.html) and its followup... --=20 Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig Dyer Honeycutt 3192 Anchor Drive Southside, AL 35907-0866 --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8o46ezjAc4f+uuBURAvKwAJ9Dv6zigbDbu9B3eOoTwoi7msW9MACgj+l2 POwnhFy8vC7jJuXpLFQ+MU0= =9+XM -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ-- From wolfgang@jeltsch.net Thu Mar 28 23:19:14 2002 From: wolfgang@jeltsch.net (Wolfgang Jeltsch) Date: Fri, 29 Mar 2002 00:19:14 +0100 Subject: ">>" and "do" notation In-Reply-To: =?iso-8859-1?Q?=3C20020329000911=2EA1832?= =?iso-8859-1?Q?=40localhost=3E=3B_from_wolfgang=40jeltsch=2Enet_on_Fre=2C?= =?iso-8859-1?Q?_M=E4r?= 29, 2002 at 00:09:11 +0100 References: <3CA338CD.D807BA87@ornl.gov> <20020329000911.A1832@localhost> Message-ID: <20020329001914.C1832@localhost> On Thursday, March 28, 2002, 16:37 CET James B. White III wrote: > [...] > I think the default definition of ">>" is just that, a default, and not a > law. I suppose, a >> b = a >>= \_ -> b is intended to be a law. This would mean that every redefined (>>) would have to obey this law. > [...] > If it is a law, why are users given the power to change it! For performance reasons, I would suppose. > Also, I think that the Report *specifies* the translation of "do" to ">>", > not merely suggests it. The report specifies certain identities and suggests to use these identities for translations into the kernel. If it is also a law that a >> b and a >>= \_ -> b are identical even with respect to laziness then, I think, a conforming Haskell implementation could use the latter instead of the former to realize do expressions. But I would prefer implementations using (>>). > [...] > ">>" should no longer be a class function with a default value that can be > changed; it should be syntactic sugar built into Haskell, like "do" > notation. It shouldn't be syntactic suger but at most an operator which does not belong to the monad class. One could define (>>) just as an ordinary function instead of a class member. > [...] By the way, why uses the report the complicated looking \_ -> b instead of just const b. Wolfgang From oleg@pobox.com Fri Mar 29 04:28:28 2002 From: oleg@pobox.com (oleg@pobox.com) Date: Thu, 28 Mar 2002 20:28:28 -0800 (PST) Subject: Z_n in Haskell Message-ID: <200203290428.UAA89829@adric.cs.nps.navy.mil> The Z_n problem doesn't seem to be different from the problem of arrays or bitvectors of a statically-checkable size. If you prefer a decimal specification of the modulus, you may find the following articles relevant. Implementation of fixed-precision decimal types: Main> BV D1 0 Bitvector of width 1 and value 0 Main> BV (D1,D2) 123 Bitvector of width 12 and value 123 Main> BV (D5,D7,D9) 31415 Bitvector of width 579 and value 31415 It appears that modulus in the Z_n problem plays the same role as the bitvector width in the bitvector problem. An attempt to perform an operation on bitvectors of different sizes results in a compiler error: Main> (BV (D1,D0) 10) `b_and` (BV (D1,D1) 7) ERROR - Type error in application *** Expression : b_and (BV (D1,D0) 10) (BV (D1,D1) 7) *** Term : BV (D1,D0) 10 *** Type : BitVector (D1,D0) *** Does not match : BitVector (D1,D1) http://groups.google.com/groups?selm=7eb8ac3e.0202201753.473a5cb2%40posting.google.com Arbitrary precision decimal types, e.g.: Main> BV (D1 $ D2 $ D3 $ D4 $ D5 $ D6 $ D7 $ D8 $ D9 $ D0 $ D9 $ D8 $ D7 $ D6 $ D5 $ D4 $ D3 $ D2 $ D1 $ Dim) 1234567879 Bitvector of width 1234567890987654321 and value 1234567879 which are slightly more general and less convenient, are described in: http://groups.google.com/groups?selm=7eb8ac3e.0202230221.62d98db8%40posting.google.com Both implementations work in any Haskell-98 system. Multi-parameter classes, existential types or other extensions are not needed. From Jon.Fairbairn@cl.cam.ac.uk Fri Mar 29 10:28:34 2002 From: Jon.Fairbairn@cl.cam.ac.uk (Jon Fairbairn) Date: Fri, 29 Mar 2002 10:28:34 +0000 Subject: ">>" and "do" notation In-Reply-To: Your message of "Fri, 29 Mar 2002 00:19:14 +0100." <20020329001914.C1832@localhost> Message-ID: <8102.1017397714@cl.cam.ac.uk> Wolfgang Jeltsch wrote: > It shouldn't be syntactic suger but at most an operator which does not = belong > to the monad class. One could define (>>) just as an ordinary function > instead of a class member. That sounds to me like the best idea so far. = If (as a human reader of a programme) I see do a <- thing1 and I notice (perhaps after some modifications) that a is not present in , then I /really/ don't want a change to do thing1 to change the meaning of the programme. J=F3n From rjljr2@yahoo.com Fri Mar 29 13:43:40 2002 From: rjljr2@yahoo.com (Ronald Legere) Date: Fri, 29 Mar 2002 05:43:40 -0800 (PST) Subject: Type extensions Message-ID: <20020329134340.69879.qmail@web10005.mail.yahoo.com> Greetings. I have decided to try and understand the type system of haskell with extensions. As far as I can tell, the following set of extensions has been included, for example in ghc: multiparameter type classes constructor classes existential types explicit universal quantification scoped type signatures funtional dep?? Etc There is probably some overlap, and probably missed a few, as i do not understand what all these things do! ! My question: How do you get started learning all this? which of these is the most important? Is there a paper out there that explains most or all of these extensions and why you would want them and HOW the heck they work together? Ron Legere __________________________________________________ Do You Yahoo!? Yahoo! Greetings - send holiday greetings for Easter, Passover http://greetings.yahoo.com/ From wolfgang@jeltsch.net Fri Mar 29 16:25:13 2002 From: wolfgang@jeltsch.net (Wolfgang Jeltsch) Date: Fri, 29 Mar 2002 17:25:13 +0100 Subject: Type extensions In-Reply-To: =?iso-8859-1?Q?=3C20020329134340=2E69879?= =?iso-8859-1?Q?=2Eqmail=40web10005=2Email=2Eyahoo=2Ecom=3E=3B_from_rjljr2?= =?iso-8859-1?Q?=40yahoo=2Ecom_on_Fre=2C_M=E4r?= 29, 2002 at 14:43:40 +0100 References: <20020329134340.69879.qmail@web10005.mail.yahoo.com> Message-ID: <20020329172513.A2308@localhost> On Friday, March 29, 2002, 14:43 CET Ronald Legere wrote: > [...] > As far as I can tell, the following set of extensions has been included, > for example in ghc: > multiparameter type classes > constructor classes Type classes can be seen as a specific kind of constructor classes because a type can be seen as a type constructor with zero arguments. So the constructor class concept is more general than the type class concept. Constructor classes aren't an extension but belong to the Haskell 98 standard. They didn't belong to some older versions of the standard, however. Normally, a type or constructor class has one parameter --- a type or a type constructor respectively. The multi-parameter type class concept extends the ordinary *type* class concept such that classes can have multiple parameters but these arguments have to be types. The multi-parameter constructor class concept allows mulitple class parameters which may be arbitrary type constructors. I think GHC used to implement only multi-parameter type classes while Hugs implemented multi-parameter constructor classes. The newer GHC versions implement multi-parameter constructor classes as well. > [...] > Is there a paper out there that explains most or all of these extensions > and why you would want them and HOW the heck they work together? I don't know of such a paper. There is several information distributed over several documents. Concerning (single-parameter) constructor classes, you may consult some Haskell 98 document, for instance the Gentle introduction to Haskell or the Haskell report. Concerning the other things, you may, for example, have a look at Simon Peyton Jones' Haskell stuff, referenced on http://research.microsoft.com/users/simonpj/. > [...] Wolfgang From whitejbiii@ornl.gov Sat Mar 30 05:39:59 2002 From: whitejbiii@ornl.gov (James B. White III (Trey)) Date: Sat, 30 Mar 2002 00:39:59 -0500 Subject: Unbind ">>"! (was Do-notation) Message-ID: <3CA3CD21@webmail> Here's my short manifesto on ">>" and "do" notation. It is based on the precedent set with "negate", a precedent that I also support. ">>" should be a member of the "Monad" class, just as "negate" is a member of the "Num" class! Users should have the power to override the default definition of ">>", just as they have the power to override the default definition of "negate"! Haskell compilers should honor user definitions for ">>" and not hard-wire ">>= \_ ->", just as they should honor user definitions for "negate" and do not hardwire "0 - x"! I have fixed the December 2001 release of Hugs to follow these principles for ">>". (I haven't tested the fix exhaustively. It works on my programs. Corrections appreciated!) Here are the "diffs", before the fix followed by after: connect.h: 74c74 < extern Name nameReturn, nameBind; /* for translating monad comps */ --- > extern Name nameReturn, nameBind, nameSequence; /* for translating monad comps */ type.c: 85c85 < Name nameReturn, nameBind; /* for translating monad comps */ --- > Name nameReturn, nameBind, nameSequence; /* for translating monad comps */ 3267a3268 > nameSequence = linkName(">>"); compiler.c: 397c397 < * do { e; qs } => LETREC _h _ = [ e | qs ] in bind m exp _h --- > * do { e; qs } => sequence m e qs 433,442c433,436 < case DOQUAL : { Cell hVar = inventVar(); < Cell ld = cons(pair(singleton(WILDCARD), < transDo(m,e,qs1)), < NIL); < return ap(LETREC, < pair(singleton(pair(hVar,ld)), < ap(ap(ap(nameBind, < m), < translate(snd(q))), < hVar))); --- > case DOQUAL : { > return ap(ap(ap(nameSequence, m), > translate(snd(q))), > transDo(m,e,qs1)); --- James B. White III (Trey) Center for Computational Sciences Oak Ridge National Laboratory whitejbiii@ornl.gov From ru@river.org Sun Mar 31 07:34:05 2002 From: ru@river.org (Richard Uhtenwoldt) Date: Sat, 30 Mar 2002 23:34:05 -0800 Subject: ">>" and "do" notation In-Reply-To: <8102.1017397714@cl.cam.ac.uk> References: <20020329001914.C1832@localhost> <8102.1017397714@cl.cam.ac.uk> Message-ID: >If (as a human reader of a programme) I see > >do a <- thing1 > > >and I notice (perhaps after some modifications) that a is >not present in , then I /really/ don't want a >change to > >do thing1 > > >to change the meaning of the programme. That's understandable, just like it's understandable that a programmer does not want to read a program that redefines id or const or map to something with a completely different meaning. But is that any reason for the language standard to *disallow* redefinition of id or const or map? And if the answer is yes, where does this proscriptive zeal stop? Should the language standard, eg, disallow functions whose name ends in 'M' but do not have monads in their signature? No: the individual programmer should be free to decide to override conventions if doing that is expedient. After all, there is no danger that what James wants to do will become common or widespread; it's just an expediency to deal with a rare situation. The bottom line is a social one: language communities compete fiercely for programmers. There is no shortage of languages with open-sourced implementations in which James could have written his program. (Er, actually James is embedding a DSL in Haskell, which brings many programmers to Haskell.) If we want Haskell to grow, we must make it as easy as possible for programmers to solve their problems in Haskell. Of course there are some things that are essential to Haskell that we should not compromise on. Those who describe a >> b = a >>= \_ -> b as a law might maintain that it is one of those essential things. Well, to them I ask, are id x = x and const x y = y laws, too? How about fix f = f (fix f)? swap (a,b) = (b,a)? mirror (Right a) = Left a mirror (Left a) = Right a? etc, etc. From tony@raeline.net Sun Mar 31 11:19:02 2002 From: tony@raeline.net (tony) Date: Sun, 31 Mar 2002 06:19:02 -0500 (EST) Subject: ѰÇóºÏ×÷ Message-ID: <20020331111902.C10764220B5@www.haskell.org> Ç×°®µÄÅóÓÑ£º ¡¡¡¡ÄúºÃ£¡ ¡¡¡¡ÕâÊÇÀ´×ÔÈðÀ´ÍøÂ磨ÏÃÃÅ£©ÓÐÏÞ¹«Ë¾µÄÎʺ¸ÐлÄúÊÕ¿´Õâ·âÓʼþ¡£ÎÒÃÇÕæ³ÏµÄÏ£ÍûÄúÄܳÉΪÎÒÃÇÔÚ¹ó µØÇøµÄÖØÒª»ï°é¡£ÎÒÃÇÊÇÒ»¼Ò²ÉÓÃÊÀ½ç¸ßм¼Êõ½á¾§£¬Ñо¿¡¢ÍƹãºÍ·¢Õ¹Ð¼¼Êõ£¬ÖÂÁ¦ÓÚ»¥ÁªÍøÐÅÏ¢·þÎñ¡¢µç ×ÓÉÌÎñ·þÎñºÍÆóÒµÓ¦Ó÷þÎñµÄ¸ßм¼ÊõÆóÒµ¡£ÏêÇéÇëä¯ÀÀ:http://www.raeline.net email:webmaster@raeline.net лл£¡ ¡¡¡¡¹«Ë¾×Ô2000ÄêÆðÈ«Á¦½ø¾ü¹ú¼Ê»¥ÁªÍø·þÎñÁìÓò£¬ÕûºÏÍÆ³öÁËÒÔϲúÆ·£¬È«ÃæÂú×ãÄúµÄÐèÇó¡£Õ⽫»áÊÇÄú³¬ ÖµµÄÑ¡Ôñ¡£ ¡¡¡¡1.30M¿Õ¼ä£«50MÆóÒµÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû£¬¹¦ÄÜÈ«Ãæ£¬½öÊÛ198Ôª/Äê¡£ ¡¡¡¡2.50M¿Õ¼ä£«100MÆóÒµÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû£¬¹¦ÄÜÈ«Ãæ£¬½öÊÛ248Ôª/Äê¡£ ¡¡¡¡3.100M¿Õ¼ä£«100MÆóÒµÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû£¬¹¦ÄÜÈ«Ãæ£¬½öÊÛ318Ôª/Äê¡£ ¡¡¡¡4.100M¿Õ¼ä+100MÓÊÏ䣫1¸ö¹ú¼ÊÓòÃû+¸÷ÖÖ·ç¸ñÄ£°åÍøÕ¾+´óÐÍÍøÕ¾Ãâ·ÑÐû´«ÆóÒµÐÅÏ¢ ½öÊÛ1000Ôª ¡£ ¡¡¡¡¾¡¹ÜÎÒÃǾ¡Á¦ÎªÄúÌṩ×îºÃµÄ·þÎñ¡££¬µ«²»Åųý³öÏÖʧÎó¡£Èç¹ûÊÇÕâÑù£¬ÎÒÃÇÄþÔ¸½ÓÊÜÍ˿Ҳ²»»áÒòΪ ÄÄÅÂÒ»µãµãµÄ²»ÂúÒâ¶øÈÃÄú²»¿ªÐÄ¡£ËùÒÔÎÒÃdzÐŵ£ºÖ÷»ú²»ÂúÒⰴʵ¼ÊÓà¶îÍ˿ ¡¡¡¡×££º¿ªÐÄ£¡Ë³Àû£¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡webmaster of raeline.net webmaster@raeline.net ÈðÀ´ÍøÂ磨ÏÃÃÅ£©ÓÐÏÞ¹«Ë¾¡¡¡¡ --------------------------------------------------------------- ·ÐµãȺ·¢Óʼþ,À´×ÔÈí¼þ¹¤³Ìר¼ÒÍø(http://www.21cmm.com) ½øCMMÍøÐ£(http://www.21cmm.com)£¬³ÉÏîÄ¿¹ÜÀíר¼Ò From oleg@pobox.com Sun Mar 31 21:48:28 2002 From: oleg@pobox.com (oleg@pobox.com) Date: Sun, 31 Mar 2002 13:48:28 -0800 (PST) Subject: Lambda over types. References: Message-ID: <200203312148.NAA97652@adric.cs.nps.navy.mil> anatoli wrote: > Attached are two interpreters: one for untyped lambda calculus, I'm afraid the attached interpreter can't be an implementation of the lambda calculus. For one thing, it lacks the hygiene of substitutions: Lambda> :t lambdaEval (A (L X (L Y (A X Y))) T) lambdaEval (A (L X (L Y (A X Y))) T) :: L Y (A T Y) That's OK. However, Lambda> :t lambdaEval (A (L X (L Y (A X Y))) Y) lambdaEval (A (L X (L Y (A X Y))) Y) :: L Y (A Y Y) That is wrong! The correct answer is: L Yfresh (A Y Yfresh) The interpreter in question doesn't appear to be able to manufacture fresh identifiers (i.e., fresh types). Without an ability to expand the set of available identifiers, the capture-free substitution is impossible. Furthermore, some terms fail to evaluate: Lambda> :t lambdaEval (A (L X (A X X)) T) lambdaEval (A (L X (A X X)) T) :: Eval (A (L X (A X X)) T) a => a Lambda> :t lambdaEval (A (A (L X X) T) Y) lambdaEval (A (A (L X X) T) Y) :: Eval (A (A (L X X) T) Y) a => a which is not the result one would've expected. Finally, the interpreter doesn't actually find the normal form. The rule > instance Eval (L v e) (L v e) prevents any reductions under lambda. True, call-by-name or call-by-value interpreters stop short of reducing the body of a lambda form. Normal or applicative order interpreters however -- in order to find the beta-eta-normal form -- should seek and attempt any reduction. The hygienic substitution (with alpha-conversion if necessary) and the repeated identification of the leftmost outermost redex are actually quite challenging. We can guarantee the hygienic substitution if we implement the de Bruijin notation for lambda terms. Another, related technique is coloring of existing identifiers. A macro-expander of R5RS Scheme macros implements the coloring to ensure the hygiene of macro expansions. The macro-expander can be cajoled into painting identifiers on our demand, which has been used in a macro-expand-time lambda calculator. In Haskell, we have to paint manually. A variable in a typechecker-time lambda-calculator has to be represented by a type like Vr (Succ (Succ (Succ Zero))) X. The latter component is the "name" and the former is the color. The Eval and Subst relations should be extended with color_in and color_out type parameters (perhaps with a dependency: term color_in -> color_out). The only non-trivial use of colors is in doing a substitution (L var body)[exp/var']. The bound variable has to be repainted before the substitution in the body. The beta-substitutor itself can do the repainting. From sk@cs.brown.edu Sun Mar 31 17:41:48 2002 From: sk@cs.brown.edu (Shriram Krishnamurthi) Date: Sun, 31 Mar 2002 12:41:48 -0500 (EST) Subject: PLAN-X: Programming Language Technologies for XML Message-ID: <200203311741.MAA27285@bosch.cs.brown.edu> PLAN-X: PROGRAMMING LANGUAGE TECHNOLOGIES FOR XML Oct 3, 2002 Pittsburgh, PA (Co-located with PLI) CALL FOR PAPERS Submission deadline: May 1, 2002 XML has emerged as the de facto standard for data interchange on the web. The use of XML as a common format for representation, interchange, and transformation of data poses new challenges to programming languages, applications, and database systems. During the last few years, the database research community has devoted a lot of attention to XML's data representation challenges, as evidenced by the number of XML-related publications in premier database conferences and journals. In contrast, the attention devoted to XML by the programming language research community has been minimal. This is unfortunate, since the robustness of current and future programming standards and tools for XML will depend on the strength of their foundations in core programming technologies e.g., XML parsing (parsing theory and incremental parsing), XML schemas (type systems), XPATH expressions and XSLT programs (pattern-matching languages and their optimization), XSLT debuggers (dynamic program analysis and slicing). Since XML is a new domain, core programming technologies developed in past research cannot be used unchanged; instead, novel research is required to address the unique challenges posed by XML and its use in web applications and standalone applications. This workshop aims to bring together researchers from the programming languages and XML communities, a) to foster novel research to address unique challenges being posed by XML on current and future programming technologies; b) to exchange information on early research experiences with XML-related programming systems, tools, and languages; and c) to expose the PLI community to XML technologies and the potential impact of these technologies on future software. SUBMISSION PROCEDURE We solicit submissions on original research not previously published or currently submitted for publication elsewhere, in the form of extended abstracts. These extended abstracts should not exceed 5000 words (approximately 10 pages). Detailed submission instructions will be posted at http://www.research.avayalabs.com/user/wadler/planx by early April. PROCEEDINGS There will be no formal proceedings. An informal proceedings will be distributed at the workshop. IMPORTANT DATES Paper submission deadline May 1 Notification of acceptance June 21 Final papers due for informal proceedings Sep 4 WEB PAGE: http://www.research.avayalabs.com/user/wadler/planx/ GENERAL CHAIR: Vivek Sarkar, IBM PROGRAM COMMITTEE: Allen Brown (Microsoft) Peter Buneman (Edinburgh) Sophie Cluet (Xyleme / INRIA) Mary Fernandez (AT&T Labs) Shriram Krishnamurthi (Brown) Makoto Murata (IBM Japan) Benjamin Pierce (University of Pennsylvania), co-chair Michael Schwartzbach (Aarhus) Dan Suciu (University of Washington) Philip Wadler (Avaya Labs), co-chair INVITED SPEAKER: James Clark