Re: ANNOUNCE: GHC 7.4.1 Release Candidate 2
What are the plans for http://hackage.haskell.org/trac/ghc/ticket/5623 which seems to be still open? Quoting form the ticket ... Just to spam a little more, it seems that the HEAD happily duplicates all computations on unboxed types. It even duplicates x+x in this example: foo :: Float - Float foo x = let y = x+x in y+yI haven't tested but this looks bad for performance critical code. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] network 2.3.05 on windows 7 with ghc-7.2.1
Sai Hemanth K saihema...@gmail.com schrieb im Newsbeitrag news:canok7kum7-g5bwhj6btrraruykyl1xyltfr9rd4ke5sovbi...@mail.gmail.com... Hi, Apologies if this is an off-topic for the list, If someone here managed to build network 2.3.05 on windows 7 with ghc-7.2.1 , could you kindly pass me the trick? The config step fails with missing header. I tried running it with mingw (tried with the latest one too - just in case : http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/) I did not face any issue for the same thing on linux. Many thanks, Hemanth K I have done exactly this with the same versions. No problems. I used the MINGW that comes with ghc-7.2.1. I probably executed the configure under MSYS though, which probably makes the difference. Rene.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHCI Feature Request: Last SuccessfulCompilation State Saved
Daniel Fischer daniel.is.fisc...@googlemail.com schrieb im Newsbeitrag news:201108272331.01371.daniel.is.fisc...@googlemail.com... On Saturday 27 August 2011, 23:10:17, David Virebayre wrote: 2011/8/27 aditya siram aditya.si...@gmail.com: Hi all, I would like for the GHCI interpreter to save its environment before reloading a file and allowed the user to revert back to that state if the compilation was unsuccessful. That would be awesome. I would like this too. http://hackage.haskell.org/trac/ghc/ticket/1896 +1 from me too. How do I go about registering my interest in the ticket? I though there was a way of adding myself on the CC: of the ticket? How does one do this? Does one need some sort of user? Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: ANNOUNCE: GHC 7.2.1 Release Candidate 1
Ian Lynagh ig...@earth.li schrieb im Newsbeitrag news:20110729182136.ga2...@matrix.chaos.earth.li... We are pleased to announce the first release candidate for GHC 7.2.1: Is it normal for the windows build to have 99 unexpected failures? http://darcs.haskell.org/ghcBuilder/builders/simonmar-win32-stable/289.html Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell] Windows installer 7.02. HTML docu index.html needs fixing.
Hello Ian, Index.html in the windows installer needs fixing up as well. In currently contains the haddock help find instead of the master contents with the usual entries (GHC user guide, libraries, ghc api etc). It was also a bit cleaner in ghc 6.12.3 with the separate users_guide directory. Rene. ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
ghc 6.12.3: Data.Array.Diff and package diffarray
Hello, According to the release notes there is a new package that now contains the module Data.Array.Diff. According to Ian's commit this package is called diffarray. This package does not seem to be available on Hackage. Could someone upload it? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Re: Re: hxt memory useage
Uwe Schmidt [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] this statement isn't true in general. HXT itself can be incremental, if there is no need for traversing the whole XML tree. When processing a document containing a DTD, indeed there is a need even when no validation is required, for traversal because of the entity substitution. It would be nice if HXT was incremental even when you are processing the whole tree. If I remember correctly, the data type of the tree in HXT is something like data Tree = Tree NodeData [Tree] which means that already processed parts of the tree can't be garbage collected because the parent node is holding onto them. If instead it was data Tree = Tree NodeData (IORef [Tree]) Would could remove each subtree as it was processed (well just before would probably be necessary, and we would need to rely on blackholing to remove the reference on the stack). This would perhaps allow already processed subtree to be garbage collected. Together with the lazy evaluation this could lead to quite good memory usage. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: hxt memory useage
Matthew Pocock [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] On Thursday 24 January 2008, Albert Y. C. Lai wrote: Matthew Pocock wrote: I've been using hxt to process xml files. Now that my files are getting a bit bigger (30m) I'm finding that hxt uses inordinate amounts of memory. I have 8g on my box, and it's running out. As far as I can tell, this memory is getting used up while parsing the text, rather than in any down-stream processing by xpickle. Is this a known issue? Yes, hxt calls parsec, which is not incremental. haxml offers the choice of non-incremental parsers and incremental parsers. The incremental parsers offer finer control (and therefore also require finer control). I've got a load of code using xpickle, which taken together are quite an investment in hxt. Moving to haxml may not be very practical, as I'll have to find some eqivalent of xpickle for haxml and port thousands of lines of code over. Is there likely to be a low-cost solution to convincing hxt to be incremental that would get me out of this mess? Matthew I don't think so. Even if you replace parsec, HXT is itself not incremental. (It stores the whole XML document in memory as a tree, and the tree is not memory effecient. Still I am a bit surprised that you can't parse 30m with 8 gig memory. This was discussed here before, and I think someone benchmarked HXT as using roughly 50 bytes of memory per 1 byte of input. i.e. HXT would then be using about 1.5 gig of memory for your 30m file. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: XML parser recommendation?
Uwe Schmidt [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] it into HXT. This still does not solve the processing of very very large XML document. I doubt, whether we can do this with a DOM like approach, as in HXT or HaXml. Lazy input does not solve all problems. A SAX like parser could be a more useful choice for very large documents. Uwe I think a step towards support medium size documents in HXT would be to store the tags and content more efficiently. If I undertand the coding correctly every tag is stored as a seperate Haskell string. As each byte of a string under GHC takes 12 bytes this alone leads to high memory usage. Tags tend to repeat. You could store them uniquely using a hash table. Content could be stored in compressed byte strings. As I mentioned in an earlier post 2GB memory is not enough to process a 35MB XML document in HXT as we have 30 x 2 x 12 = 720 MB for starters to just store the string data (once in the parser and once in the DOM). (Well a machine with 2GB memory). I guess I had somewhere around 1GB free for the program. Other overheads most likely used up the ramaining 300 MB. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: XML parser recommendation?
Yitzchak Gale [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Henning Thielemann wrote: HXT uses Parsec, which is strict. I had a look at using HXT awhile ago. Parsec is the least of the problems. HXT stores the XML as an explicit tree in memory, where the head has explict references to the children. This means that the whole XML tree is stored in memory until the last child is processed. Also this tree is stored ineffeciently. Everything as non shared Haskell strings. My experience is that a 30MB file (which is quite small for an XML file) can NOT be processed with 2GB memory. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Code from Why Functional Programming Matters
Andrew Wagner [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] current position (or, even more ideally, the so-called principal variation, which is the best series of moves from the current position). Is there a good way to collect this, without mapping some sort of function over the tree that puts a list of moves on every node too? Hughes seems to completely ignore this, and I wonder if it's because it gets ugly to implement. While Hughes code looks nice, the more efficient you make your search the uglier it is going to be (at least with my Haskell skills) In reality you will at least want iterative deepening and principle variation search. I posted code for PVS (ugly code) http://www.haskell.org/haskellwiki/Principal_variation_search I thought I had some code doing iterative deepening based on this, but it looks like I lost it somewhere. If you want to use hash tables, history, killer moves, etc. Then I think you are going to have to monadize everything. It is a pity that Hughes doesn't demonstrate adding some of these things. Maybe it is possible using arrows? (without making everything look like C, which would be my solution). Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell] ghc as a library and profiling
Simon Marlow [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Yes, by default we don't build or supply the GHC package with profiling, because of the extra bloat it would add to the downloads and the time taken to build it. Why is a program so large when I use the GHC module? Under windows with GHC 6.6.1 I get a 17MB executable, whereas the ghc executable itself is only around 7MB. Surely the GHC as a library shouldn't make the executable larger as GHC itself?? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Re: quoting in Haskell
Peter Verswyvelen [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] In Scheme, on can quote code, so that it becomes data. Microsoft's F# and C# 3.0 also have something similar that turns code into expression trees. The latter is used extensively in LINQ which translates plain C# code into SQL code or any other code at runtime (this idea came from FP I heared) The normal way of doing such things in Haskell is to have 1) functions that generate the component data structures (these functions are often called smart constructors) 2) other functions to put the functions/data structures together (these other functions are often call combinators). The resulting data structure that represents the sql query for example is then processed to produce the real (textual) sql query which this then sent to the database. I can't find something similar for Haskell? Maybe I am looking at the wrong places? HaskellDB for example does this for database queries. Parsec does this parsers. HSXML (if I got the name right) does this for XML. In Haskell, I know one can use a data constructor as a function (as in (map Just [1..3])), but a function cannot be turned into a data constructor (= quoting), can it? A data constructor is a special case of a function, or perhaps better said, a particular way a function is defined. Either a function is a data constructor or it isn't. For example you can also do just = Just Just is a data constuctor. It was defined with a data statement (and as a result starts with a capital letter). data Maybe a = Nothing | Just a just is not a data constructor. Why? It wasn't defined with a data statement. However just and Just behave almost identically. (you can't pattern match on just, only on Just) Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell] Re: View patterns in GHC: Request for feedback
Claus Reinke [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] though I'm extremely dubious about the utility of the Maybe patterns. actually, they are the main thing that interests me about view patterns!-) type Typ unit :: Typ - Maybe () arrow :: Type - Maybe (Typ,Typ) size :: Typ - Integer size (unit - ()) = 1 size (arrow - (t1,t2)) = size t1 + size t2 closer to ordinary patterns, with the lowercase and the '-' hinting that there is computation before matching (well, '=', according to the new proposal). claus Though I guess you would not object to: size (unit - Just ()) = 1 size (arrow - Just (t1,t2)) = size t1 + size t2 ? Rene. ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
[Haskell-cafe] Re: [Haskell] View patterns in GHC: Request forfeedback
Simon PJ and I are implementing view patterns, a way of pattern matching against abstract datatypes, in GHC. Our design is described here: http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns If you have any comments or suggestions about this design, we'd love to hear them. You can respond to this list (and we can take it to haskell-cafe if the thread gets long) or, if you prefer, directly to me. I find the = operator excessive. GHC Haskell seems to be growing too rapidly syntax wise in my opinion. The important features of code are correctness, maintainability and readibility (IMHO), and I think = is working against these. = uses up more syntax. Buys very little. Equivalent to - Just _ or - Just x as far as I can see. I would prefer to type the extra 6 characters rather than having the hidden Maybe. It is also one more thing to learn. One more confusing type error when you mix them up. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Feature request/help: evaluating template haskell at runtime
Hello, I am attempting some genetic programming in Haskell. Rather than defining my own data type for programs and writing my own interpreter, I want to use the template haskell expression data types and evaluate them with the rts's byte code interpreter. This gives me a nice fast interpreter that provides the statistics that I want. I could pretty print the template haskell and then execute the result string using the GHC module or hs-plugins, but I would like to save the pretty printing and parsing as normally the program generation time is important by GP. I have being looking at module TcSplice. I see that I need to run the TH expression through function convertToHsExpr, but after that I am stuck. This produces LHsExpr RdrName and I need to get CoreSyn.CoreExpr. What functions to use? dsLExpr :: LHsExpr Id - DsM CoreSyn.CoreExpr seems one important step, but I haven't figured out how to get from LHtsExpr RdrName to LHsExpr Id. It would be nice to have standard GHC functionality to have the ability to compile and evaluate template haskell at runtime using the GHC library. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Re: Mathematica
How difficult would it be to implement Mathematica in Haskell? Why don't you use axiom? It already has several 100 of years man effort put into it. Or for dynamically type package you could use Maxima. Both are free. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Release plans: esc branch
What are the plans for the esc branch? Are the changing going to be merged? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Release plans
I vote for 6.8. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Re: HS-Plugins 1.0 chokes on simple test, WinXP GHC-6.6
Alistair Bayley [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Is this using the darcs repository version of hs-plugins? That's the only versions that works with 6.6 Just got, built, and installed the repo version, and it has the same problem. Alistair You managed to build the darcs version under ghc 6.6? For me runghc setup.hs configure fails with lots of strange error messages... (below) other packages build ok. Rene. C:\repos\hs-pluginsdarcs pull plink: unknown option -O Pulling from http://www.cse.unsw.edu.au/~dons/code/hs-plugins;... No remote changes to pull in! C:\repos\hs-pluginsrunghc Setup.lhs configure Setup.lhs: Warning: The field hs-source-dir is deprecated, please use hs-sourc e-dirs. Configuring plugins-1.0... configure: c:\ghc\ghc-6.6\bin\ghc-pkg.exe configure: Dependency base-any: using base-2.0 configure: Dependency Cabal-any: using Cabal-1.1.6 configure: Dependency haskell-src-any: using haskell-src-1.0 configure: Using install prefix: C:\Programme configure: Binaries installed in: C:\Programme\Haskell\bin configure: Libraries installed in: C:\Programme\Haskell\plugins-1.0\ghc-6.6 configure: Private binaries installed in: C:\Programme\plugins-1.0 configure: Data files installed in: C:\Programme\Gemeinsame Dateien\plugins-1.0 configure: Using compiler: c:\ghc\ghc-6.6\bin\ghc.exe configure: Compiler flavor: GHC configure: Compiler version: 6.6 configure: Using package tool: c:\ghc\ghc-6.6\bin\ghc-pkg.exe configure: Using ar found on system at: c:\ghc\ghc-6.6\bin\ar.exe configure: Using haddock found on system at: c:\other\bin\haddock.exe configure: No pfesetup found configure: Using ranlib found on system at: C:\other\MinGW\bin\ranlib.exe configure: Using runghc found on system at: c:\ghc\ghc-6.6\bin\runghc.exe configure: No runhugs found configure: Using happy: c:\other\bin\happy.exe configure: Using alex: c:\other\bin\alex.exe configure: Using hsc2hs: c:\ghc\ghc-6.6\bin\hsc2hs.exe configure: No c2hs found configure: No cpphs found configure: No greencard found Can't delete: '-f conf5164.sh' (error: -1) Can't delete: '-f conf5164 conf5164.exe conf5164.file' (error: -1) Can't delete: '-f conf5164 conf5164.exe conf5164.file' (error: -1) Can't open: Can't open: Can't open: Can't delete: '-rf conftest* confdefs.h' (error: -1) Can't open: Can't open: Can't open: Can't open: Can't open: checking build system type... i686-pc-mingw32 Can't open: Can't open: Can't open: checking for ghc... ghc Can't open: checking for value of __GLASGOW_HASKELL__... 606 checking for ghc library directory... c:/ghc/ghc-6.6 Can't open: checking for tex... no configure: WARNING: tex is needed to build some of the documentation checking for tex2page... no configure: WARNING: tex2page is needed to build some of the documentation http://www.ccs.neu.edu/home/dorai/tex2page/tex2page-doc.html checking for gcc... gcc Can't open: Can't open: checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. Can't open: Can't open: Can't open: Can't delete: '-f core *.core' (error: -1) C:\repos\hs-plugins ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell] Dynamic database updated by list using existential types
The following code took me several hours to work out. I post it here, so perhaps other can avoid the difficulties of working out how to use existential types. Improvements welcome. If anyone thinks it is worth it I could add it to the wiki under existential types (I didn't find the examples there very helpful). Hopefully my newreader won't destroy the layout. Rene. {-# OPTIONS -fglasgow-exts #-} module Record where -- Demo of an extensible updatable database using Data.Dynamic and Data.Map -- which can be updated by a list of updates which are implemented -- using existential types. import Control.Concurrent.MVar import qualified Data.Map as M import Data.Dynamic type Tables = M.Map Int Dynamic -- the dynamic database -- look up a table in the database based on it's type class Typeable a = GetType a where getValue :: Tables - MVar a getValue tables = case M.lookup index tables of Just d - case fromDynamic d of Just e - e _ - error $ Table with index ++ show index ++ not in database. where index = tabIndex (undefined::a) tabIndex :: a - Int -- Manually create indexes for each table. This could be probably done automatically -- using Oleg's type to integer code. instance GetType IntColl where tabIndex _ = 1 instance GetType CatString where tabIndex _ = 2 -- Define the update function for the table class (GetType m) = Table m where apply :: (m -m) - Tables - IO () apply f tables = modifyMVar_ table (\v - return $! f v) where table :: MVar m table = getValue tables -- Existential type to allow updates to various tables data SRec = forall m. Table m = SRec (m - m) update_db tables (SRec f) = apply f tables -- helper function -- Define how the update is done to each table class Mod_def r m | r - m where apply_record :: r - m - m -- Define a type for each table data IntColl = IntColl Int deriving (Typeable, Show) data CatString = CatString String deriving (Typeable, Show) instance Mod_def Int IntColl where apply_record i (IntColl j) = IntColl (i + j) instance Mod_def String CatString where apply_record i (CatString j) = CatString (i ++ j) -- Register the tables instance Table IntColl instance Table CatString -- Create an update record updater :: forall r m. (Table m, Mod_def r m) = r - SRec updater rec = SRec ((\db - apply_record rec db) :: (m - m)) -- Some simple tests to get the typing right newDB :: (GetType a) = a - IO Tables newDB x = do var - newMVar x return $! M.singleton (tabIndex x) $ toDyn var test2 :: SRec - IO () test2 f = newDB (IntColl 3) = (\ db - update_db db f) test3 = test2 (updater (1::Int)) newTable :: (Typeable (MVar a), GetType a) = a - IO (Int, Dynamic) newTable x = do mv - newMVar x return (tabIndex x, toDyn mv) test4 = do initial_db - sequence [newTable $ IntColl 5, newTable $ CatString again] let db = M.fromList initial_db mapM (update_db db) [updater (1::Int), updater hello] content - readMVar (getValue db :: MVar IntColl) print content ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell] Views in Haskell
In my opinion, views are going to make more Haskell more complicated, and from what I have seen so far, for little gain. Maybe a poll should be made to see what features the average Haskeller feels the most in need of. Or what their greatest problems are. Going by the traffic over the previous months, I think that class aliases or extensible records would be higher on most peoples lists than views. Rene. ___ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime
Re: [Haskell] GHC Error question
There may be a heuristic that would help more programs to go through... but I prefer asking the programmer to make the desired behaviour explicit. Simon How can the user make this explicit? With the class C a b where op :: a - a instance C Int Int where op a = -a test d = op d example, I have been unable to figure out what type annotations I need to add to 'test', for exampl,e to define test to be for the C Int Int instance. Or is it simply impossible in GHC to give test a type signature and to use it as a useful function? Example ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: building GHC (head) on windows MINGW: HsRegexPosixConfig.h: Nosuch file or directory
Brian Smith" [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED]... On 9/30/06, Rene de Visser [EMAIL PROTECTED] wrote: What do I need to install for the regex library support on MINGW?It looks like the regex library needs the posix library, and in my MINGW /MSYS installation I don't find one(and neither does configure). I have not run into this problem with the regex library but I ran into a similar one when building network. Did you get the regex library after you had already run autoreconf? If so, you need to run autoreconf and ./configure again in the ghc root directory. Hello, I seem to have worded myself poorly. I don't have regex.h on my system. And that seems to be the problem. It doesn't come standard with Mingw and MSYS. Where do I get a posix regex library for Mingw/MSYS? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: (Windows) ANNOUNCE: GHC 6.6 Second Release Candidate
Ian Lynagh [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] http://www.haskell.org/ghc/dist/current/dist/ Hello Ian, Is it on purpose that the lastest windows build does not include cabal-install? Since the September builds I don't see any logs for the mingw build? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
building GHC (head) on windows MINGW: HsRegexPosixConfig.h: No such file or directory
Hello, What do I need to install for the regex library support on MINGW? It looks like the regex library needs the posix library, and in my MINGW / MSYS installation I don't find one (and neither does configure). Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
more fixups for GHC docs: ddump flags
The flags under section 4.17.26. Compiler debugging options seem to be out of date. They seem to be wrong for both 6.42 and 6.6 For example --ddump-cmm is not listed, but works. But --ddump-absC is listed, and gives the error unknown flag. I can't get -ddump-stix to work either. Gone, or renamed, or only works in combination with other flags? ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Re: Re: Haskell web forum
I'll just add myself onto the list of webforum haters. I find gmane over a news reader much more comfortable that any webforums I have used. Perhaps gmane can be used over a web interface? Then those that want to use a web forum have one, and I can continue to use my news reader. When I want to read the lists when I am away from the newsreader then I use www.netvibes.com. A very nice web interface for reading in my opinion. Alas no interface for posting. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: small errors in ghc 6.6
Tomasz Zielonka [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] BTW. The -fno-recomp option has a very unintuitive name, at least for me. When I see -fno-recomp, my brain thinks no recompilation, meaning no unneccesary recompilation, which is what --make does by default. Using -fno-recomp causes all modules to be recompiled, whether they changed or not. I think one of -frecomp or -fno-recomp-checking would be much clearer. But it's probably too late to change that... I believe this is worth fixing. Everytime I see -fno-recomp I always read it as no recompilation. A synonym could be added in 6.6. I would suggest -fforce-recomp for force recompilation. In 6.8 -fno-recomp could be flagged as obsolete. In 7.0 it could be removed. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
internal error: asyncRead#, ghci and fps (windows) (trac 806)
Is there anyway to turn off that ghci runs in threaded mode on windows? fps 0.8 (and software that uses fps) triggers trac error #806. This means that I cannot run such things interactively :-( Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Program slower with local definitions
Michael Marte [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hello *, I noticed a five percent speed up by making local definitions global. Maybe the global defintions are monomorphic, and the local defintions are polymorphic. You could evaluate the types of the global types and apply them to the local definitions to see if that then gives the same result. (just guessing). Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: instance overlap in 6.6 candidate
Simon Peyton-Jones [EMAIL PROTECTED] schrieb im Newsbeitrag | | This gives the user possibility to redefine a certain part of the | library instance. | Is not ghc-6.4.1 better at this point? Perhaps. That's what I'd like feedback about. What do others think? ... Simon What are the disadvantages of compiling every library with -fallow-overlapping-instances? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
GHC 6.5 error? Illegal polymorphic or qualified type
Hello, I tried to compile HAppS using the latest GHC snapshot (in compiles fine with 6.41). I for example get the error /home/rene/repos/HAppS/src/HAppS/MACID/Var.hs:23:0: Illegal polymorphic or qualified type: forall state event. Ev state event (ref t) In the type signature for `newEmptyRef': newEmptyRef :: (Monoid t, Ref ref) = AnyEv (ref t) Note that AnyEv is defined as type AnyEv a = forall state event. Ev state event a This should be OK shouldn't it? At least in works in 6.41 and everythis is quantified. Exactly what does the error message Illegal polymorphic or qualified type mean? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
inside the GHC code generator
The following link gives reasons for not generating via C http://groups.google.com/groups?hl=enlr=ie=UTF-8selm=4zp8kn7xe.fsf_-_%40beta.franz.com Naturally a number of these are common lisp specific, however I think that Haskell and GCC are quite semantically different, so using GCC might prevent a lot of optimizations, that aren't possible in C, but would be in GHC. The OCAML-OPT backend is supposed to produce i386 assembly that is competitive with GCC. Maybe this could be ported to GHC? Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: inside the GHC code generator
seems that you don;t understand the situation. ghc compiles Haskell to language called core, do almost all optimizations at level of this language, then translates final result to the STG language from that the C-- code is generated. changing the translation of STG can't prevent ANY ghc optimization. although iy is not so easy because ghc code generation and RTS closely tied together I should have been a bit clearer here. I meant that optimizations that are available from STG - Assembler, are better than STG - C - Assembler. GHC currently doesn't do most of the optimizations I am thinking of. -- Bit tagging to reduce pointer chasing, speed up pattern matching. Due to memory latency and speed it is quicker to do bit masking rather than memory reads -- Parameter passing and regisgter usage opimizations that rely on the structure of the RTS. -- Multiple stacks with custom frame layout. -- dynamic code optimization etc. -- Taking advantage of special assember instructions and flags. Though I have also seen comments that you can do a lot of these with GCC if you do your own stack and parameter management. i.e. don't use the C stack at all. Though your suggestions are probably better than nothing, which is probably what the alternative is (for instance I have not sufficient time to work on these things). Note that I didn't say that the assembly generation of OCAML was better than GCC, just that it was comparable. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: inside the GHC code generator
From: Bulat Ziganshin [EMAIL PROTECTED] Hello Rene, i done reading. my question - is YOU read this? the lisp problems have almost nothing in common with haskell It is a long time since i read this, but some things come to mind. Listed below. Maybe GHC should generate better C. I am just not sure whether this will bring the best global (as opposed to micro-optimizations) performance. However doing anything else might be difficult. Generating better C might also be much more difficult for idioms that don't exist in C, and might encourage people to write Haskell that looks like C (in order to get C like performance). I prefer idiomatic Haskell. It would be nice if this could be fast. But can idiomatic Haskell be translated to efficient C? It might not have many direct loops for example. -- Other notes Integer is about 30 times slower than it needs to be on GHC if you have over half the values between 2^-31 and 2^31. On i386 can you basically can test the low bit for free (it runs in parallel to the integer add instruction). This would allow only values outside this range to required calling the long integer code. Such an optimization is not easily done in C. This encourages Haskell programmers to always use Int, even if the value might get too big, because Integer is too slow. Also Tail recursion is more general than looping. A general tail call optimization will bring better returns than a loop optimization in GHC (though I could be wrong here). This requires special stack handling. Also not so easy in C. If only simple loops are optimized it will encourage people to always code loops in their haskell rather than perhaps using more appropriate constructs. Also take the Maybe data type with Nothing and Just ... or any other datatypes with 0 and 1 variable constructors. Here these could be represent by special values for the 0 variable case and bit marking on the single constructor values. This could lead to good optimizations on case expressions. Also not so easy in C. The lack of this feature encourages people to encode their datatypes as Int's to get speed. Also not good. Whether we can communicate the non aliasing and aliasing properties of GHC to the C compiler, I am also not so sure. Also in GHC, I am not sure whether stack base locals are the best move. It might be best to have a fixed page as register spill in some cases. If you wish to pass and return unboxed tuples without reboxing you will probably required a special function interface with double entry points (I think this can be done in C, but it is a bit tricky). Summary: If only C like Haskell is fast, we end up with Haskell that looks like C. Yuck. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: Re[2]: inside the GHC code generator
From: Bulat Ziganshin [EMAIL PROTECTED] i answered in the original letter (search for Cray :) Re-reading this, I see that you have a well defined goals that cover most of my points. seems that you don't seen the attached files. tail calls are optimized in gcc No I don't see any attached files (on any of your emails). Best of luck with your optimisations. I will look forward to using them. (Although I don't like the style of the shootout code, I find it very useful in helping me speed up my own code, and yes I find it better in write Haskell in such a style, than to use FFI and call C). Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Proposal: Improved error message of Error in array index
One idea that occurred to us recently is this: GHCi could provide a simplified version of the cost-centre-stack machinery *all the time*, Simon This still doesn't explain to me why C:\Haskell\devmain +RTS -xc gave GHC.Arr.CAFmain: Error in array index (This is with full profiling turned on) This sort of stack is not going to help anyone. What I think would be good is the ability to compile the executable with a top level exeception handler which goes into a low level debugger where you can examine the thunk and its surroundings. I presume that some type information is retained for the garbage collector? Enough to tell integers from pointers? Also error Error in array index ++ internal_show_b b ++ internal_show_i i could be done, which wouldn't have the problem of exporting unwanted show instances. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Proposal: Improved error message of Error in array index
I suggest that the code in GHC.Arr be changed from error Error in array index to error Error in array index ++ show b ++ show i so that the bounds and offending index is shown. This is easy to do as the information is already available, and would in most cases be of great help to the user in guessing which code was causing the error. Background: I have some stochastic estimation code which after a few hours running produces this error. I then recompiled with full profiling and did C:\Haskell\devmain +RTS -xc main +RTS -xc GHC.Arr.CAFmain: Error in array index Not very usefull, though I wouldn't have guessed that the code containing the error code in GHC.Arr is reduced to a CAF. Further details: If I do 100 simulations it runs OK. If I do 1000 simulations it produces the above error. There is no case where the array indicies depend on the number of simulations (I simply accumulate results). In my case I can probably figure out where the error occurs, as it must be an event with probability between 1e-6 and 1e-7 which In my case gives me a clue (I hope I guess correctly). But in other situations the only chance I guess would be to recompile GHC as I suggest above. Due to the high number of simulations required and the long running time, finding the error by bisection would be tedious. Adding debugging code would probably increase the run time to days instead of hours. Rene. ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Array operations and pinning
Hello, Where is the documentation on how pinning works in the GHC garbage collector (from a GHC users point of view). I have copied the following code from array/IO.hs and am thinking that it is assuming that the array is pinned? What triggers the pinning? On a second note. Why is the type signiture so constricted. The code below works on any IOUArray (which is very usefull, not just on Int Word8). Naturally this assumes the particular in memory array layout that GHC uses on a particular platform, so would not be compatible (probably) with other Haskell compilers. Rene. hPutArray :: Handle -- ^ Handle to write to - IOUArray Int Word8-- ^ Array to write from - Int -- ^ Number of 'Word8's to write - IO () hPutArray handle (IOUArray (STUArray l u raw)) count | count == 0 = return () | count 0 || count rangeSize (l,u) = illegalBufferSize handle hPutArray count | otherwise = do wantWritableHandle hPutArray handle $ \ [EMAIL PROTECTED] haFD=fd, haBuffer=ref, haIsStream=stream } - do [EMAIL PROTECTED] bufBuf=old_raw, bufRPtr=r, bufWPtr=w, bufSize=size } - readIORef ref -- enough room in handle buffer? if (size - w count) -- There's enough room in the buffer: -- just copy the data in and update bufWPtr. then do memcpy_baoff_ba old_raw w raw (fromIntegral count) writeIORef ref old_buf{ bufWPtr = w + count } return () -- else, we have to flush else do flushed_buf - flushWriteBuffer fd stream old_buf writeIORef ref flushed_buf let this_buf = Buffer{ bufBuf=raw, bufState=WriteBuffer, bufRPtr=0, bufWPtr=count, bufSize=count } flushWriteBuffer fd stream this_buf return () ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell] Writing large n-dim un-boxed array of Int32 quickly?
Hello, I want to write a multi-dimensional unboxed arrary of Int32 to a file. (And also read it back later). What I tried so far is import NewBinary.Binary ... mapM_ (put bin) $ elems array ... but this was exceedlying slow. The array contains about 10 000 000 entries. Any suggestions? Rene. ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell] Writing large n-dim un-boxed array of Int32 quickly?
From: Ketil Malde [EMAIL PROTECTED] Rene de Visser wrote: I want to write a multi-dimensional unboxed arrary of Int32 to a file. (And also read it back later). hGetArray/hPutArray? To do this I need to cast my 5 dimensional array to a 1 dimensional array? Does this work? i.e. how do I know that GHC uses a flat array representation for multidemsional arrays (rather than a nested model using pointers). Rene. ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell] Writing large n-dim un-boxed array of Int32 quickly?
From: Bulat Ziganshin [EMAIL PROTECTED] Hello Rene, Monday, October 31, 2005, 11:13:30 AM, you wrote: RdV I want to write a multi-dimensional unboxed arrary of Int32 to a file. (And RdV also read it back later). how about fileWriteBuf/fileReadBuf? Hello Bulat, How does this work? (is this from NewBinary, I don't have the sources with me). How do I convert my array to a buffer? Rene. ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell-cafe] Help wanted: Lazy multiway zipper with mismached intervals
Many thanks to all for the replies From: ChrisK [EMAIL PROTECTED] Could the interval for element x of List xList overlap with more than one element of another list? It does not matter too much, but is something you did not clarify. In general, how may the intervals for all the lists overlap? (The answer may be too complex, in which case you can just ignore me). Yes, unlimited overlap is possible. e.g. Infinite interval in one list, and infinitely many small intervals in another list. I would start by merging, perhaps in stages, into an intermediate list with elements of its own data FooIntermediate = A _ [_]| B _ [(_,_)] | C _ _ _ | ... types. Yes, I'll probably use this suggestion, maybe with records to make partial update easier. If you need to change the semantics of merging the streams then it may help when you refactor that the types of events are now types of constructors and the compiler is checking your code. Originally I had thought that I could treat the merge symetrically, but I now think this is not the case. Still I am not sure if I will use different types for different types of merge. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Help wanted: Lazy multiway zipper with mismached intervals
Hello, I need to zip together multiple lists. The lists are sorted by date, and each entry in the list represents data for a time interval. The time intervals between the lists may be missmatched from each other. This means that sometimes you don't need to move forward in list, while you move forward in other lists. It might also mean that you need to skip a number of entries foward. If the computation does not need part of the contents of one of the lists, then this list should be ignored until it is needed. As the lists are sorted you never need to go backwards. I found it fairly easy to write a zipper for two lists, where the items from both lists are needed (example binary operator on the payload of the list). However the combination of merging multiple lists together, and ignoring a list in the case it is not needed by the computation leads to very messy code. I though about if there was a away of encapsulating this in a monad, but haven't thought of any way to do this. Another idea is to have a mutable cursor for each list and move these forward as required. But I guess this might be worth avoiding? I think it would be good if somehow I could encapsulate each list, so on a per list basis, and can say given me the current head, or move one forward. But I haven't figured out how to pass the state of the other threads invisibly through. I guess the ony way might be to use the state monad? I guess there can be no simple recursive solution? Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Help wanted: Lazy multiway zipper with mismached intervals
From: ChrisK [EMAIL PROTECTED] Rene de Visser wrote: Does a single list have only disjoint intervals? Yes. The lists are strictly increasing Doing this for two lists with a recursive function is easy. There being an output element whenever the intervals of the two input lists overlap. Yes, I have done this. However the combination of merging multiple lists together, and ignoring a list in the case it is not needed by the computation leads to very messy code. Do mean multiple as in at least three? Yes If so, then what do have an output element only if all three or more input elements overlap, or do you have an output element when at least two input elements overlap? That can depend on the values (payloads) per entry. For example I might have a selector operator and one of the lists steers from which of the other lists I should take the value for that interval. I think a continuation per list would provide a nice solution. But I don't know how to do that, and it might be horribly ineffecient? Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Annotating calculations
From: Henning Thielemann [EMAIL PROTECTED] On Wed, 15 Jun 2005, Rene de Visser wrote: I have a somewhat complicated calculation programmed in Haskell. This calculation is coded without using monads. I want to also produce a report describing the details of this calculation for each particular set of inputs. On the other hand replicating the calculation source code twice, once without reporting and once without seems bad. smaller parts. If you have more breaks you have more chances to get temporary results. You can put temporary values into a data structure. E.g. if you have an iteration don't write a recursion with a fixed abort criterion but write a function which maps the old value to the new one, then apply 'iterate' on it. Now you can inspect the temporary values and you can later apply a function which decides when to stop the iteration. Thankyou for the reply, The calculation is for the mostly already structured as you have suggested. The trouble is there are lots of little pieces that need to be put together. Do I need to put these pieces together twice? Once to put the whole calculation together? And once to do the reporting? This is what I'd like to avoid. (A good deal of the complexity comes from that the calculation has a complex structure). It would be nice to describe the structure once (at the moment the structure of the calculation is describe impliciitly in the Haskell functions) and use it both for the calculation and for the reporting. I thought about using some like Buddha or Hat to generate a data structure describing the calculation and mining this for the reporting. But these seems like horrible over kill, and probably not very change resistant, not to mention making the development not very interactive. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Annotating calculations
From: Henning Thielemann [EMAIL PROTECTED] On Wed, 15 Jun 2005, Rene de Visser wrote: You can put temporary values into a data structure. E.g. if you have an iteration don't write a recursion with a fixed abort criterion but write a function which maps the old value to the new one, then apply 'iterate' on it. Now you can inspect the temporary values and you can later apply a function which decides when to stop the iteration. Designing the data structures to store the calculation results seems to be non-trivial, so I guess I should do this first. Then maybe the solution to the other problem will be apparent. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Tables in Haskell (data model /business app prototyping)
From: Bayley, Alistair [EMAIL PROTECTED] From: Rene de Visser [mailto:[EMAIL PROTECTED] I would rather use Haskell also for the persistency, global constraint maintanence, etc... rather than using an external database. What do you mean by external database? If you just mean on another I would like to write my views and constraints in Haskell, and not in a seperate database language. i.e. I want to use Haskell also as declarative active database language to define the business logic and rules. This would seem to me to be a lot easier when the database is written in Haskell itself and part of the same program. Rene. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe