Re: ANNOUNCE: GHC vesrion 5.04.3 released
I notice the release notes say a few architectures should be possible to port to, in particular AIX/POWER. How possible is that, exactly? Has anybody done it with any success? Alternatively, is there any alternative Haskell compiler (I guess that would be NHC?) that works for this architecture? And does GHC or anybody else support 64bit address spaces? -kzm -- If I haven't seen further, it is by standing in the footprints of giants ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
fix missing from 5.04.3 ???
Previous 5.04 releases had an exception handler missing from connectTo that results in a socket leaking if socketToHandle fails for some reason (I cant remember the exact circumstances at the moment, but it causes a server to die - I think the leak is caused when the client closes the connection during the handshake - ie somebody presses stop on a web browser because of a slow connection after the handshake has just started) - I suggested a fix along the lines of: connectTo hostname (Service serv) = do proto - getProtocolNumber tcp port - getServicePortNumber serv he - getHostByName hostname sock - socket AF_INET Stream proto (do connect sock (SockAddrInet port (hostAddress he)) socketToHandle sock ReadWriteMode) `Control.Exception.catch` (\e - do sClose sock; throw e) This seems to be missing from 5.04.3 - this fix is important for reliability in a production server, what happened - does this cause problems in other places? Regards, Keean Schupke. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: ANNOUNCE: GHC vesrion 5.04.3 released
I notice the release notes say a few architectures should be possible to port to, in particular AIX/POWER. How possible is that, exactly? Has anybody done it with any success? Alternatively, is there any alternative Haskell compiler (I guess that would be NHC?) that works for this architecture? And does GHC or anybody else support 64bit address spaces? GHC worked on Alpha recently (5.02.x), so our 64 bit support should be up to scratch. Check the porting section of the GHC building guide for information on porting: the bottom line is that there are various levels of porting, from a basic unregisterised port up to a full port with GHCi and a native code generator. http://www.haskell.org/ghc/docs/latest/html/building/sec-porting-ghc.htm l Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: ANNOUNCE: GHC vesrion 5.04.3 released
[EMAIL PROTECTED] (Ketil Z. Malde) writes: I notice the release notes say a few architectures should be possible to port to, in particular AIX/POWER. How possible is that, exactly? Has anybody done it with any success? Alternatively, is there any alternative Haskell compiler (I guess that would be NHC?) that works for this architecture? We fixed some small configuration issues with building nhc98 on a POWER3/AIX machine in Feb 2001. I have no reason to think that anything has broken since then. The Power architecture is somewhat similar to the PowerPC architecture as used on the Mac, for which GHC does have support. And does GHC or anybody else support 64bit address spaces? nhc98 definitely does not, and it would be a significant amount of work to make it possible. Regards, Malcolm ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Stricness of floor etc
Hi all, Looking at ghc --show-iface .../ghc/lib/ghc-5.05/imports/base/GHC/Float.hi I see floor1 :: forall b. (GHC.Real.Integral b) = Double - b __S L properFraction2 :: forall b. (GHC.Real.Integral b) = Double - (b, Double) __S L decodeFloat2 :: Double __S U(L)m My understanding of this is that floor and properFraction of Doubles have a lazy argument while decodeFloat has a strict constructor of lazy values. It's not clear to me why the U(L) strictness isn't inherited by properFraction and then float, nor do I understand why decodeFloat is not strict in its argument when it seems to be working exclusively with unboxed values. Unfortunately decodeDouble# in PrimopWrappers.hi doesn't seem to have a strictness description so I can't see what's going on there. So I guess what I'm asking is are these strictnesses the best that can be inferred or could GHC do better? Of course a strict floor (Double to Int and Integer) is what I'm really hoping for (without having to specify it explicitly with $! in my code). Incidentally, what are 'm's in the strictness descriptions? Thanks Ian ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
HTk for ghc5.04.3
I have created binary bundles for HTk, our Haskell interface to Tcl/Tk, for ghc5.04.3 on Linux/x86 and Windows, and put them on the download page: http://www.informatik.uni-bremen.de/htk/download/INSTALL.BINARY.html I will add FreeBSD and Solaris bundles when I can get hold of ghc5.04.3 on those platforms. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Network/Notwork?
Happy with my Winsock work-arounds for my small client-/server-test, I decided to try integrating the Network use into my target project, and got nothing but trouble. Again, things that work happily under Unix simply fail under windows. My best guess at the moment is that the socketToHandle conversion used within accept and connectTo simply doesn't work as advertised, under windows (at least, handle-based operations such as hGetLine or hClose on the handles returned by accept/connectTo results in errors, whereas avoiding the socketToHandle conversion and using Network.Socket.send and Network.Socket.recv yields some improvements..). A little more digging in mail-archives brings up the following rather discouraging thread/message: Socket library ghc 5.02.1 http://www.haskell.org/pipermail/glasgow-haskell-users/2001-November/002673.html in which Sigbjorn summarizes: FYI, in case you're planning on doing socket programming with GHC-5.02 on a Win32 platform, stay away from using the higher-level Socket module, since its IO.Handle based view of sockets is just broken. Stick with the lower-level SocketPrim interface instead. Is it just me doing something stupid, or is this problem still pertinent, for the higher-level Network module in GHC-5.04? If the latter, could this please be flagged in the GHC documentation, so that people don't have to rediscover the problem by painful debugging? (if the former, any suggestions on what I should try instead?) Is anyone else here using GHC's Network module under Windows? Claus FPI: foreign problem interface ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: Problem with hierarchical libraries.
IIRC, something very similar was suggested a while back on the libraries list, except that the form beginning with a dot was the relative module name (actually I think I prefer it that way). this seems exactly the opposite of what all file systems do. i know lateral thinking is great, but why do we have to be backwards all the time? Because it seems strange to have to add the prefix dot to all of our existing imports ('import Prelude' becomes 'import .Prelude'). Besides, I like the idea that the prefix dot is an indication that the current module name has been omitted. Personally, I've been using the hierarchical module names for a while and I really don't mind writing out the whole name each time. It means you have less context to think about when reading the source. oh come on :-) most of the time you don't get to see the module name at all -- you have to keep scrolling to the top of the file. virtually every editor can tell you what is the name of the file you are editing... (:f in vim). and tools like haddoc can display the name of the module anyways. I think you misunderstand me - my point was that currently, an import declaration means the same regardless of what the current module name is. With relative imports, that's not true any more (but you're right that the editor usually helps by showing the filename). It's a minor point I grant you, but simplicity at the expense of a bit of extra typing is sometimes a good thing. This arises because the meaning of a module is defined independently of the mapping between modules and filenames. the meaning of modules can still be independent of the mapping between modules and filesnames. all that has to be specified is how to compute this mapping. And that's exactly what we don't want to do (IMO). Filesystems are too different - what about filesystems that don't have directories? What if I want to store my source code in a database or on the web? What about non-case-sensitive filesystems, or ones with restrictions on the length of filenames? and one has to do that anyways, even if the haskell report pretends that this can be ommited. Yes, but the point is that it is done by the compiler, not the language specification, so compilers are free to implement different policies, and the spec doesn't have to acquire any platform-specific warts. The mapping between filenames and module names in GHC is rather complicated, see recent discussions on [EMAIL PROTECTED] The mapping in Hugs is different - more liberal in some ways, but less complicated because of the lack of interface files. [snip] in fact if one decides to ignore this mapping, all that the hirarchical modules proposal does is allow one to write . in a module name. Bingo :-) Cheers, Simon ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
recursive modules in Haskell
Hi all! I've just got one of the rare chances to do a somewhat bigger piece of software development in Haskell. After having set up a design (with much use of multi-parameter-classes) I was very excited. However, to extent that implementation proceeded I had to recognize many unforeseen implementation dependencies between instance. A standard situation is: file A.hs: instance Foo A f :: -- implementation requires A and B to be an instance of Foo file B.hs: instance Foo B f :: -- implementation requires A and B to be an instance of Foo The mutual dependencies increase if one uses class constraints to enforce semantic wellformedness, that is if one writes given Bar A = class Foo A whenever this makes sense from the view of the application logic - as I did. No Problem at all for Haskell, but a problem for certain often-used Haskell compilers and interpreters... Factoring out the common part does not work in examples like above, so the only way is to collapse everything, and to reduce class constraints as much as is possible - something which hurts deep inside! That the problems appear step-by-step in the course of implementation or even debugging, adds to the pain. So I have put onto my personal Haskell whish-list that certain compilers and interpreters shall either ultimately converged against the language they intend to support, or else provide some suitable alternative. Thinking in the first direction, a precompiler appears before my inner eye which is able to collapse mutually dependent modules into one bigger module. Even if this led to incorrect line numbers in error messages and the like, I would definitely use such a precompiler. A step in the second direction was a slight modification of Haskell such that instance declaration and instance implementation can be provided in separate modules. Elke. -- Elke Kasimir EsPresto AG - - Software Development-Breite Str. 30-31 Tel/Fax: +49-30-90 226-750/-760 10178 Berlin/Germany ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: recursive modules in Haskell
hi, Elke Kasimir wrote: No Problem at all for Haskell, but a problem for certain often-used Haskell compilers and interpreters... Factoring out the common part does not work in examples like above, so the only way is to collapse everything, and to reduce class constraints as much as is possible - something which hurts deep inside! That the problems appear step-by-step in the course of implementation or even debugging, adds to the pain. So I have put onto my personal Haskell whish-list that certain compilers and interpreters shall either ultimately converged against the language they intend to support, or else provide some suitable alternative. Thinking in the first direction, a precompiler appears before my inner eye which is able to collapse mutually dependent modules into one bigger module. Even if this led to incorrect line numbers in error messages and the like, I would definitely use such a precompiler. A step in the second direction was a slight modification of Haskell such that instance declaration and instance implementation can be provided in separate modules. there is no need to use such hacks. it is not dificult to add suport for mutually recursive modules to an implementation directly. unfortunatley none of the working haskell implementations support recursive modules, i guess they are probably not considered important enough. and the haskell report does not say how they should work (ergh why?), but if you are interested you can take a look at A formal specification for the Haskel 98 module system a paper we wrote to remedy this situation. in the mean time you can work around the problem in GHC, by using the hi-boot files take a look at the documentation How to compile mutually recursive modules. bye iavor -- == | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki | == ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
How to search for a string sequence in a file a rewrite it???
OK Guys. First I would like to say thanks for all the help given before. As I said I am still learning Haskell. My problem is the following: I have a text file and somewhere in the file there is string (Let's say ). So I need to find this exact string and overwrite with another string (Lets say ). I have thought a bit and couldn't find any solution, and I believe it is a piece of cake for some of you. Is there a method already implemented in haskell to do that?? Anyway thanks in advance. Best Regards NooK - Original Message - From: Arthur Baars [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Norman Ramsey [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 1:06 AM Subject: Re: clueless GHCI user wishes to load QuickCheck QuickCheck is in de util package. You can load a package with the -package flag: $ ghci -package util Prelude :browse QuickCheck class Arbitrary a where { arbitrary :: Gen a; coarbitrary :: forall b. a - Gen b - Gen b; } arbitrary :: forall a. (Arbitrary a) = Gen a ... Prelude:module QuickCheck Prelude QuickCheck :info trivial -- trivial is a variable trivial :: forall a. (Testable a) = Bool - a - Property Hope this helps. Cheers, Arthur On Tuesday, March 11, 2003, at 07:02 PM, Norman Ramsey wrote: Can anyone help me figure out how to load QuickCheck into GHCI? QuickCheck is included in my Debian package, but my attempts at loading it are bootless: Prelude :load QuickCheck can't find module `QuickCheck' Prelude :load util/QuickCheck can't find module `util/QuickCheck' Prelude :info syntax: `:i thing-you-want-info-about' Prelude :load util/QuickCheck.hi can't find module `util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck' Prelude Any advice, anyone? Norman ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: How to search for a string sequence in a file a rewrite it???
This is how I would do it: recurse down the input string. use isPrefixOf to check is the string youw ant to replace is at the head of the string. if it is, 'drop' the appropriate number of characters and stick the replacement string on the front. then recurse. this should be about 3 lines of code. -- Hal Daume III | [EMAIL PROTECTED] Arrest this man, he talks in maths. | www.isi.edu/~hdaume On Thu, 13 Mar 2003, Alexandre Weffort Thenorio wrote: OK Guys. First I would like to say thanks for all the help given before. As I said I am still learning Haskell. My problem is the following: I have a text file and somewhere in the file there is string (Let's say ). So I need to find this exact string and overwrite with another string (Lets say ). I have thought a bit and couldn't find any solution, and I believe it is a piece of cake for some of you. Is there a method already implemented in haskell to do that?? Anyway thanks in advance. Best Regards NooK - Original Message - From: Arthur Baars [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Norman Ramsey [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 1:06 AM Subject: Re: clueless GHCI user wishes to load QuickCheck QuickCheck is in de util package. You can load a package with the -package flag: $ ghci -package util Prelude :browse QuickCheck class Arbitrary a where { arbitrary :: Gen a; coarbitrary :: forall b. a - Gen b - Gen b; } arbitrary :: forall a. (Arbitrary a) = Gen a ... Prelude:module QuickCheck Prelude QuickCheck :info trivial -- trivial is a variable trivial :: forall a. (Testable a) = Bool - a - Property Hope this helps. Cheers, Arthur On Tuesday, March 11, 2003, at 07:02 PM, Norman Ramsey wrote: Can anyone help me figure out how to load QuickCheck into GHCI? QuickCheck is included in my Debian package, but my attempts at loading it are bootless: Prelude :load QuickCheck can't find module `QuickCheck' Prelude :load util/QuickCheck can't find module `util/QuickCheck' Prelude :info syntax: `:i thing-you-want-info-about' Prelude :load util/QuickCheck.hi can't find module `util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck' Prelude Any advice, anyone? Norman ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: How to search for a string sequence in a file a rewrite it???
Well the problem is that the string I want to replace will usually be in the middle of a line in the text file and then is PrefixOf of no use?? Any other suggestion?? Like the text file will be similar to abcdedjkfhlafl sajkhlasf akfhjklafjkhfk sdfasfsaasffaa So I want to replace this in the middle there with . I could run lines on the file but from there i have no idea. I have got an idea but for it to work I need to know if there is a function that I can replace a certain Char in a string by another Char by knowing the index of this char?? Best Regards NooK - Original Message - From: Hal Daume III [EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:05 AM Subject: Re: How to search for a string sequence in a file a rewrite it??? This is how I would do it: recurse down the input string. use isPrefixOf to check is the string youw ant to replace is at the head of the string. if it is, 'drop' the appropriate number of characters and stick the replacement string on the front. then recurse. this should be about 3 lines of code. -- Hal Daume III | [EMAIL PROTECTED] Arrest this man, he talks in maths. | www.isi.edu/~hdaume On Thu, 13 Mar 2003, Alexandre Weffort Thenorio wrote: OK Guys. First I would like to say thanks for all the help given before. As I said I am still learning Haskell. My problem is the following: I have a text file and somewhere in the file there is string (Let's say ). So I need to find this exact string and overwrite with another string (Lets say ). I have thought a bit and couldn't find any solution, and I believe it is a piece of cake for some of you. Is there a method already implemented in haskell to do that?? Anyway thanks in advance. Best Regards NooK - Original Message - From: Arthur Baars [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Norman Ramsey [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 1:06 AM Subject: Re: clueless GHCI user wishes to load QuickCheck QuickCheck is in de util package. You can load a package with the -package flag: $ ghci -package util Prelude :browse QuickCheck class Arbitrary a where { arbitrary :: Gen a; coarbitrary :: forall b. a - Gen b - Gen b; } arbitrary :: forall a. (Arbitrary a) = Gen a ... Prelude:module QuickCheck Prelude QuickCheck :info trivial -- trivial is a variable trivial :: forall a. (Testable a) = Bool - a - Property Hope this helps. Cheers, Arthur On Tuesday, March 11, 2003, at 07:02 PM, Norman Ramsey wrote: Can anyone help me figure out how to load QuickCheck into GHCI? QuickCheck is included in my Debian package, but my attempts at loading it are bootless: Prelude :load QuickCheck can't find module `QuickCheck' Prelude :load util/QuickCheck can't find module `util/QuickCheck' Prelude :info syntax: `:i thing-you-want-info-about' Prelude :load util/QuickCheck.hi can't find module `util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck' Prelude Any advice, anyone? Norman ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: How to search for a string sequence in a file a rewrite it???
Right. *Recurse* down the list. Somethign like: foo orig_str new_str xl@(x:xs) | orig_str `isPrefixOf` xl = something | otherwise= x : something -- Hal Daume III | [EMAIL PROTECTED] Arrest this man, he talks in maths. | www.isi.edu/~hdaume On Thu, 13 Mar 2003, Alexandre Weffort Thenorio wrote: Well the problem is that the string I want to replace will usually be in the middle of a line in the text file and then is PrefixOf of no use?? Any other suggestion?? Like the text file will be similar to abcdedjkfhlafl sajkhlasf akfhjklafjkhfk sdfasfsaasffaa So I want to replace this in the middle there with . I could run lines on the file but from there i have no idea. I have got an idea but for it to work I need to know if there is a function that I can replace a certain Char in a string by another Char by knowing the index of this char?? Best Regards NooK - Original Message - From: Hal Daume III [EMAIL PROTECTED] To: Alexandre Weffort Thenorio [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:05 AM Subject: Re: How to search for a string sequence in a file a rewrite it??? This is how I would do it: recurse down the input string. use isPrefixOf to check is the string youw ant to replace is at the head of the string. if it is, 'drop' the appropriate number of characters and stick the replacement string on the front. then recurse. this should be about 3 lines of code. -- Hal Daume III | [EMAIL PROTECTED] Arrest this man, he talks in maths. | www.isi.edu/~hdaume On Thu, 13 Mar 2003, Alexandre Weffort Thenorio wrote: OK Guys. First I would like to say thanks for all the help given before. As I said I am still learning Haskell. My problem is the following: I have a text file and somewhere in the file there is string (Let's say ). So I need to find this exact string and overwrite with another string (Lets say ). I have thought a bit and couldn't find any solution, and I believe it is a piece of cake for some of you. Is there a method already implemented in haskell to do that?? Anyway thanks in advance. Best Regards NooK - Original Message - From: Arthur Baars [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Norman Ramsey [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 1:06 AM Subject: Re: clueless GHCI user wishes to load QuickCheck QuickCheck is in de util package. You can load a package with the -package flag: $ ghci -package util Prelude :browse QuickCheck class Arbitrary a where { arbitrary :: Gen a; coarbitrary :: forall b. a - Gen b - Gen b; } arbitrary :: forall a. (Arbitrary a) = Gen a ... Prelude:module QuickCheck Prelude QuickCheck :info trivial -- trivial is a variable trivial :: forall a. (Testable a) = Bool - a - Property Hope this helps. Cheers, Arthur On Tuesday, March 11, 2003, at 07:02 PM, Norman Ramsey wrote: Can anyone help me figure out how to load QuickCheck into GHCI? QuickCheck is included in my Debian package, but my attempts at loading it are bootless: Prelude :load QuickCheck can't find module `QuickCheck' Prelude :load util/QuickCheck can't find module `util/QuickCheck' Prelude :info syntax: `:i thing-you-want-info-about' Prelude :load util/QuickCheck.hi can't find module `util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck.hi' Prelude :load /usr/lib/ghc-5.02.2/imports/util/QuickCheck can't find module `/usr/lib/ghc-5.02.2/imports/util/QuickCheck' Prelude Any advice, anyone? Norman ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
ANNOUNCE: hugs98.NET March 2003 snapshot
A new version of Hugs98.NET is now available, sporting the following: * A version of the popular Haskell interpreter, Hugs98 (http://haskell.org/hugs), targetted at the Microsoft .NET platform. * .NET interop integrated via the Haskell FFI. * Support for wrapping up Haskell functions as .NET classes / delegators, providing any .NET language with the ability to call and use Haskell. The distribution comes with documentation and examples demonstrating how to access and interact with .NET -- all available via the Hugs98.NET homepage: http://galois.com/~sof/hugs98.net/ Feedback, contributions, suggestions for improvements, bug reports etc. are most welcome -- please e-mail these to the author: [EMAIL PROTECTED] --- The Hugs 98 system is Copyright (c) Mark P Jones, Alastair Reid, the Yale Haskell Group, and the Oregon Graduate Institute of Science and Technology, 1994-2001, All rights reserved. It is distributed as free software under the license in the file License, which is included in the distribution. The .NET extension is Copyright (c) Sigbjorn Finne, 2002-2003, All rights reserved. It is distributed as free software under the license in the file License.net, which is included in the distribution. --- ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Explicit function call
Hello, How can I make an explicit function call in a do sequence? Ex: ... do let a = myFunc ... b = myFunc ... c = Something else return c ... As I understand myFunc will not be executed, but I need it... Please, help. -- Pavel Zhbanov ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Explicit function call
[EMAIL PROTECTED] (Pavel G. Zhbanov) wrote: If it doesn't have a side effect, why do it anyway? The result 'c' does not depend on a. myFunc uses IORef and it's (IORef's) result I use afterwards in some other functions. OK: what is myFunc's type? If it ends in IO alpha, for some alpha, you can say: do a - myFunc ... etc. If it doesn't, then you should probably re-think its definition. Jon Cast ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Explicit function call
Pavel G. Zhbanov wrote: If it doesn't have a side effect, why do it anyway? The result 'c' does not depend on a. myFunc uses IORef and it's (IORef's) result I use afterwards in some other functions. OK: what is myFunc's type? If it ends in IO alpha, for some alpha, you can say: do a - myFunc ... etc. If it doesn't, then you should probably re-think its definition. myFunc :: a - [b] (a and b are my own types) Actually, inside myFunc I used unsafePerformIO (didn't want to change the whole programm just because of one function). The purpose of myFunc is to append some value to some list lying somewhere (somewhere is defined by IORef), store the resulting list and return a copy. There's a reason why the name unsafePerformIO begins with unsafe. It is *not* a magic wand that can simply get rid of the IO whenever it turns out to be inconvenient. You need to change myFunc's type to: myFunc :: a - IO [b] then use: do a - myFunc ... -- Glynn Clements [EMAIL PROTECTED] ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe