Re: [Haskell-cafe] Disadvantages of de Bruijn indicies?

2007-05-11 Thread Stefan O'Rear
On Fri, May 11, 2007 at 03:10:42PM +0100, Neil Mitchell wrote: Hi, de Bruijn indicies look quite nice, and seem to eliminate a lot of complexity when dealing with free variables: http://en.wikipedia.org/wiki/De_Bruijn_index So I was wondering, are they suitable for use in a compiler? If

Re: [Haskell-cafe] Picking an architecture for a Haskell web app

2007-05-10 Thread Stefan O'Rear
On Thu, May 10, 2007 at 05:52:55PM +0100, Andrew Coppin wrote: Wait a sec... Are you trying to tell me that it is *faster* to take the source, type check it, convert it to Core, perform 25,000 Core-to-Core transformations, convert Core to C, call GCC, link the result together, dynamically

Re: binary distribution problem

2007-05-09 Thread Stefan O'Rear
On Wed, May 09, 2007 at 11:34:37PM +0100, Frederik Eaton wrote: Thanks Duncan, yes 'uname -a' shows i686. I was confused because the cpu is EM46T, I don't know why uname does not say x86_64. Yes, a better failure mode would indeed be helpful! EM64T processors support an emulation mode for

Re: [Haskell-cafe] built-in lists vs inductively defined list

2007-05-09 Thread Stefan O'Rear
On Wed, May 09, 2007 at 02:45:34PM +0100, Jos? Miguel Vila?a wrote: Can someone tell me if would be any difference (beside syntax) between the built-in Haskell list with [] and : and lists given by a inductive datatype definition like data List a = Nil | Cons a (List a) This is, is any of

Re: overflow bug in ghci

2007-05-06 Thread Stefan O'Rear
On Sun, May 06, 2007 at 04:33:22PM +0200, Przemyslaw Uznanski wrote: I encountered bug in ghci (in version 6.4.2 from gentoo and in latest binary package 6.6.1 from www.haskell.org ). Bug is: *Main 3492928512*3492928512 -6246194483767017472 I'm using 64bit athlon. (result is correct on 32

Re: [Haskell-cafe] GADTs, type classes, existentials

2007-05-06 Thread Stefan O'Rear
On Sun, May 06, 2007 at 03:11:12AM -0700, Mike Hamburg wrote: Hello all, I'm trying to build a variation on Maps which supports a fast concat-like operation, for a library I'm writing. I'd rather not re-implement Data.Map, so I'm having a try with GADTs. The relevant part of my source

Re: [Haskell-cafe] Arbitrary precision?

2007-05-06 Thread Stefan O'Rear
On Sun, May 06, 2007 at 05:15:08PM +0100, Andrew Coppin wrote: Greetings. Haskell has arbitrary precision integers, in the form of the Integer type. Is there a type somewhere that implements arbitrary precision fractional values? Yes, Rational in the Prelude (with extra functions in

Re: [Haskell-cafe] Playing with GHC [was Arbitrary precision?]

2007-05-06 Thread Stefan O'Rear
On Sun, May 06, 2007 at 10:02:55PM +0100, Andrew Coppin wrote: Anyway... long ramble over... Emacs isn't my operating system of choice. I prefer to use SciTE (which is *just* a text editor - as in, it doesn't also come with an integrated toaster and alarm clock). One SciTE window open, one

Re: [Haskell-cafe] a question concerning type constructors

2007-05-05 Thread Stefan O'Rear
On Sat, May 05, 2007 at 02:26:45PM +0100, Eric wrote: Hi all, In Haskell, is it possible to declare a type constructor with a variable number of type variables e.g. data Tuple * allowing the following declarations: t: Tuple u: Tuple Bool v: Tuple Bool Int w: Tuple Bool Int

Re: [Haskell-cafe] An interesting toy

2007-05-05 Thread Stefan O'Rear
On Sat, May 05, 2007 at 09:17:50PM +0100, Andrew Coppin wrote: Ryan Dickie wrote: Sounds like a neat program. I'm on a laptop right now but i'll check it out later. The reason I am mailling is because you can use mencoder to convert a stream of image files into a video file. Indeed, it is

Re: [Haskell-cafe] An interesting toy

2007-05-05 Thread Stefan O'Rear
On Sat, May 05, 2007 at 03:33:03PM -0500, Derek Elkins wrote: Try adding strictness annotations to all the components of all your data structures (i.e. put a ! before the type). Not all of the need it, but I doubt any need to be lazy either. Probably the reason quant8 seems to be taking

Re: Cost of Overloading vs. HOFs

2007-05-04 Thread Stefan O'Rear
On Fri, May 04, 2007 at 09:02:03PM +0100, Neil Mitchell wrote: Hi Adrian The GHC users guide says overloading is death to performance if left to linger in an inner loop and one thing I noticed while playing about with the AVL lib was that using a HOF and passing the (overloaded) compare

Re: Cost of Overloading vs. HOFs

2007-05-04 Thread Stefan O'Rear
On Sat, May 05, 2007 at 10:29:54AM +1000, Matthew Brecknell wrote: Stefan O'Rear: Data.Sequence doesn't use overloading Data.Sequence uses overloading for subtree size annotations. The structural recursion seems to make it quite awkward to express size annotations without overloading. Ah

Re: [Haskell-cafe] Debuggingy

2007-05-04 Thread Stefan O'Rear
On Sat, May 05, 2007 at 11:36:16AM +0700, Monang Setyawan wrote: Hi, I'm a beginner Haskell user. Is there any way to trace/debug the function application in GHC? Absolutely! [EMAIL PROTECTED]:/tmp$ ghci X.hs ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | |GHC

Re: [Haskell-cafe] Debugging

2007-05-04 Thread Stefan O'Rear
On Fri, May 04, 2007 at 10:44:15PM -0700, Ryan Dickie wrote: I've only written trivial applications and functions in haskell. But the title of this thread got me thinking. In an imperative language you have clear steps, states, variables to watch, etc. What techniques/strategies might one

Re: Why do we have stack overflows?

2007-05-03 Thread Stefan O'Rear
On Thu, May 03, 2007 at 05:36:45PM -0700, Brandon Michael Moore wrote: On Thu, May 03, 2007 at 04:59:58PM -0700, John Meacham wrote: I believe it is because a stack cannot be garbage collected, and must be traversed as roots for every garbage collection. I don't think there are any issues

Re: [Haskell-cafe] Displaying infered type signature of 'offside' functions

2007-05-02 Thread Stefan O'Rear
On Wed, May 02, 2007 at 04:16:57PM -, [EMAIL PROTECTED] wrote: Now the compiler gives you wonderful error messages ``cannot match type `x y z' against Ordering'' --- so you replace ``Ordering'' with ``x y z''. You could just use a rigid type variable: foo :: a foo = ... (What is the

Re: [Haskell] Haskell fast (?) arrays

2007-05-01 Thread Stefan O'Rear
On Tue, May 01, 2007 at 01:59:01PM +0200, Federico Squartini wrote: I was reading an old post where Hal Daume III was analyzing Haskell performance for arrays. He proposed a test program which initializes an array, reverse it a number of times, and sums the contents. So I wrote a c++

Re: [Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Stefan O'Rear
On Tue, May 01, 2007 at 09:51:37PM +0200, Philipp Volgger wrote: Is Hs-Plugins still under develeopment; is there still somebody who is updating it? Not really. It works perfectly and fills its niche. Mature software is not under development! It is still maintained by Don Stewart. Stefan

Re: [Haskell-cafe] 'Proper' use of the State monad

2007-04-30 Thread Stefan O'Rear
On Mon, Apr 30, 2007 at 11:16:47PM +0200, Denis Volk wrote: Hello all, I am trying to make a (turn-based) game in Haskell and need to pass around quite a bit of information, so using the State monad seems most appropriate. My question is, which is a better idea: 1) Using State GameState r

Re: non-owner-writable files generated in ghc build process?

2007-04-29 Thread Stefan O'Rear
On Sun, Apr 29, 2007 at 09:12:00AM -0400, Isaac Dupree wrote: When I was doing `rm -r` on a build tree it pointed out that driver/split/ghc-split.prl and driver/mangler/ghc-asm.prl were write-protected. Tacking this down, they're generated from .lprl with unlit... then (in mk/suffix.mk)

Re: [Haskell-cafe] Displaying infered type signature of 'offside'functions

2007-04-29 Thread Stefan O'Rear
On Sun, Apr 29, 2007 at 07:03:32PM -0500, Antoine Latter wrote: This looks like a good place to ask a question that's been bugging me for a bit: I've had cases in my own code where I can't seem to create a type annotation for an inner declaration that the type-checker likes. Here's a toy

Re: [Haskell-cafe] run-time type testing in haskell?

2007-04-28 Thread Stefan O'Rear
On Sat, Apr 28, 2007 at 02:06:21PM +0100, Eric wrote: In imperative languages one can test the type of a variable and downcast if necessary. Here's an example in Pseudojava: T v := ... ; if (v instanceof T') T' v' := (T')v Is it possible to do something like this in Haskell? Possible,

Re: [Haskell-cafe] Behavior of groupBy

2007-04-28 Thread Stefan O'Rear
On Sat, Apr 28, 2007 at 03:49:44PM +0200, Hans van Thiel wrote: Hello All, The standard function groupBy of List.hs doesn't work as I expect in this case: groupBy (\x y - (last x) == (last y)) [abc, bd,cac] results in: [[abc],[bd],[cac]] where I want: [[abc,cac], [bd]] Am I

Re: [Haskell-cafe] Poor first impression

2007-04-28 Thread Stefan O'Rear
On Sat, Apr 28, 2007 at 12:11:30PM -0300, Fernando Cassia wrote: On 4/27/07, Joe Re [EMAIL PROTECTED] wrote: Perhaps you were installing by tarball because you thought Fedora doesn't have a recent version of ghc in their repositories? Exactly. I saw the latest version was very recent,

Re: [Haskell-cafe] I need help on AVL trees

2007-04-27 Thread Stefan O'Rear
On Fri, Apr 27, 2007 at 05:27:37AM -0700, iliali16 wrote: Can someone advise me how can I build an AVL tree becouse I have difficulties with the rotations. Since if I add a node I want to be abel to check whether the tree is balanced or not if balanced ok but if not I need to do one of the 4

Re: [Haskell-cafe] Multi Line String literals

2007-04-26 Thread Stefan O'Rear
On Thu, Apr 26, 2007 at 01:43:09PM +0100, Joe Thornber wrote: On 26/04/07, Bas van Dijk [EMAIL PROTECTED] wrote: test = putStrLn $ toIsString $ do I need MultiLine

Re: [Haskell] ANN: IOSpec 0.1

2007-04-24 Thread Stefan O'Rear
On Tue, Apr 24, 2007 at 07:36:07PM -0400, Isaac Dupree wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wouter Swierstra wrote: * If you're an ICFP referee, you may want to avoid reading any further* Test.IOSpecVersion 1.0 I'm pleased to announce the

Re: [Haskell] ANN: IOSpec 0.1

2007-04-24 Thread Stefan O'Rear
On Mon, Apr 23, 2007 at 04:16:56PM +0100, Wouter Swierstra wrote: * If you're an ICFP referee, you may want to avoid reading any further* Test.IOSpec Version 1.0 I'm pleased to announce the first release of the Test.IOSpec library, that provides a pure

Re: [Haskell] ANN: IOSpec 0.1

2007-04-24 Thread Stefan O'Rear
On Wed, Apr 25, 2007 at 03:22:33AM +0200, Twan van Laarhoven wrote: Wouter Swierstra wrote: Test.IOSpecVersion 1.0 Shouldn't that be 0.1? * Test.IOSpec.Teletype: a specification of getChar and putChar. You use Dynamic for the data type in IORefs, this has the unfortunate

Re: [Haskell-cafe] About functional programing, type theory and a master thesis topic

2007-04-24 Thread Stefan O'Rear
On Tue, Apr 24, 2007 at 09:25:55PM -0300, Glauber Cabral wrote: Hi everybody =) First time I write to the list. http://haskell.org/pipermail/haskell-cafe/2007-April/024819.html http://haskell.org/pipermail/haskell-cafe/2007-April/024867.html (I am not a researcher and cannot comment on the

Re: [Haskell-cafe] About functional programing, type theory and a master thesis topic

2007-04-24 Thread Stefan O'Rear
On Tue, Apr 24, 2007 at 09:58:01PM -0300, Glauber Cabral wrote: Hi =) No problem! And sorry by the duplicated post. I've had just checked my gmail and the message was not there, 2 days after posting. I've sent again and then there were 2 copies. Cheers, Glauber On 4/24/07, Stefan O'Rear

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-23 Thread Stefan O'Rear
On Mon, Apr 23, 2007 at 01:06:07PM -0500, Dan Drake wrote: Hello everyone, I have some code in which the bottleneck is the factorial function. I began by using a naive fac n = product [1..n] but it looks like there are faster ways to do it. I could try to look up those faster

Re: [Haskell-cafe] faster factorial function via FFI?

2007-04-23 Thread Stefan O'Rear
On Mon, Apr 23, 2007 at 06:25:39PM -0500, Dan Drake wrote: On Mon, 23 Apr 2007 at 12:03PM -0700, David Roundy wrote: I'm curious: what is your application? I've never seen one in which factorials actually need be computed. In physics, one factorial is generally divided by another (e.g. for

Re: [GHC] #1232: generalise runhaskell to support arbitrary file names, not just those with .{l}hs extensions

2007-04-22 Thread Stefan O'Rear
On Sun, Apr 22, 2007 at 12:02:19PM +0100, Frederik Eaton wrote: By the way, I replied to this via email because I can't figure out how to annotate the bug anymore. I'm rather stumped... I thought email replies might automatically become associated with the bug. I'm pretty sure they won't. 1)

Re: [GHC] #1232: generalise runhaskell to support arbitrary file names, not just those with .{l}hs extensions

2007-04-22 Thread Stefan O'Rear
On Sun, Apr 22, 2007 at 06:53:44PM +0100, Frederik Eaton wrote: On Sun, Apr 22, 2007 at 08:44:44AM -0700, Stefan O'Rear wrote: On Sun, Apr 22, 2007 at 12:02:19PM +0100, Frederik Eaton wrote: By the way, I replied to this via email because I can't figure out how to annotate the bug anymore

Re: [Haskell-cafe] Is there a best *nix or BSD distro for Haskell hacking?

2007-04-22 Thread Stefan O'Rear
On Sun, Apr 22, 2007 at 10:02:32AM -0400, David Cabana wrote: I have a spare Windows machine I want to put to better use. I want to turn it into a Haskell hacking box, and was wondering whether any particular *nix or BSD distribution is best (or worst) suited for this. Any thoughts?

Re: [Haskell-cafe] Re: Haskell version of Norvig's Python Spelling Corrector

2007-04-22 Thread Stefan O'Rear
On Sun, Apr 22, 2007 at 10:10:44PM +0200, Ketil Malde wrote: On Sun, 2007-04-22 at 11:51 -0400, Pete Kazmier wrote: type WordFreq = M.Map B.ByteString Int train:: [B.ByteString] - WordFreq train words = frequencyMap where frequencyMap = foldr incWordCount

Re: [Haskell-cafe] question about Data.Binary and Double instance

2007-04-22 Thread Stefan O'Rear
On Sun, Apr 22, 2007 at 10:43:23PM +0100, Ian Lynagh wrote: On Tue, Apr 17, 2007 at 11:42:40PM -0400, Brian Alliet wrote: Perhaps we just don't care about ARM or other arches where GHC runs that Are there really any architectures supported by GHC that don't use IEEE floating point?

Re: [Haskell] Haddock and type operators

2007-04-18 Thread Stefan O'Rear
On Wed, Apr 18, 2007 at 07:29:21PM +0200, Wolfgang Jeltsch wrote: Hello everybody, I urgently need Haddock support for type operators like in the following code snippet: infix 2 :::, := infixl 9 :.: data name ::: value = name := value newtype Composition f g a =

Apparent contradiction in H98 prescribed behavior of 'data X = (:+){ x :: Int, y :: Int } deriving(Show)'

2007-04-17 Thread Stefan O'Rear
Given: data X = (:*){ x :: Int, y :: Int } deriving(Show) which is syntactically correct: constr - con { fielddecl[1] , ... , fielddecl[n] } (n=0) con - ( consym ) and the following from 10.4: * If the constructor is defined to be an infix operator, then the derived Read

Re: [Haskell-cafe] Parallel executing of actions

2007-04-17 Thread Stefan O'Rear
On Tue, Apr 17, 2007 at 05:49:11PM -0700, Juan Carlos Arevalo Baeza wrote: I may be talking out of my other end here, but... if you want something like parMap to calculate all the pixels in parallel, then... can't you use parMap itself? Something like: weirdParMap action =

Re: [Haskell-cafe] Re: Type classes and type equality

2007-04-17 Thread Stefan O'Rear
On Wed, Apr 18, 2007 at 01:47:04AM +0100, Neil Mitchell wrote: - If we permit undecidable instances, one may assign numerals to types. This gives us total order and hence comparison on types. In this approach, we only need N instances to cover N types. This is still better than Typeable

Re: Release plans

2007-04-16 Thread Stefan O'Rear
On Mon, Apr 16, 2007 at 03:54:56PM +0100, Simon Marlow wrote: - left-to-right impredicative instantiation: runST $ foo This concerns me. With each ad-hoc extension of the type system, I worry that soon the GHC type system will become so byzantine and ill-specified that the type checker can only

Re: [Haskell-cafe] Re: [web-devel] A light-weight web framework

2007-04-16 Thread Stefan O'Rear
On Mon, Apr 16, 2007 at 07:09:10PM -0400, S. Alexander Jacobson wrote: On Tue, 10 Apr 2007, Marc Weber wrote: Right now, you can largely do the same thing, but you have to write the XML representations of your data structures manually. -Alex- I'm not sure but doesn't use HAppS kind of

[Haskell] ANN: wl-pprint-1.0: Wadler/Leijen pretty printer

2007-04-15 Thread Stefan O'Rear
Announcing wl-pprint-1.0, the classic Wadler / Leijen pretty printing combinators, now in 100% easier to use Cabalised form! Synopsis: PPrint is an implementation of the pretty printing combinators described by Philip Wadler (1997). In their bare essence, the combinators of Wadler are not

Re: [Haskell] ANN: wl-pprint-1.0: Wadler/Leijen pretty printer

2007-04-15 Thread Stefan O'Rear
On Mon, Apr 16, 2007 at 12:10:01AM +0100, Joel Reymont wrote: On Apr 15, 2007, at 8:19 PM, Stefan O'Rear wrote: PPrint is an implementation of the pretty printing combinators described by Philip Wadler (1997). In their bare essence, the combinators of Wadler are not expressive enough

Re: [Haskell-cafe] LL(1) parsing of declarators

2007-04-15 Thread Stefan O'Rear
too much to add knowledge of C's keywords. Then I thought of the typedef problem. On Apr 15, 2007, at 04:52 , Stefan O'Rear wrote: I'm writing a code generator for C, and I'm trying to parse a C-like input language using LL(1) (parsec specifically). The syntax of declarators is giving me

Re: [Haskell-cafe] and sequencing [newbie]

2007-04-15 Thread Stefan O'Rear
On Sun, Apr 15, 2007 at 08:04:41PM -0400, David Powers wrote: so... this is likely a question based on serious misunderstandings, but can anyone help me understand the exact mechanism by which monads enforce sequencing? Specifically, I'm confused by the operator. If I understand things

Re: [Haskell-cafe] Do monads imply laziness?

2007-04-14 Thread Stefan O'Rear
On Sat, Apr 14, 2007 at 10:56:44AM -0400, Brian Hurt wrote: This is probably an off-topic question, but I can't think of a better forum to ask it: does the existance of monads imply laziness in a language, at least at the monadic level? Consider the following: a purely functional,

Re: [Haskell-cafe] Calling C function in Mac OS X

2007-04-14 Thread Stefan O'Rear
On Sat, Apr 14, 2007 at 07:58:25PM +0400, Sergey Perminov wrote: I wish to optimize Haskell code using ByteString, direct reading Doubles form it, direct writing Doubles to it. I've tried Don Stewart's code http://hpaste.org/26 that uses calling to C functions to implement necessary

[Haskell-cafe] LL(1) parsing of declarators

2007-04-14 Thread Stefan O'Rear
I'm writing a code generator for C, and I'm trying to parse a C-like input language using LL(1) (parsec specifically). The syntax of declarators is giving me trouble: (simplified) declaration = qualifiers (declarator `sepBy1` char ',') qualifiers = many1 name declarator = name now if we have

Re: [Haskell-cafe] multithreading speedup

2007-04-13 Thread Stefan O'Rear
On Sat, Apr 14, 2007 at 12:27:10AM +0200, Fawzi Mohamed wrote: I was trying to speed up a program that I wrote and so I thought about using multiple threads. I have a quite easy parallel program and I did the following do subRes - MVar.newMVar [] putStrLn starting threads

Re: [Haskell-cafe] multithreading speedup

2007-04-13 Thread Stefan O'Rear
On Sat, Apr 14, 2007 at 01:31:58AM +0200, Fawzi Mohamed wrote: Il giorno Apr 14, 2007, alle ore 12:33 AM, Stefan O'Rear ha scritto: On Sat, Apr 14, 2007 at 12:27:10AM +0200, Fawzi Mohamed wrote: I was trying to speed up a program that I wrote and so I thought about using multiple threads

Re: [Haskell-cafe] Type checking with Haskell

2007-04-12 Thread Stefan O'Rear
On Thu, Apr 12, 2007 at 01:04:13PM +0100, Joel Reymont wrote: Folks, The ghc/compiler/typecheck directory holds a rather large body of code and quick browsing through did not produce any insight. How do you implement type checking in haskell? Assume I have an Expr type with a

Re: [Haskell-cafe] k-minima in Haskell

2007-04-11 Thread Stefan O'Rear
On Thu, Apr 12, 2007 at 08:58:33AM +0530, raghu vardhan wrote: What's the best way to implement the following function in haskell: Given a list and an integer k as input return the indices of the least k elements in the list. The code should be elegant and also, more importantly, must not make

Re: [Haskell-cafe] k-minima in Haskell

2007-04-11 Thread Stefan O'Rear
On Wed, Apr 11, 2007 at 08:38:48PM -0700, Stefan O'Rear wrote: On Thu, Apr 12, 2007 at 08:58:33AM +0530, raghu vardhan wrote: What's the best way to implement the following function in haskell: Given a list and an integer k as input return the indices of the least k elements in the list

Re: [Haskell-cafe] k-minima in Haskell

2007-04-11 Thread Stefan O'Rear
On Wed, Apr 11, 2007 at 09:20:12PM -0700, Tim Chevalier wrote: On 4/11/07, Stefan O'Rear [EMAIL PROTECTED] wrote: If you want to be really explicit about it, here is a sort that will work: sort [] = [] sort l@(x:_) = filter (x) l ++ filter (==x) l ++ filter (x) l (A stable quicksort

Re: [Haskell-cafe] A convenient way to deal with conditional function composition?

2007-04-10 Thread Stefan O'Rear
On Tue, Apr 10, 2007 at 02:33:41PM +0100, Chris Kuklewicz wrote: Well, since ((.) :: ShowS - ShowS - ShowS) is a Monoid, you can use Writer to create the result: Not portably. [EMAIL PROTECTED]:~$ ghc-6.4.2 -e '( (foo++) `Data.Monoid.mappend` (bar++) ) END' foobarEND [EMAIL PROTECTED]:~$

[Haskell-cafe] Re: What I learned from my first serious attempt low-level Haskell programming

2007-04-10 Thread Stefan O'Rear
On Tue, Apr 10, 2007 at 07:59:04PM +0100, Lennart Augustsson wrote: So then tail calls should be very cheap when most of the arguments don't change. On Apr 10, 2007, at 10:17 , Simon Marlow wrote: Lennart Augustsson wrote: It's not that hard to figure out an order to permute the

Re: [Haskell-cafe] Prettyprinting infix expressions with HughesPJ

2007-04-10 Thread Stefan O'Rear
On Tue, Apr 10, 2007 at 09:20:52AM +0200, Alfonso Acosta wrote: I have to prettyprint infix expressions writing the least possible parenthesis (taking in account precedence and associativity). A simplified expression type could be: Your use of 'have' is slightly suspicious here. That said,

Re: [Haskell-cafe] Type checking and locating token with Parsec

2007-04-10 Thread Stefan O'Rear
On Tue, Apr 10, 2007 at 02:09:03PM +0100, Joel Reymont wrote: Folks, Imagine a language where Num + Num yields a Num and Str + Num yields a Str but Num + Str should not be allowed. I implemented parsing for such a language in OCaml with a yacc-based parser without an additional

Re: [Haskell-cafe] Prettyprinting infix expressions with HughesPJ

2007-04-10 Thread Stefan O'Rear
On Wed, Apr 11, 2007 at 01:53:49AM +0200, Alfonso Acosta wrote: On 4/11/07, Stefan O'Rear [EMAIL PROTECTED] wrote: Your use of 'have' is slightly suspicious here. That said, the rest of your problem looks very un-homework-y, so I'll look at it. It's for my masters thesis (big piece of badly

Re: [Haskell-cafe] operating on a hundred files at once

2007-04-09 Thread Stefan O'Rear
On Mon, Apr 09, 2007 at 09:24:30PM -0400, Jefferson Heard wrote: It is indeed! Is that to be found in Control.Monad, I take it? It's in the Prelude, so you don't have to import anything to get it. Stefan ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Function call by string

2007-04-08 Thread Stefan O'Rear
On Sun, Apr 08, 2007 at 03:26:25PM +0200, Philipp Volgger wrote: Well, the Haskell files are not the problem, they don't have to be built automatically. The point is that I want to call functions in a Haskell function if I get their names as strings. Isn't there any possibilty to do that?

Re: [Haskell-cafe] MPTC and type classes issue (polymorphic '+')

2007-04-07 Thread Stefan O'Rear
On Sat, Apr 07, 2007 at 01:07:48PM +0100, Joel Reymont wrote: Folks, I'm trying to save time when typing in my ASTs so I thought I would create a Plus class like this (I do hide the one from Prelude) class PlusClass a b c | a b - c where (+) :: a - b - c {- instance (Integral a,

Re: [Haskell-cafe] Yi pre-release

2007-04-07 Thread Stefan O'Rear
On Sun, Apr 08, 2007 at 12:13:48AM +0200, Bas van Dijk wrote: [EMAIL PROTECTED] ~/development/haskell/yi $ runhaskell Setup.hs build *** Exception: failed to extract ghc path from command line (Disclaimer: I'm only going by what I've heard on #haskell) That would be a symptom of trying to

Re: [Haskell-cafe] ANN: XMPP 0.0.1

2007-04-07 Thread Stefan O'Rear
On Sat, Apr 07, 2007 at 06:34:21PM -0700, Stefan O'Rear wrote: On Sun, Apr 08, 2007 at 02:03:03AM +0200, Magnus Henoch wrote: I'm hacking a library for writing XMPP clients, and just decided that my work is good enough to call it version 0.0.1. Find source and documentation here

Re: [Haskell-cafe] ANN: XMPP 0.0.1

2007-04-07 Thread Stefan O'Rear
On Sat, Apr 07, 2007 at 08:01:41PM -0700, Jeremy Shaw wrote: Also, anyone interested in making an XMPP library should probably be aware of the development version of HaXml: http://www.cs.york.ac.uk/fp/HaXml-devel/ which includes this module:

Re: [Haskell] -compiler-options vs {#-LANGUAGE Flags-#}

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 10:42:09AM -0700, John Meacham wrote: On Sat, Mar 24, 2007 at 01:18:30PM +0100, Lennart Kolmodin wrote: I think the LANGUAGE pragma is much better than OPTIONS_GHC, for several reasons. * It's compiler independent. * It's clear that you're only adding

Re: [Haskell] Fixpoint combinator without recursion

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 06:26:17PM -0300, Felipe Almeida Lessa wrote: I know that types like data T = T (T - T) are inhabitated by things other than bottom (like id or \_ - undefined), but can it be useful for *anything*? Yes. In particular, types like those can produce an explicit

Re: [Haskell-cafe] Automatic derivation (TemplateHaskell?)

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 02:47:21PM +0100, Joel Reymont wrote: Here's the output from -ddump-splices (thanks Saizan for the tip). It's returning a1 instead of a0. ghci -fth -e '$( _derive_print_instance makeFunParser Foo )' baz.hs -ddump-splices baz.hs:1:0: baz.hs:1:0: Splicing

Re: [Haskell-cafe] What I learned from my first serious attempt low-level Haskell programming

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 02:50:49PM +0400, Bulat Ziganshin wrote: Hello Stefan, Thursday, April 5, 2007, 3:11:31 AM, you wrote: 2. Parameters are very expensive. you should look at the asm code GHC generates. afair parameters are kept in stack and copied on each call (to the same

Re: [Haskell-cafe] Automatic derivation (TemplateHaskell?)

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 03:19:15PM +0100, Joel Reymont wrote: numExpr :: GenParser Char a NumExpr numExpr = choice [ integer = return . Int , float = return . Num ] Parsec's choice operator works by parsing the first, and only parsing the second if the first fails

Re: [Haskell-cafe] Short-circuiting a fold

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 02:09:12PM -0400, Kurt Hutchinson wrote: Here's a bit of Thursday afternoon fun. Mission: Define ssfold, a short-circuiting fold. It evaluates to the folded value that first satisfies the given predicate. ssfold :: ( a - Bool ) - ( a - b - a ) - a - [b] - a Here

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Stefan O'Rear
On Wed, Apr 04, 2007 at 07:39:24PM +0100, Edsko de Vries wrote: Hey, It is well-known that negative datatypes can be used to encode recursion, without actually explicitly using recursion. As a little exercise, I set out to define the fixpoint combinator using negative datatypes. I think the

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Stefan O'Rear
On Wed, Apr 04, 2007 at 01:36:18PM -0700, Michael Vanier wrote: For those of us who aren't type theorists: What's a negative datatype? Negative isn't the usual term; we mostly call them 'contravariantly recursive' data types, due to CT influence. Anyways the thing to note is that the value

Re: [Haskell-cafe] My Unification Sorrows

2007-04-04 Thread Stefan O'Rear
I received the file with seriously damaged layout; in case anyone else has the same issue, I've hosted a cleaned up version: http://members.cox.net/stefanor/Procyon.hs Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] My Unification Sorrows

2007-04-04 Thread Stefan O'Rear
I seem to have did an accidental reply-to-sender at first: On Wed, Apr 04, 2007 at 01:37:44PM -0700, Paul Berg wrote: Ok, so I decided to implement an algorithm to build Strongly Typed Genetic Programming trees in Haskell, in an effort to learn Haskell, and I'm way over my head on this

Re: [Haskell-cafe] Re: QuickCheck: Arbitrary for a complex type

2007-04-04 Thread Stefan O'Rear
On Wed, Apr 04, 2007 at 10:59:45PM +0100, Joel Reymont wrote: One last bit then... My identifiers should start with letter | char '_' and the tail should be alphaNum | char '_'. I guess I can use choose and oneof to produce the right set of characters but how do I combine the two

[Haskell-cafe] What I learned from my first serious attempt low-level Haskell programming

2007-04-04 Thread Stefan O'Rear
As a learning excersize, I re-wrote and re-optimized Data.Binary.Builder yesterday. 1. Intuition is NOT your friend. Most obvious pessimizations I made were actually wins, and vice versa. 2. Parameters are very expensive. Our type of functions that build (ignoring CPS for the time being)

Re: [Haskell-cafe] Automatic derivation (TemplateHaskell?)

2007-04-04 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 12:14:52AM +0100, Joel Reymont wrote: Folks, I have very uniform Parsec code like this and I'm wondering if I can derive it using TemplateHaskell or DrIFT or some other tool. Any ideas? Note that 1) The reserved word matches the constructor 2) No arguments

Re: [Haskell-cafe] My Unification Sorrows

2007-04-04 Thread Stefan O'Rear
On Wed, Apr 04, 2007 at 07:16:35PM -0700, Paul Berg wrote: I believe I may have found a solution (I *think* it's correct): The occurs check needs to stay, but be modified for infinite types. When the occurs check is true, instead of failing, we should keep the constraint, but skip performing

Re: [Haskell] ANNOUNCE: Debian library

2007-04-03 Thread Stefan O'Rear
On Tue, Apr 03, 2007 at 01:00:07PM -0700, Jeremy Shaw wrote: Hello, I would like to announce the availability of the a library for interacting with the Debian system. This library does not (currently) depend on dpkg or apt for any functionality. Contributions are welcome. You should

Re: [Haskell] ANNOUNCE: Debian library

2007-04-03 Thread Stefan O'Rear
On Tue, Apr 03, 2007 at 03:04:51PM -0700, Jeremy Shaw wrote: At Tue, 3 Apr 2007 13:04:36 -0700, Sounds like your duplicating a lot of the functionality of jgoerzen's MissingH library. http://software.complete.org/missingh yes. but better ;) Ok then. Not all of your functionality is

Re: [Haskell-cafe] Binary I/O

2007-04-02 Thread Stefan O'Rear
On Mon, Apr 02, 2007 at 03:26:05PM +0100, Daniel Brownridge wrote: Hello. I am a Computer Science student attempting to write an emulator using Haskell. One of my main design choices is how to deal with machine code. Clearly it is possible to represent 0's and 1's as ASCII characters,

Re: [Haskell-cafe] Lambdabot not running on XP

2007-03-29 Thread Stefan O'Rear
On Thu, Mar 29, 2007 at 08:29:51PM +0100, Iain Alexander wrote: I eventually persuaded Plugin.Pl.Transform.hs to compile by disabling the optimisation, and with other bits of hackery got lambdabot to build. When I run it as lambdabot I get Initialising plugins. (with lots of '.'s,

Re: GADT + Newtype deriving = Erroneous errors

2007-03-28 Thread Stefan O'Rear
On Wed, Mar 28, 2007 at 12:03:41PM +0100, Chris Kuklewicz wrote: Stefan O'Rear wrote: On Tue, Mar 27, 2007 at 11:32:29AM +0100, Chris Kuklewicz wrote: Stefan O'Rear wrote: newtype Foo = Foo Int deriving(IsIntC) Note that (Foo 2) + 2 is an attempt to add a Foo and an Int, which

Re: GADT + Newtype deriving = Erroneous errors

2007-03-27 Thread Stefan O'Rear
On Tue, Mar 27, 2007 at 11:32:29AM +0100, Chris Kuklewicz wrote: Stefan O'Rear wrote: This code causes GHC to incorrectly fail - the case *is* reachable. (I invented this technique in an attempt to directly access the internal System FC newtype coercion; it promised until a few minutes

Re: [GHC] #1246: = operators get compiled worse than ==

2007-03-26 Thread Stefan O'Rear
On Mon, Mar 26, 2007 at 09:15:35PM -0700, John Meacham wrote: actually, this is not true for the specific case of testing against zero on x86 at least. there is a 'zero flag' that is set whenever the result of an operation is zero. whereas for compares, you actually need to load zero into a

Re: [GHC] #1246: = operators get compiled worse than ==

2007-03-26 Thread Stefan O'Rear
On Mon, Mar 26, 2007 at 09:31:41PM -0700, John Meacham wrote: On Mon, Mar 26, 2007 at 09:23:13PM -0700, Stefan O'Rear wrote: On Mon, Mar 26, 2007 at 09:15:35PM -0700, John Meacham wrote: actually, this is not true for the specific case of testing against zero on x86 at least

[Haskell-cafe] Re: Why the Prelude must die

2007-03-25 Thread Stefan O'Rear
On Sun, Mar 25, 2007 at 04:05:51PM +0100, Ian Lynagh wrote: I've submitted: http://hackage.haskell.org/trac/haskell-prime/ticket/124 which I hope covers the essence of the result of this thread. My goal of sparking thought was sucessful :) I like Claus Reinke's proposal, it solves

Re: [Haskell-cafe] newbie concatenating monad question

2007-03-24 Thread Stefan O'Rear
On Sat, Mar 24, 2007 at 08:05:25PM +, Paul Johnson wrote: strings, are instances of the Monoid class (i.e. they implement mplus in the way you would expect). You just have to wrap a function around Actually they don't. [EMAIL PROTECTED]:/tmp$ ghc-6.4.2 -v0 -e 'main' X.hs ABend [EMAIL

Re: [Haskell-cafe] runST $ return () /= runST (return ()) ??

2007-03-24 Thread Stefan O'Rear
On Sun, Mar 25, 2007 at 01:28:53AM +0100, Marc A. Ziegert wrote: hi! i've just discovered this strange behaviour of existential quantifiers with runST: --- Prelude Control.Monad.ST :t runST (return ()) runST (return ()) :: () Prelude Control.Monad.ST :t runST $ (return ())

Re: [Haskell-cafe] runST $ return () /= runST (return ()) ??

2007-03-24 Thread Stefan O'Rear
On Sat, Mar 24, 2007 at 05:33:55PM -0700, Stefan O'Rear wrote: types. Therefore the application (runST id) is illegal. (Sadly GHC This should have been (id runST), oops. Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Link error in ALUT Hello, World

2007-03-24 Thread Stefan O'Rear
On Sun, Mar 25, 2007 at 11:38:56AM +0900, Nobuhito Mori wrote: Hi, I installed OpenAL and ALUT bindings downloaded from http://hackage.haskell.org/packages/archive/pkg-list.html and tried compilation of HelloWorld.hs example which I got from http://darcs.haskell.org/packages/ALUT/ But

Re: [Haskell-cafe] Link error in ALUT Hello, World

2007-03-24 Thread Stefan O'Rear
On Sun, Mar 25, 2007 at 11:56:28AM +0900, Nobuhito Mori wrote: Thanks for reply. I'll report a bug if there is no new reply in two days. Why do you want to wait? Reporting a bug is no more disruptive than posting on the ML .. and it's obviously not your fault, since the code isn't yours. Also,

Re: [Haskell-cafe] Link error in ALUT Hello, World

2007-03-24 Thread Stefan O'Rear
On Sun, Mar 25, 2007 at 12:24:52PM +0900, Nobuhito Mori wrote: I thought bug report is more official than ML. So I wanted to make this problem more clear if possible (in other words, I'm a beginner of Haskell and I was not convinced that this problem is suited to bug report). Now O.K. I'll

[Haskell-cafe] What ever happened to Haskell 98 as a stable branch?

2007-03-24 Thread Stefan O'Rear
Upon more reflection... From the Preface to the Haskell 98 Language and Libraries Report: Haskell 98 was conceived as a relatively minor tidy-up of Haskell 1.4, making some simplifications, and removing some pitfalls for the unwary. It is intended to be a stable language in sense the

[Haskell-cafe] Why the Prelude must die

2007-03-23 Thread Stefan O'Rear
This is a ranty request for comments, and the more replies the better. 1. Namespace pollution The Prelude uses many simple and obvious names. Most programs don't use the whole Prelude, so names that aren't needed take up namespace with no benefit. 2. Monomorphism The Prelude defines many data

<    1   2   3   4   5   6   >