RE: Priority of % (Ratio)
If I load ratio and type 2^3%5 into Hugs I get 8 % 5 as I'd expect. If I do the same for ghci, I get an error message, because it's parsed it as 2^(3%5). Prelude Ratio ought to have infixl 7 % (or maybe it should be in GHC.Real), but I can't find it (in either) Fixed, thanks. Cheers, Simon ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
FFI: passing 6 FD arguments doesn't work
uname -a: SunOS titania 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-1 ghc --version: The Glorious Glasgow Haskell Compilation System, version 5.04 gcc --version: 2.95.3 With the files in the attached archive unpacked: ghc hw5.c TestHW5.hs -ffi -package posix -o hw5 -Wall ./hw5 produces output Hello World (it works). ghc hw.c TestHW.hs -ffi -package posix -o hw -Wall ./hw produces output Illegal Instruction (it doesn't work). However the only difference between the two is that the C function called by TestHW.hs has 6 arguments of type Fd, while that called by TestHW5.hs has only 5. I hope this gets fixed soon; I have just spent an embarassing amount of time tracking down this bug, and I wouldn't like it to bit anyone else. hw.tar.gz Description: Binary data
Re: FFI: passing 6 FD arguments doesn't work
However the only difference between the two is that the C function called by TestHW.hs has 6 arguments of type Fd, while that called by TestHW5.hs has only 5. Quick thing to try to see if it helps: It's possible that the problem is only affecting one of GHC's code generators so you might try the other one. I think the default is the native code generator so you might try using the via-C code generator instead (-fviac I think). You might also try a non-sparc if you have one handy. IIRC, 5-6 arguments is the point where sparcs switch from passing arguments in registers to passing them on the stack so this is likely to be sparc-specific. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ ___ Glasgow-haskell-bugs mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
CFP: AMAI Special Issue on Computational Logic in Multi-Agent Systems
[We apologize if you receive multiple copies of this message.] Call for Papers Annals of Mathematics and Artificial Intelligence Special Issue on Computational Logic in Multi-Agent Systems Special Issue Editors: Jürgen Dix (The University of Manchester, UK) João Alexandre Leite (New University of Lisbon, Portugal) KenSatoh (National Institute of Informatics, Japan) http://centria.di.fct.unl.pt/~jleite/amai03/ Submission Deadline: October 1st, 2002 About the Special Issue: Multi-agent systems (MAS) have become an increasingly important area of research, not least because of the advances in the Internet and Robotics. However multi-agent systems can become very complicated, and, consequently, reasoning about the behaviour of such systems can become extremely difficult. Therefore, it is important to be able to formalise multi-agent systems and, to do so in such a way that allows automated reasoning about agents' behaviour. The purpose of this Special Issue is to present techniques, based on computational logic (CL), for reasoning about multi-agent systems in a formal way. This is clearly a major and exciting challenge for computational logic. We have to develop techniques to deal with real world issues and applications. We solicit papers that address CL-related formal approaches to multi-agent systems . The approaches as well as being formal must make a significant contribution to the practice of multi-agent systems. Relevant techniques include the following (but are not limited to): Nonmonotonic reasoning in MAS Planning in MAS Adaptability and learning in MAS Knowledge representation in MAS Temporal reasoning in MAS Negotiation, co-operation, competition and communication in MAS Verification of MAS Decision theory for MAS Distributed problem solving in MAS Significant applications of MAS Submission Details: We are expecting full papers to describe original, previously unpublished research, be written in English, and not be simultaneously submitted for publication elsewhere (previous publication of partial results at workshops with informal proceedings is allowed). Papers should be formatted according to the Instructions for AMAI submissions (to be found at http://www.kluweronline.com/issn/1012-2443 ) and should be between 20 and 40 pages long: We also require the following issues to be addressed: CL:An introduction that includes statements about how the paper addresses the exploitation of CL for MAS; MAS: An explanation of which aspect/functionality of MAS the paper formalises; Examples: Example(s) which give an intuitive motivation and explanation of the formalisation. Please submit a PostScript or PDF file of your paper to [EMAIL PROTECTED] by the 1st of October 2002. Important Dates: Submission Deadline: October 1, 2002 Author Notification: December 15, 2002 Final Paper Deadline: February 15, 2003 Special Issue: September 2003 About the Special Issue Editors: Jürgen Dix is a Reader at The University of Manchester, UK. He is also member of the CS Department at the Technical University of Vienna, where he is lecturing regularly. He worked since 1989 in several areas of Computational Logic (nonmonotonic reasoning, logic programming, deductive databases, knowledge representation) and, lately, also in Multi-Agent Reasoning. João Alexandre Leite is a researcher at the Center for Artificial Intelligence (CENTRIA), New University of Lisbon, Portugal. He has been doing research on logic programming and non-monotonic reasoning, with particular emphasis on the problem of representing and reasoning about dynamic knowledge, and its application to multi-agent systems. Ken Satoh is a professor of National Institute of Informatics, Japan. He has been doing research on theoretical foundations of AI such as nonmonotonic reasoning, preference-based reasoning and case-based reasoning. He is also interested in formalization of multi-agent systems and application of the above reasoning to multi-agent systems. About Annals of Math and AI: Annals of Mathematics and Artificial Intelligence (AMAI) is devoted to reporting significant contributions on the interaction of mathematical and computational techniques reflecting the evolving disciplines of artificial intelligence. Annals of Mathematics and Artificial Intelligence publishes edited volumes of original manuscripts, survey articles, monographs and well refereed conference proceedings of the highest caliber within this increasingly important field. All papers will be subject to
PLI 2002 early registration deadline approaching
[This is the last announcement we will send about PLI 2002. Please note that the early registration deadline is just over a week away. We look forward to your participation in the events!] PLI 2002 Principles, Logics, and Implementations of High-Level Programming Languages Early Registration Deadline: SEPTEMBER 12, 2002 Pittsburgh, PA, USA October 3-8, 2002 http://pli2002.cs.brown.edu/ PLI is a confederation of conferences and workshops aimed at the advancement of high-level programming languages. This year, PLI consists of three conferences: ICFP (International Conference on Functional Programming) PPDP (International Conference on Principles and Practice of Declarative Programming) GPCE (Generative Programming and Component Engineering) and seven workshops: Haskell PLAN-X (Programming Languages for XML) Scheme Rule (Rule-Based Programming) VCL (Verification and Computational Logic) Erlang FDPE (Functional and Declarative Programming in Education) The hotel's cut-off date for guaranteed reservations at the group rate is also September 12, 2002, so do register and reserve soon. We look forward to seeing you in Pittsburgh! Shriram Krishnamurthi Publicity Chair PLI 2002 ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Lazy IO?
Is there any way to make the IO Monad lazy? The simplified version of my problem is that I want to generate an infinite structure from an IOArray and then consume only the relevant part of it. The real version of my problem is that the IOArray is embedded 4 API layers deep and it would be a lot of effort to change all those APIs and dependent code for this 1 change. Sengan ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: Lazy IO?
On Tue, 3 Sep 2002 14:49:45 -0400 [EMAIL PROTECTED] wrote: Is there any way to make the IO Monad lazy? The simplified version of my problem is that I want to generate an infinite structure from an IOArray and then consume only the relevant part of it. Yes, unsafeInterleaveIO. http://www.haskell.org/ghc/docs/latest/html/base/System.IO.Unsafe.html#unsafeInterleaveIO This is how getContents is implemented so that it reads the file lazily. Be careful of course it is unsafe. Duncan ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: Lazy IO?
On Tue, 3 Sep 2002 20:08:32 +0100 Duncan Coutts [EMAIL PROTECTED] wrote: On Tue, 3 Sep 2002 14:49:45 -0400 [EMAIL PROTECTED] wrote: Is there any way to make the IO Monad lazy? The simplified version of my problem is that I want to generate an infinite structure from an IOArray and then consume only the relevant part of it. Yes, unsafeInterleaveIO. http://www.haskell.org/ghc/docs/latest/html/base/System.IO.Unsafe.html#unsafeInterleaveIO This is how getContents is implemented so that it reads the file lazily. Be careful of course it is unsafe. Duncan Excellent. Thanks a lot, Sengan ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
mutable records
Hi, Is it possible to define oject types in Haskell and what does one propose to do it? Is it possible to define parts of a record with the help of the ST s monad mutable during the whole program? (As is possible in Ocamel)? Thx Scott
Re: mutable records
Scott J. [EMAIL PROTECTED] wrote, Is it possible to define oject types in Haskell and what does one propose to do it? Depends on what you mean by object types. You can surely define a record with funcions dubbing as methods and non-functional values dubbing as object data. Is it possible to define parts of a record with the help of the ST s monad mutable during the whole program? (As is possible in Ocamel)? Just make the fields that you want to update be values of `STRef s a'. (You can also do the same with the IO monad and `IORef's.) Having said this, there are not that many situations where you need to do this (and in consequence ST-monadify your program). Purely functional updates (using the record syntax) where the system effectively copies the whole record (not all data in it, just the references to that data) is perfectly suitable in most cases. If you are concerned about efficiency first profile the code to see whether the performance bottleneck is really where you think it is. Cheers, Manuel ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
(no subject)
Does anyone know what happened to the wiki on haskell.org? There was lots of stuff there last year (mostly to do with design patterns) which seems to have been lost. Some of the links are still there but they don't go anywhere. Cheers Chris
Wiki problems
We're aware of the wiki problems. We've got out wiki guy working on it and I hope everything will be working again soon. We won't lose anything that's been posted to the wiki. Please be patient! John ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: mutable records
Sorry for my late reply, But is it possible to be more specific (little examples) In Haskell one can use existential lists but I doubt about the efficiency. It is not my aim to make of everything an object like in Jave e.g. . The objects I have in mind are showable ojects: windows, scrollbars, messageboxes, etc. . Of such objects I demand fast response with respect to key input or mouse clicks. I am sure Ocamel can do that. Regards Scott - Original Message - From: Manuel M T Chakravarty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, September 03, 2002 10:37 AM Subject: Re: mutable records Scott J. [EMAIL PROTECTED] wrote, Is it possible to define oject types in Haskell and what does one propose to do it? Depends on what you mean by object types. You can surely define a record with funcions dubbing as methods and non-functional values dubbing as object data. Is it possible to define parts of a record with the help of the ST s monad mutable during the whole program? (As is possible in Ocamel)? Just make the fields that you want to update be values of `STRef s a'. (You can also do the same with the IO monad and `IORef's.) Having said this, there are not that many situations where you need to do this (and in consequence ST-monadify your program). Purely functional updates (using the record syntax) where the system effectively copies the whole record (not all data in it, just the references to that data) is perfectly suitable in most cases. If you are concerned about efficiency first profile the code to see whether the performance bottleneck is really where you think it is. Cheers, Manuel ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: mutable records
In Haskell one can use existential lists but I doubt about the efficiency. Existential lists don't have any special time overhead. All you're doing is making the typechecker happy about what you're doing. Of course, there's a small overhead in that any function you invoke on that object will almost certainly be an indirect function call rather than a direct function call so you get the same (small) overhead as in C++ virtual function calls, Haskell method calls (when not optimized away), etc. It is not my aim to make of everything an object like in Jave e.g. . The objects I have in mind are showable ojects: windows, scrollbars, messageboxes, etc. . Of such objects I demand fast response with respect to key input or mouse clicks. I am sure Ocamel can do that. We're sure Haskell can too. You can probably translate your OCaml code fairly directly into Haskell but directly translating code which uses mutable state tends to result in unidiomatic Haskell code. If you want nice Haskell code (i.e., which exploits Haskell's strengths, plays well with other libraries, etc.) it's often best to think about the problem you're trying to solve and find a way to express that in Haskell instead of trying to express the standard solution in Haskell. For example, C/C++/Java GUIs are usually implemented by creating a bunch of objects and then connecting the objects together by invoking methods on them to add event handlers, etc. Such programs almost never change the object interconnections after this initialization phase. In effect, we have a bunch of single-assignment variables: they get initialized but never change after that. Haskell has single-assignment variables too (i.e., the normal, non-mutable variables you learn about on page 2 of any Haskell textbook) and you can often use them to express the connections between the objects. Doing this has an enormous benefit that you don't get in C, C++, Java, etc. which is that Haskell's typechecker can catch some of the errors you might make when making these object interconnections. This example probably doesn't apply to your code but it's an example of how you can eliminate gratuitious use of mutable variables from your code. The key is to ask us about the problem you're trying to solve not ask how to express the standard (imperative) solution in Haskell. -- Alastair Reid [EMAIL PROTECTED] Reid Consulting (UK) Limited http://www.reid-consulting-uk.ltd.uk/alastair/ ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe