Re: [Haskell-cafe] not able to compile Happy GLR examples
Thanks. I don't imagine that will help as the flag in the Happy source is (to my knowledge) outdated, indicating that it hasn't been touched in a while. On Mon Sep 29 19:05 , "Krzysztof Skrzętnicki" <[EMAIL PROTECTED]> sent: > with Happy, version 1.16. I'm using ghc version 6.6.1. I've looked at the Just looking at the GHC version number: perhaps update to 6.8.3 would help? Best regards Christopher Skrzętnicki Msg sent via CableONE.net MyMail - http://www.cableone.net___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] not able to compile Happy GLR examples
(posted on 9/23/08 on haskell-beginners, no response was received) I'm unable to compile the GLR examples (in the 'glr' directory) provided with Happy, version 1.16. I'm using ghc version 6.6.1. I've looked at the version of Happy currently in darcs and the part of the examples that seems to be causing the problem has not been updated there, either. This Happy seems out of date because it uses the flag "-package data"; my searching indicates that the 'data' package is old. Other errors remained after I removed the flag. Would someone please verify the error? Also, does anyone know of or have a GLR example that works? Thank you for reading or helping. Brian Msg sent via CableONE.net MyMail - http://www.cableone.net___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] f(g(x), h(y)) - Correct syntax
Hallo! I have this code: q1 :: EName -> [ApprenticeInfo] q1 c = [apprenticeInfo n | n <- allApprentices, member ((sq4 c) (firstOf5(n))) == True] sq4 :: ESurname -> [IDB] sq4 c = (sq3 (sq1 (c))) firstOf5 :: (a,b,c,d,e) -> a firstOf5 (n,_,_,_,_) = n member :: [IDB] -> IDB -> Bool member [] y = False member(x:xs) y = (x==y) || member xs y sq4 works correctly and returns [IDB] Unfortunately member ((sq4 c) (firstOf5(n))) gives this error: Type error in application *** Expression : sq4 c (firstOf5 n) *** Term : sq4 *** Type : ESurname -> [IDB] *** Does not match : a -> b -> c As far as I see it I'm not writing the correct syntax for a function of 2 functions. I have g(x): Esurname->[IDB] h(y): (IDB,_,_,_,_) -> IDB f(x,y): ([IDB], IDB) -> Bool I want to obtain f(g(x), h(y)) and I obtain something else. Where am I wrong? Thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Compulsory relation 1 to many from entity A to entity A
Hallo! I'd like to build a database model with winHugs that allows a "recursive relation". For example a single instance of entity "components" is related with at least another row of the entity "components" (1 to many relationship). How can I do that? Thank you for your attention! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Create a list without duplicates from a list with duplicates
Hallo! Let's suppose I have a list [a,b,c,d,c,d]. I'd like to write a function that returns a new list without duplicates (in the example [a,b,c,d]). How can I do that? What is the most general way? I'd like to use the same function for a list of Int or String or some other user defined data type. Thank for your attention! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Fwd: stg_uncheckedShiftRL64 unresolved when compiling with GHC 6 8 2
Hi, I posted this to the HAppS discussion group, but maybe somebody is able to answer in the Cafe, at least where this unresolved symbol belongs to. It looks like the same problem was discussed earlier related to GHC 6.7, but I got this problem right now, compiling HPaste with HAppS (using SearchPath). The linker message is: === During interactive linking, GHCi couldn't find the following symbol: stg_uncheckedShiftRL64 This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and - lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: [EMAIL PROTECTED] === Output from ghc-pkg -l: === /home2/dima/install//lib/ghc-6.8.2/package.conf: Cabal-1.2.3.0, array-0.1.0.0, base-3.0.1.0, binary-0.4.1, bytestring-0.9.0.1, containers-0.1.0.1, directory-1.0.0.0, filepath-1.1.0.0, (ghc-6.8.2), haskell-src-1.0.1.1, haskell98-1.0.1.0, hpc-0.5.0.0, hscolour-1.6, html-1.0.1.1, mtl-1.1.0.0, network-2.1.0.0, old-locale-1.0.0.0, old- time-1.0.0.0, packedstring-0.1.0.0, parsec-2.1.0.0, pretty-1.0.0.0, process-1.0.0.0, random-1.0.0.0, readline-1.0.1.0, regex-base-0.72.0.1, regex-compat-0.71.0.1, regex-posix-0.72.0.2, rts-1.0, stm-2.1.1.0, template-haskell-2.2.0.0, unix-2.3.0.0, xhtml-3000.0.2.1, zlib-0.4.0.1 === To save time I compiled only GHC without extralibs, and later installed packages that were msissng during compilation from extralibs or hackage. Are there any modules shown whose versions raise any suspicions? Thanks. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] FP design
I typically start with a list of the types I want, then the minimal list of type signatures. Ideally, it should be possible to write an arbitrarily large set of programs in the given application domain by composing this initial list of functions (so the data type can be specified abstractly, if desired). And if we translate that paragraph into, say, Erlang, what will we get? It seems that we will get a lot of tests instead of types. Or a lot of (pre/post)predicates about values. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Hardware
it seems that now we move right into this direction with GPUs I was just thinking that GPUs might make a good target for a reduction language like Haskell. They are hugely parallel, and they have the commercial momentum to keep them current. It also occurred to me that the cell processor (in the Playstation 3) might also be a good target considering its explicitly parallel architecture. They are no good. GPU's have no synchronisation between them which is needed for graph reduction. A delayed computation undergo several steps when created and actually computed/forced and we'd like to save effort. Also, they are slow when dealing with memory accesses. Some are slow on conditional execution. Take a look at BrookGPU: http://graphics.stanford.edu/projects/brookgpu/ They have raytracer on GPU and it is SLOW because of high cost of tree traversal. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Hardware
but more efficient computational model exists. if cpu consists from huge amount of execution engines which synchronizes their operations only when one unit uses results produces by another then we got processor with huge level of natural parallelism and friendlier for FP programs. it seems that now we move right into this direction with GPUs GPU's are pretty normal processors. They are different in that they usually write into a single predetermined memory location and fetch from texture memory with floating point indexes, so called "gather" operation mode. The dataflow approach ("scatter" approach) splits into static dataflow with limited parallelism and dynamic dataflow with huge potential parallelism. Dynamic dataflow approach (currently investigated by our research team I am proud member of) requires substantial hardware support in terms of associative memory for matching computation contexts. Also, "huge amount of execution engines" should be connected somehow. Connection network is also a non-trivial task. Problems, problems, problems, problems and no easy solution. ;) BTW, second of our modeling engines was written in Haskell. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: State of OOP in Haskell
Benjamin Franksen wrote: [EMAIL PROTECTED] wrote: Here are two surveys (somewhat outdated) on the use of formal methods in industry: http://citeseer.ifi.unizh.ch/39426.html http://citeseer.ifi.unizh.ch/craigen93international.html Both of these links are dead. Could you post author and title? Those are alive at the moment of email composing: http://citeseer.ist.psu.edu/39426.html *An International Survey of Industrial Applications of Formal Methods: Volume 1 Purpose, Approach, Analysis, and Conclusions (1993)* Dan Craigen, Susan Gerhart, Ted Ralston http://citeseer.ist.psu.edu/craigen93international.html *An International Survey of Industrial Applications of Formal Methods Volume 2 Case Studies (1993)* Dan Craigen, Susan Gerhart, Ted Ralston ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] State of OOP in Haskell
Steve Downey wrote: The primary goal of writing source code isn't to communicate to a computer, but to communicate to a human being. That implies that the communication should be at a high enough level of abstraction to be easily understood by people, while not losing the precision necessary for a computer. OO, at least when done well, maps well to how people think. Things that can be directed to perform actions. There is also a well developed practice of OO analysis and design. It's not clear (at least to me) that there is an equivalent set of practices for functional programming. Some of Haskell constructs come from the area of formal methods. Notably, algebraic types come from Z-notation (as I am told). Formal methods in general and Z notation in particular precede OO as defined, for example, in Smalltalk-80. Formal methods do not require substantial training and/or costly tools (although both exists). It can be trained in several weeks and start bringing benefits. Here are two surveys (somewhat outdated) on the use of formal methods in industry: http://citeseer.ifi.unizh.ch/39426.html http://citeseer.ifi.unizh.ch/craigen93international.html So, you can safely borrow methodics from formal methods and even think about Hindley-Milner type system as a theorem prover. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How did you stumble on Haskell?
What's folks most interesting ways to arrive at FP? Mine isn't most interesting. I did some interesting (I think so) research in visualisation and coded it in C. Then I tried to extend it - speed it up, add more features, etc, - and found C unsatisfactory. It is error prone and C programs cannot be modified easily. Then I tried some macro languages, M4 and like, again without satisfaction - the same modification failures. No one can keep things tied up for me. Then I search and roam, I left my visualisation research behind programming languages field and found Haskell. It got me by syntax then by type system. I still hope I'll return to visualisation research. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Glasgow Distributed Haskell
Paul Johnson пишет: Joel Reymont <[EMAIL PROTECTED]> wrote: I'm after Erlang in Haskell, if you will, for fault-tolerance and scalability. I think the way to do Erlang in Haskell is to build a middleware layer on top of the language, not try to make the language into something it is not. In this kind of environment you need to be able to upgrade components while the system is running. The careful Haskell habit of separating stateful operations from pure functions is useful here. I gather that the HAppS project is working along similar lines, and for similar reasons. Take a look at it. I think I should point you to: http://www.cs.umd.edu/~mwh/papers/neamtiu06dsu.html --- *Practical Dynamic Software Updating for C*. Iulian Neamtiu, Michael Hicks, Gareth Stoyle, and Manuel Oriol. In /Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI)/, pages 72-83, June 2006. Software updates typically require stopping and restarting an application, but many systems cannot afford to halt service, or would prefer not to. /Dynamic software updating/ (DSU) addresses this difficulty by permitting programs to be updated while they run. DSU is appealing compared to other approaches for on-line upgrades because it is quite general and requires no redundant hardware. The challenge is in making DSU /practical/: it should be flexible, and yet safe, efficient, and easy to use. In this paper, we present Ginseng, a DSU implementation for C that aims to meet this challenge. We compile programs specially so that they can be dynamically patched, and generate most of a dynamic patch automatically. Ginseng performs a series of analyses that when combined with some simple runtime support ensure that an update will not violate type-safety while guaranteeing that data is kept up-to-date. We have used Ginseng to construct and dynamically apply patches to three substantial open-source server programs-/Very Secure FTP daemon/, /OpenSSH sshd daemon/, and /GNU Zebra/. In total, we dynamically patched each program with three years' worth of releases. Though the programs changed substantially, the majority of updates were easy to generate. Performance experiments show that all patches could be applied in less than 5 /ms/, and that the overhead on application throughput due to updating support ranged from 0 to at most 32%. --- So, it is not completely impossible for haskell being updated on-the-fly. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Aim Of Haskell
OK, there's the option of replacing working tools with hype. It worked for C++, and it worked for Java. Pity I don't have the slightest idea how to work up a hype for Haskell. Who would want such a hype? Why not simply start picking up fruits before the mainstream notices? ;-) Actually, many do. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Optimization again.
Donald Bruce Stewart wrote: szefirov: From GHC documentation: "Once profiling has thrown the spotlight on the guilty time-consumer(s), it may be better to re-think your program than to try all the tweaks listed below." So, how should I rethink my program? Which way to take? Do you have some particular code that is underperforming? I have a plenty of it. ;) I'm yet to decide what to blame. Performance tips are documented here: http://haskell.org/haskellwiki/Performance Thank you. I loaded it the next second I received your answer. ;) I profiled my program and found that residency looks pretty fixed but program memory usage grows and eventually I get heap overflow (on Windows) or heavy pagefile trashing (on Linux). When I turn on +RTS -c to use heap compaction I immediately get the following: - .exe: internal error: scavenge_mark_stack: unimplemented/strange closure type 30 @ 03678268 Please report this as a bug to glasgow-haskell-bugs@haskell.org, or http://www.sourceforge.net/projects/ghc/ - This already reported as a bug, but isn't fixed yet. The bug is right here: http://cvs.haskell.org/trac/ghc/ticket/954 It does appear with 6.4.1 too. So I try as hard as I can to reduce the size of garbage produced. No much luck so far. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Optimization again.
From GHC documentation: "Once profiling has thrown the spotlight on the guilty time-consumer(s), it may be better to re-think your program than to try all the tweaks listed below." So, how should I rethink my program? Which way to take? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] jhc, whole program optimizing compiler.
Do anyone had any experience with JHC? I tried to install it second time and again get an error during library build. It's a pity, we need a speed in our very lazy code. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Template Haskell.
Why doesn't reify return function body? reify (mkName "somefunction") for a function defined in the same module returns constructor VarI (of data type Info) that does not contain function declaration in (Maybe Dec) part. What actions should I perform to get a function body with patterns, expressions and all that? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Hacking Hawk
Hawk didn't updated from GHC v4.04. It does contain dependencies on functions that are present in my current (6.04) GHC distribution, but they are not documented. Those functions and constructors are (just a error log from ghc): --- AQ.lhs:17:16: Not in scope: type constructor or class `STArray' AQ.lhs:82:14: Not in scope: `newSTArray' AQ.lhs:92:21: Not in scope: `writeSTArray' AQ.lhs:258:27: Not in scope: `readSTArray' AQ.lhs:262:27: Not in scope: `writeSTArray' --- They are in GHC.Arr module now. I found that googling for their name. They also changed their types so that they are not compatible with Control.Monad.ST (previous versions were compatible with LazyST). What does they do? Is it possible to rewrite them for current version of ghc? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe