Re: [Haskell-cafe] contributing to standard library

2008-08-27 Thread Bulat Ziganshin
Hello Tim, Wednesday, August 27, 2008, 1:49:51 AM, you wrote: > Like everyone else who has used Haskell for a while, I'm accumulating > functions which I feel should have already been in the standard > libraries i have such module with 100+ functions. should i propose to add them all too? :) -

[Haskell-cafe] apparent minor bug in "Getting started" tutorial at "Haskell Hacking: a journal of Haskell programming"

2008-08-27 Thread Benjamin L . Russell
This is just a minor documentation bug report, but I tried following the instructions in the "Getting started" tutorial at "Haskell Hacking: a journal of Haskell programming" (http://cgi.cse.unsw.edu.au/~dons/blog/2006/12/16#programming-haskell-intro) for GHCi 6.8.3 on Windows XP Professional (Serv

[Haskell-cafe] Re: apparent minor bug in "Getting started" tutorial at "Haskell Hacking: a journal of Haskell programming"

2008-08-27 Thread Benjamin L . Russell
On Wed, 27 Aug 2008 16:22:56 +0900, Benjamin L.Russell <[EMAIL PROTECTED]> wrote: Sorry, what I really meant was not to update the reference to "a.out" to be changed to "main.exe", but to change the following line: >>This produces a new executable, ./a.out (a.out.exe on windows), which you can >

[Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello haskell-cafe, solving one more task that uses English dictionary, i've thought: why we don't yet have pure hashtable library? There is imperative hashtables, pretty complex as they need to rebuild entire table as it grows. There is also simple assoc lists and tree/trie implementations, bu

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
Lennart Augustsson wrote: BTW, I'm not contradicting that the use of global variables can be necessary when interfacing with legacy code, I just don't think it's the right design when doing something new. AFAICS the use of top level mutable state in the base libs has nothing at all to do with i

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Jason Dusek
Bulat Ziganshin <[EMAIL PROTECTED]>: > given these constraints, it should be just a 10-20 lines of > code, and provide much better efficiency than any tree/trie > implementations Much better efficiency in what way? -- _jsn ___ Haskell-Cafe mailing lis

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
Lennart Augustsson wrote: I told you where to look at code. It's C code, mind you, but written in a decent way. No well written device driver ever accesses memory or IO ports directly, doing so would seriously hamper portability. Well something must be accessing both. Dunno what you mean by "d

Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello Jason, Wednesday, August 27, 2008, 11:55:31 AM, you wrote: >> given these constraints, it should be just a 10-20 lines of >> code, and provide much better efficiency than any tree/trie >> implementations > Much better efficiency in what way? instead of going through many levels of tree/

Re: Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Thomas Davie
On 27 Aug 2008, at 10:09, Bulat Ziganshin wrote: Hello Jason, Wednesday, August 27, 2008, 11:55:31 AM, you wrote: >> given these constraints, it should be just a 10-20 lines of >> code, and provide much better efficiency than any tree/trie >> implementations > Much better efficiency in wha

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Lennart Augustsson
I've also written quite a few hosted and non-hosted device drivers (in C). None of them have any global variables. On Wed, Aug 27, 2008 at 9:07 AM, Adrian Hey <[EMAIL PROTECTED]> wrote: > Lennart Augustsson wrote: >> >> I told you where to look at code. It's C code, mind you, but written >> in a

RE: Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bayley, Alistair
> From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Davie > > > Much better efficiency in what way? > > instead of going through many levels of tree/trie, > lookup function will just select array element by hash value > and look through a few elements in ass

Re: [Haskell-cafe] Building SDL-image package on Windows

2008-08-27 Thread Bit Connor
Hi, I wrote the instructions in the WIN32 file. This looks like the same problem that I originally had with the SDL package, mangling of "main" function in C land by the hand of the C SDL.h include file. If you look at the .hsc files from the SDL package, you will see the fix I applied at the top

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
Lennart Augustsson wrote: I've also written quite a few hosted and non-hosted device drivers (in C). None of them have any global variables. The point is to be able to properly model, understand and if necessary implement *entire systems* without using "global variables" (allegedly). You can a

Re: Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Thomas Davie
On 27 Aug 2008, at 10:39, Bayley, Alistair wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Davie > Much better efficiency in what way? instead of going through many levels of tree/trie, lookup function will just select array element by hash value

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread John Meacham
On Wed, Aug 27, 2008 at 02:23:04AM +0100, Lennart Augustsson wrote: > BTW, I'm not contradicting that the use of global variables can be > necessary when interfacing with legacy code, I just don't think it's > the right design when doing something new. As with all design decisions, it is sometimes

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Stephan Friedrichs
Bulat Ziganshin wrote: > solving one more task that uses English dictionary, i've thought: why we > don't yet have pure hashtable library? There is imperative hashtables, > [...] > how should it look: > > * hashtable is represented as an array of assoc lists: Array Int [(a,b)] Don't immutable arr

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Johannes Waldmann
>> * hashtable is represented as an array of assoc lists: Array Int [(a,b)] > > Don't immutable arrays get rather inefficient when modified? Bulat was specifically asking for "simple *non-modifiable* hashes" http://article.gmane.org/gmane.comp.lang.haskell.cafe/43612 J.W. signature.asc Descr

[Haskell-cafe] darcs weekly news #1

2008-08-27 Thread Eric Kow
Hi everybody, I thought it would be useful if we got back into the habit up summarising our weekly darcs activities. This is the first entry of what I hope to be Darcs Weekly News. Note that I have also Bcc'ed the Haskell Cafe; which I will not be doing everytime, but just this once :-) News an

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
John Meacham wrote: As with all design decisions, it is sometimes the right thing and sometimes the wrong one. And sometimes the most expedient. (which, occasionally, is a perfectly valid driving force behind a certain bit of coding). However, I am fully convinced it is necessary. You don't even

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread David Roundy
On Wed, Aug 27, 2008 at 1:58 AM, Jason Dagit <[EMAIL PROTECTED]> wrote: >> 2) Compile GHC yourself. You can even compile and install GHC (and most >> Haskell software) on a dedicated user account. In this way you avoid >> messing up you Debian installation if something goes wrong. > > I find with D

Re: [Haskell-cafe] 2 modules in one file

2008-08-27 Thread Malcolm Wallace
Maurí­cio <[EMAIL PROTECTED]> wrote: > Is it allowed to write two > different modules in a single > file? Some compilers permit it (e.g. Freja), most do not (e.g. ghc). The Language Report makes no specification for the mapping between module sources and the files that contain them. Regards,

Re: [Haskell-cafe] Re: problem with cabal for syb-with-class

2008-08-27 Thread Claus Reinke
Cabal doesn't have to pass on ghc's messages uninterpreted. That's a lot like implementing a map as a list and complaining about empty list instead of element not found. I see what you're saying, but in practise it's just not possible. GHC can return a non-zero exit code for a multitude of reaso

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
Ashley Yakeley wrote: Adrian Hey wrote: Maybe it would be safest to just say anything with a finaliser can't be created at the top level. Do you have an example of something that is correctly ACIO to create, but has a problematic finaliser? Sorry for the delay in getting my attention. I've

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Jan-Willem Maessen
On Aug 27, 2008, at 3:41 AM, Bulat Ziganshin wrote: Hello haskell-cafe, solving one more task that uses English dictionary, i've thought: why we don't yet have pure hashtable library? There is imperative hashtables, pretty complex as they need to rebuild entire table as it grows. There is

[Haskell-cafe] best runProcess solution to work with windows and linux

2008-08-27 Thread Andrew U. Frank
i use System.POSIX.IO to run a process and access the handles (after due transformation) to get the values back. this solution is unfortunately not portable and works only on unix (or cygwin) but not for plain windows. there seems to be a somewhat comparable package in system.win32.process. is ther

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
Judah Jacobson wrote: I've been wondering: is there any benefit to having top-level ACIO'd <- instead of just using runOnce (or perhaps "oneshot") as the primitive for everything? For example: oneshot uniqueRef :: IO (MVar Integer) uniqueRef =< newMVar 0 I've been wondering about something li

Re: [Haskell-cafe] Re: [Haskell] Another First course in Haskell

2008-08-27 Thread Darrin Thompson
On Sat, Aug 23, 2008 at 8:41 AM, Johannes Waldmann < [EMAIL PROTECTED]> wrote: > (*) that's the main problem I see with Hutton's book > http://www.cs.nott.ac.uk/~gmh/book.html: > it has "Declaring types and classes" as chapter 10 (of 13 total). > I think

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread John Meacham
I think a strong advantage of the straight up ACIO formulation (rather than a one-shot IO based thing) is that it can be fully, correctly, and safely be defined without referencing the IO monad or its interaction with the IO monad at all. In practice, ACIO will be generally be used to interact with

Re: [Haskell-cafe] Re: [Haskell] Another First course in Haskell

2008-08-27 Thread Neil Mitchell
Hi > (*) that's the main problem I see with Hutton's book > http://www.cs.nott.ac.uk/~gmh/book.html : > it has "Declaring types and classes" as chapter 10 (of 13 total). > I think that's way off - and it leaves readers (students) > with the impression that declarative programming > basically deals

Re: [Haskell-cafe] Re: [Haskell] Another First course in Haskell

2008-08-27 Thread Johannes Waldmann
Darrin Thompson wrote: > If functions on lists isn't the thing, what is the thing? "Data structures" > isn't a very satisfactory answer for a n00b like me, because it doesn't > capture Haskell's distinctive. [...] Well indeed you can (should) have problem-specific (algebraic) data types in any la

Re: [Haskell-cafe] Re: [Haskell] Another First course in Haskell

2008-08-27 Thread Neil Mitchell
> That book is about teaching Haskell, not advertising it. If I wanted > to advertise how cool Haskell was, I probably wouldn't dwell on lists. > But to learn Haskell, I spent the first few years doing either list > processing or very simple algebraic data types, and I think it made me > a better p

Re: [Haskell-cafe] best runProcess solution to work with windows and linux

2008-08-27 Thread Philip Weaver
On Wed, Aug 27, 2008 at 5:40 AM, Andrew U. Frank <[EMAIL PROTECTED] > wrote: > i use System.POSIX.IO to run a process and access the handles (after due > transformation) to get the values back. > this solution is unfortunately not portable and works only on unix (or > cygwin) but not for plain win

[Haskell-cafe] HEq and Context reduction stack overflow

2008-08-27 Thread Marc Weber
On Mon, Aug 25, 2008 at 09:17:19PM -0400, jeff p wrote: > The HList paper (http://homepages.cwi.nl/~ralf/HList/) presents a Thanks Jeff -- packages: HList {-# OPTIONS_GHC -fallow-undecidable-instances -XEmptyDataDecls -XMultiParamTypeClasses #-} module Main where

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Adrian Hey
Lennart Augustssom wrote: Since at some point you have to interface with the hardware you are forced to obey whatever convention is used for interrupts etc. At that point you may very well have to use global variables. But you can quickly abstract away from that in stay in the safe land without

Re: [Haskell-cafe] Re: apparent minor bug in "Getting started" tutorial at "Haskell Hacking: a journal of Haskell programming"

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 3:28, Benjamin L.Russell wrote: On Wed, 27 Aug 2008 16:22:56 +0900, Benjamin L.Russell <[EMAIL PROTECTED]> wrote: Sorry, what I really meant was not to update the reference to "a.out" to be changed to "main.exe", but to change the following line: This produces a new executabl

Re: [Haskell-cafe] 2 modules in one file

2008-08-27 Thread Yitzchak Gale
Maurí­cio wrote: >> Is it allowed to write two >> different modules in a single >> file? That would be a really nice feature, especially since modules are Haskell's only encapsulation tool. You want it to be a lightweight as possible. Malcolm Wallace wrote: > Some compilers permit it (e.g. Freja)

Re: [Haskell-cafe] Re: [Haskell] Another First course in Haskell

2008-08-27 Thread Johannes Waldmann
Neil Mitchell wrote: >> If you want to program Haskell, get the basics sorted. Once you have >> sorted the basics of functional programming, you can move on to the >> Haskell specific bits. The course I learnt from at York left out >> things such as modules, type classes (beyond slight Eq/Ord >> s

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Jules Bean
Bulat Ziganshin wrote: Hello haskell-cafe, solving one more task that uses English dictionary, i've thought: why we don't yet have pure hashtable library? There is imperative hashtables, pretty complex as they need to rebuild entire table as it grows. There is also simple assoc lists and tree

Re: [Haskell-cafe] 2 modules in one file

2008-08-27 Thread Henrik Nilsson
Hi, Yitzchak Gale wrote: > But for large and complex projects, this policy really complicates > the task of the project manager who wants to be able to > present various views of the source to teams working on > different subprojects, while juggling the version control > in an intelligent way. D

Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello Jules, Wednesday, August 27, 2008, 7:21:46 PM, you wrote: >> given these constraints, it should be just a 10-20 lines of code, and >> provide much better efficiency than any tree/trie implementations > Prove it. > To get "much better efficient" than a trie, the hash function has to be >

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Jed Brown
On Wed 2008-08-27 16:21, Jules Bean wrote: > Bulat Ziganshin wrote: >> Hello haskell-cafe, >> >> solving one more task that uses English dictionary, i've thought: why we >> don't yet have pure hashtable library? There is imperative hashtables, >> pretty complex as they need to rebuild entire tabl

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Daniel Fischer
Am Mittwoch, 27. August 2008 17:36 schrieb Bulat Ziganshin: > Hello Jules, > > Wednesday, August 27, 2008, 7:21:46 PM, you wrote: > >> given these constraints, it should be just a 10-20 lines of code, and > >> provide much better efficiency than any tree/trie implementations > > > > Prove it. > > >

Re: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Jules Bean
Bulat Ziganshin wrote: Hello Jules, Wednesday, August 27, 2008, 7:21:46 PM, you wrote: given these constraints, it should be just a 10-20 lines of code, and provide much better efficiency than any tree/trie implementations Prove it. To get "much better efficient" than a trie, the hash f

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread David House
2008/8/25 Ketil Malde <[EMAIL PROTECTED]>: > 1. Etch comes with ghc-6.6, and that didn't work with my .cabal file. Is it not an option to make your software work with the not-quite-latest compiler? 6.8 is less than a year old, so I imagine 6.6 is still in quite a few major distro's stable reposito

Re: [Haskell-cafe] HEq and Context reduction stack overflow, non optimal ghc behaviour ?

2008-08-27 Thread Marc Weber
> -- packages: HList > {-# OPTIONS_GHC -fallow-undecidable-instances -XEmptyDataDecls > -XMultiParamTypeClasses #-} > module Main where > import Data.HList > import HAppS.Data > import System.Environment > > > class TypeTo

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 11:53 +0100, Adrian Hey wrote: > John Meacham wrote: > > As with all design decisions, it is sometimes the right thing and > > sometimes the wrong one. And sometimes the most expedient. (which, > > occasionally, is a perfectly valid driving force behind a certain bit of > > co

Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello Daniel, Wednesday, August 27, 2008, 8:01:24 PM, you wrote: >> trie: O(len)*O(width) >> hashed trie: O(len) >> hash: O(len) > Wouldn't the hashtable have lookup time O(len+bucketsize)? i suppose that bucketsize=O(1): constructor should get [approximate] size of hashed assoclist and it will

Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello Stephan, Wednesday, August 27, 2008, 1:52:23 PM, you wrote: > and on the other and, its implementation uses hash functions and arrays > as well. IIRC it does that in a state monad that keeps the array mutable > and finally freezes it before usage, which might be a good idea for pure > hash t

[Haskell-cafe] Re: Parsec and network data

2008-08-27 Thread brian
I made a small example related to the problem: http://hpaste.org/9957 It's my attempt to run data from the network directly into Parsec without having to fear deadlock due to blocking. The idea is that we feed Parsec from a timeout-enabled Stream based on Handle. As long as Parsec is able to read

[Haskell-cafe] ANNOUNCE: Wired 0.1.1

2008-08-27 Thread Emil Axelsson
Hello, This is to announce the first release of the hardware description library Wired. Wired can be seen as an extension to Lava that targets (not exclusively) semi-custom VLSI design. A particular aim of Wired is to give the designer more control over the routing wires' effects on performanc

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread Ketil Malde
"David House" <[EMAIL PROTECTED]> writes: >> 1. Etch comes with ghc-6.6, and that didn't work with my .cabal file. > Is it not an option to make your software work with the > not-quite-latest compiler? Yes it is, although I don't have the details either. Neither do I have an Etch system aroun

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Derek Elkins
On Wed, 2008-08-27 at 02:35 -0700, John Meacham wrote: [cut] > > However, note the weasel words. Those are in there on purpose, every > design calls for different solutions. To blanketly say certain > constructs are just wrong to the point of disallowing them in the > language, especially when the

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread David Bremner
Ketil Malde wrote: >Neither do I have an Etch system around, but I should probably >install a virtual machine or something. Ideally, I should >work out the minimal requirements (including for dependencies, and for >dependencies' dependencies), but in practice, I end up depending on >whatever is i

[Haskell-cafe] Is there GHC 6.8.3 on Ubuntu?

2008-08-27 Thread Rafael Gustavo da Cunha Pereira Pinto
Is there anyone packing GHC 6.8.3 for Ubuntu Hardy? Thanks -- Rafael Gustavo da Cunha Pereira Pinto Electronic Engineer, MSc. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Maurí­cio
Hi, What does '~' mean in Haskell? I read in haskell.org/haskellwiki/Keywords that “(...) Matching the pattern ~pat against a value always suceeds, and matching will only diverge when one of the variables bound in the pattern is used.” Isn't that true for any variable, due to lazyness? At the sa

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 14:23, Maurí cio wrote: What does '~' mean in Haskell? I read in haskell.org/haskellwiki/Keywords that “(...) Matching the pattern ~pat against a value always suceeds, and matching will only diverge when one of the variables bound in the pattern is used.” Isn't that true for an

[Haskell-cafe] timer_create revisited

2008-08-27 Thread Brandon S. Allbery KF8NH
I'm trying to build GHC 6.8.2 (6.8.3 once I get all this nailed down...) from an old bootstrap ghc on SuSE 9.3-64 (yes, I know) because the 6.6.1 and newer binary tarballs for amd64 Linux doesn't work with the "timer_create" issue. The problem is, having built a shiny new 6.8.2 both stage1

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Neil Mitchell
Hi > At the same place, I found that example, > but wasn't wise enough to figure out > what it does: > > (f *** g) ~(x,y) = (f x, g y) > > Can you help me understand it? It means exactly the same as: (f *** g) xy = (f (fst xy), g (snd xy)) i.e. if you call (f *** g) undefined, you will get (f u

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Benja Fallenstein
Hi Maurí­cio, I've got one thing to add to the replies so far: On Wed, Aug 27, 2008 at 8:23 PM, Maurí­cio <[EMAIL PROTECTED]> wrote: > What does '~' mean in Haskell? I > read in haskell.org/haskellwiki/Keywords > that "(...) Matching the pattern ~pat > against a value always suceeds, and > matchi

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Ryan Ingram
Here is another example: > f1 n ~(x:xs) = (n, x) > f2 n (x:xs) = (n,x) f1 5 [] = (5, error "irrefutable pattern match failure") f2 5 [] = error "pattern match failure" In particular: fst (f1 5 []) = 5 fst (f2 5 []) = error "pattern match failure" The "~" delays the pattern match until evaluati

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread C.M.Brown
Hi, I may be wrong here, but I don't belive it's just let-patterns that have this property. I.e. what's the difference between... (Just x) = _|_ f = x vs. f = let (Just x) = _|_ in x vs. f = x where (Just x) = _|_ I believe Haskell uses Normal Order Reduction in all these cases. Why is it j

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 20:14 +0100, C.M.Brown wrote: > Hi, > > I may be wrong here, but I don't belive it's just let-patterns that have > this property. I.e. what's the difference between... > > (Just x) = _|_ > > f = x > > vs. > > f = let (Just x) = _|_ in x > > vs. > > f = x where (Just x)

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Dan Weston
Tim Docker wrote: David Roundy wrote: Which illustrates the point that it's not type safety that protects us from segfaults, so much as bounds checking, and that's got a non-trivial runtime cost. At least, most segfaults that *I've* caused (in C or C++) have been from overwriting the bounds

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 12:23 -0700, Dan Weston wrote: > Tim Docker wrote: > > > > David Roundy wrote: > > > >> Which illustrates the point that it's not type safety > >> that protects us from segfaults, so much as bounds checking, > >> and that's got a non-trivial runtime cost. At least, most >

Re: [Haskell-cafe] 2 modules in one file

2008-08-27 Thread Yitzchak Gale
I have submitted this as Feature Request #2550 http://hackage.haskell.org/trac/ghc/ticket/2550 Please add any comments as appropriate. Thanks, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-c

Re: [Haskell-cafe] Haskell symbol ~

2008-08-27 Thread C.M.Brown
I personally think it's bad to start using "let-patterns" as a synonym for general pattern bindings when explaining these concepts. It may be true that it's all transformed into the same thing at core level, but a let expression binds a definition at the expression level, rather than at the equati

[Haskell-cafe] Compiler's bane

2008-08-27 Thread Andrew Coppin
Hi guys. I'm writing a simple interpretter for a small extended-lambda-calculus sort of language. And I'd just like to say... RECURSIVE LET-BINDS! GH!!! >_< No other part of the program has consumed nearly as much brain power as me trying to figure out when it is and isn't safe to replac

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread Don Stewart
ketil: > "Jason Dagit" <[EMAIL PROTECTED]> writes: > > >> 2) Compile GHC yourself. > > > I find with Debian this is the way to go. > > Ouch. Okay, I've compiled GHC once. But I would like end-users to be > able to use my software, and I simply cannot require them to go > through this. Yes, s

Re: [Haskell-cafe] Compiler's bane

2008-08-27 Thread Neil Mitchell
Hi > I'm writing a simple interpretter for a small extended-lambda-calculus sort > of language. And I'd just like to say... RECURSIVE LET-BINDS! GH!!! >_< Agreed :-) > To illustrate: > > let x = f x; y = 5 in x y > > A simple-minded interpretter might try to replace every occurrance of "x"

Re: [Haskell-cafe] Compiler's bane

2008-08-27 Thread John Meacham
On Wed, Aug 27, 2008 at 08:59:28PM +0100, Andrew Coppin wrote: > let y = 5 in (f x) y > > ...and x is now a free variable. OOPS! > > Trying to tease out exactly under which conditions you can and cannot > perform the substitution is utterly maddening. Since this is a Haskell > mailing list and

Re: [Haskell-cafe] Cleaning up the Debian act (report from the trenches)

2008-08-27 Thread David Bremner
Ketil Malde wrote: >Another Debian question, once I've populated the debian/ directory one >way or another, how should this be integrated with the rest of the >project? Should it be part of the darcs archive, or a separate >archive (foo-debian), or what? How do people organize this? [EMAIL PRO

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Aaron Tomb
On Aug 27, 2008, at 12:23 PM, Dan Weston wrote: Huh? Type safety buys you not having to worry about dereferencing stale nonnull pointers (lifetime of reference exceeding lifetime of referent), but nothing about dereferencing null pointers, which are the moral equivalent of Nothing. What

Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello Jan-Willem, Wednesday, August 27, 2008, 4:06:11 PM, you wrote: > One obvious way to make non-modifiable hash tables useful is to "eat > your own tail" non-strictly--- aggregate a set of hash table entries, > construct a hash table from them, and plumb the resulting hash table > into the o

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 13:34 -0700, Aaron Tomb wrote: > On Aug 27, 2008, at 12:23 PM, Dan Weston wrote: > > > Huh? Type safety buys you not having to worry about dereferencing > > stale nonnull pointers (lifetime of reference exceeding lifetime of > > referent), but nothing about dereferencing

Re: [Haskell-cafe] Haskell Propaganda

2008-08-27 Thread Daniel Fischer
Am Mittwoch, 27. August 2008 22:34 schrieb Aaron Tomb: > On Aug 27, 2008, at 12:23 PM, Dan Weston wrote: > > Huh? Type safety buys you not having to worry about dereferencing > > stale nonnull pointers (lifetime of reference exceeding lifetime of > > referent), but nothing about dereferencing null

Re[2]: [Haskell-cafe] Pure hashtable library

2008-08-27 Thread Bulat Ziganshin
Hello Jules, Wednesday, August 27, 2008, 7:59:55 PM, you wrote: >>> To get "much better efficient" than a trie, the hash function has to be >>> so fast that it is faster than following (log n) pointers >> >> afaiu, trie search follows n pointers > No. > "n" is the number of strings in my data

[Haskell-cafe] Problem building the plugins package

2008-08-27 Thread Emmanuel
Hello I am having troubles building the plugins package : manu:~/Desktop/tmp manu$ cabal install plugins Resolving dependencies... cabal: cannot configure plugins-1.2. It requires ghc >=6.8 There is no available version of ghc that satisfies >=6.8 I am on a Mac PPC (OS X 10.4) with ghc-6.8.2 an

Re[2]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Bulat Ziganshin
Hello Jonathan, Wednesday, August 27, 2008, 8:12:42 PM, you wrote: > * I wonder why that name was chosen? The design doesn't seem to have > anything to do with IO, it's more of a `we have this in C so we want it > in Haskell too' monad. s/it/exchange with external world, i.e., essentially, I/O/

Re: [Haskell-cafe] xmonad on the openmoko mobile phone

2008-08-27 Thread John Meacham
On Sun, Aug 10, 2008 at 08:36:27PM +0400, Miguel Mitrofanov wrote: > > On 9 Aug 2008, at 23:43, Don Stewart wrote: > >> Haskell on the iphone next? > > Did that. Hugs compiles well; GHC will probably too, I just didn't have > time for this. No haskell-specific hacks, only jailbreak. jhc cross com

Re: Re[2]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Thu, 2008-08-28 at 00:53 +0400, Bulat Ziganshin wrote: > Hello Jonathan, > > Wednesday, August 27, 2008, 8:12:42 PM, you wrote: > > > * I wonder why that name was chosen? The design doesn't seem to have > > anything to do with IO, it's more of a `we have this in C so we want it > > in Haskell

Re: [Haskell-cafe] Haskell Propeganda

2008-08-27 Thread Robert Greayer
--- On Wed, 8/27/08, Dan Weston <[EMAIL PROTECTED]> wrote: > > Failure to handle a null pointer is just like using > fromJust and results > in the same program termination (undefined). > > Dan > Well, not (IMHO) 'just like': 'fromJust Nothing' turns into a 'catchable' exception in the IO Mona

Re[4]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Bulat Ziganshin
Hello Jonathan, Thursday, August 28, 2008, 12:57:19 AM, you wrote: >> s/it/exchange with external world, i.e., essentially, I/O/ > Bald assertion. I don't buy it. What do IORefs have to do with > exchange with the external world? IORefs got their names because they are implemented in IO monad

Re: Re[4]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Thu, 2008-08-28 at 01:09 +0400, Bulat Ziganshin wrote: > Hello Jonathan, > > Thursday, August 28, 2008, 12:57:19 AM, you wrote: > > >> s/it/exchange with external world, i.e., essentially, I/O/ > > > Bald assertion. I don't buy it. What do IORefs have to do with > > exchange with the extern

Re: [Haskell-cafe] xmonad on the openmoko mobile phone

2008-08-27 Thread Don Stewart
john: > On Sun, Aug 10, 2008 at 08:36:27PM +0400, Miguel Mitrofanov wrote: > > > > On 9 Aug 2008, at 23:43, Don Stewart wrote: > > > >> Haskell on the iphone next? > > > > Did that. Hugs compiles well; GHC will probably too, I just didn't have > > time for this. No haskell-specific hacks, only jai

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Daniel Fischer
Am Mittwoch, 27. August 2008 22:57 schrieb Jonathan Cast: > On Thu, 2008-08-28 at 00:53 +0400, Bulat Ziganshin wrote: > > Hello Jonathan, > > > > Wednesday, August 27, 2008, 8:12:42 PM, you wrote: > > > * I wonder why that name was chosen? The design doesn't seem to have > > > anything to do with

Re[6]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Bulat Ziganshin
Hello Jonathan, Thursday, August 28, 2008, 1:11:35 AM, you wrote: >> IORefs got their names because they are implemented in IO monad :) > But why are they implemented in the IO monad? because they need its features. but i/o may be implemented w/o IORefs. so sequence was: searching for a was to m

Re: [Haskell-cafe] Compiler's bane

2008-08-27 Thread Lennart Augustsson
You can get rid of all recursive bindings by transforming them into a use of a fixpoint combinator. And then you can use a non-recursive definition of the fixpoint combinator, and never worry about recursive bindings again. -- Lennart On Wed, Aug 27, 2008 at 8:59 PM, Andrew Coppin <[EMAIL PROTE

Re: [Haskell-cafe] Haskell Propaganda

2008-08-27 Thread Brandon S. Allbery KF8NH
On 2008 Aug 27, at 16:49, Daniel Fischer wrote: Am Mittwoch, 27. August 2008 22:34 schrieb Aaron Tomb: When you do use Maybe, you have to explicitly handle the Just and Nothing cases separately. Pattern matching reminds you that both are possible. I tend to view fromJust as a function you should

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Ganesh Sittampalam
On Wed, 27 Aug 2008, Jonathan Cast wrote: * I wonder why that name was chosen? The design doesn't seem to have anything to do with IO, it's more of a `we have this in C so we want it in Haskell too' monad. The 'C' in ACIO says that it commutes with any operation in the IO monad. Without that

Re: [Haskell-cafe] Associative Commutative Unification

2008-08-27 Thread Matthieu Sozeau
Le 12 juil. 08 à 04:02, John D. Ramsdell a écrit : CIMe[1] might be useful to solve the generated diophantine equations. It also has AC unification, and it probably wouldn't be all that hard to translate our code into OCaml. I think CiME isn't supported anymore. Still it's worth considering

Re: [Haskell-cafe] Compiler's bane

2008-08-27 Thread Jeremy Apthorp
2008/8/28 Lennart Augustsson <[EMAIL PROTECTED]>: > You can get rid of all recursive bindings by transforming them into a > use of a fixpoint combinator. > And then you can use a non-recursive definition of the fixpoint > combinator, and never worry about recursive bindings again. This[1] might be

Re: [Haskell-cafe] Re: problem with cabal for syb-with-class

2008-08-27 Thread Duncan Coutts
On Wed, 2008-08-27 at 12:33 +0100, Claus Reinke wrote: > >> Cabal doesn't have to pass on ghc's messages uninterpreted. That's > >> a lot like implementing a map as a list and complaining about empty > >> list instead of element not found. > > > > I see what you're saying, but in practise it's jus

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 23:20 +0200, Daniel Fischer wrote: > Am Mittwoch, 27. August 2008 22:57 schrieb Jonathan Cast: > > On Thu, 2008-08-28 at 00:53 +0400, Bulat Ziganshin wrote: > > > Hello Jonathan, > > > > > > Wednesday, August 27, 2008, 8:12:42 PM, you wrote: > > > > * I wonder why that name wa

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Thu, 2008-08-28 at 01:23 +0400, Bulat Ziganshin wrote: > Hello Jonathan, > > Thursday, August 28, 2008, 1:11:35 AM, you wrote: > >> IORefs got their names because they are implemented in IO monad :) > > > But why are they implemented in the IO monad? > > because they need its features. but i/

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 14:50 -0700, Jonathan Cast wrote: > On Thu, 2008-08-28 at 01:23 +0400, Bulat Ziganshin wrote: > > Hello Jonathan, > > > > Thursday, August 28, 2008, 1:11:35 AM, you wrote: > > >> IORefs got their names because they are implemented in IO monad :) > > > > > But why are they im

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Lennart Augustsson
IMO, there's no justification for having IORefs etc in the IO monad. They should be in a separate monad. There could then be an operation to lift that monad to the IO monad, if you so wish. But wait, we already have that, it's the ST monad! (So there is no justification.) -- Lennart On Wed, A

Re: [Haskell-cafe] Building SDL-image package on Windows

2008-08-27 Thread Garrick Chin
Hello, Adding the main macro undef has solved the linker errors and both SDL_image and SDL_ttf build and install correctly now. For both SDL_image and SDL_ttf only the ./Graphics/UI/SDL/Image/Version.hsc file needed to be changed, pasting in the undef macro under "#include SDL_image.h" and "#incl

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread John Meacham
On Wed, Aug 27, 2008 at 12:17:46PM -0500, Derek Elkins wrote: > On Wed, 2008-08-27 at 02:35 -0700, John Meacham wrote: > > However, note the weasel words. Those are in there on purpose, every > > design calls for different solutions. To blanketly say certain > > constructs are just wrong to the poi

Re: Re[6]: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-08-27 Thread Jonathan Cast
On Wed, 2008-08-27 at 23:00 +0100, Lennart Augustsson wrote: > IMO, there's no justification for having IORefs etc in the IO monad. > They should be in a separate monad. There could then be an operation > to lift that monad to the IO monad, if you so wish. > But wait, we already have that, it's th

[Haskell-cafe] Re: Haskell Propaganda

2008-08-27 Thread Ben Franksen
Brandon S. Allbery KF8NH wrote: > On 2008 Aug 27, at 16:49, Daniel Fischer wrote: >> Am Mittwoch, 27. August 2008 22:34 schrieb Aaron Tomb: >>> When you do use Maybe, you have to explicitly handle the Just and >>> Nothing cases separately. Pattern matching reminds you that both are >>> possible. I

  1   2   >