Re: [GHC] #985: Memory Leak in freeHaskellFunPtr

2007-02-05 Thread GHC
#985: Memory Leak in freeHaskellFunPtr --+- Reporter: [EMAIL PROTECTED]| Owner: igloo Type: merge | Status: closed Priority: normal

[GHC] #1133: auto-derivation of Enum is disallowed with recursive imports

2007-02-05 Thread GHC
#1133: auto-derivation of Enum is disallowed with recursive imports -+-- Reporter: heatsink | Owner: Type: bug | Status: new Priority: normal| Milestone:

Re: Become a GHC build slave!

2007-02-05 Thread Richard Giraud
I believe that there is value in having multiple BuildBots for the same platform. More value is provided when differences are maximized between BuildBots but there is value in having similar BuildBots (particularly, if the similar BuildBots are popular). Even in the relatively monoculture

Re: Become a GHC build slave!

2007-02-05 Thread Malcolm Wallace
Wilson MacGyver [EMAIL PROTECTED] wrote: there is no reason for multiple build-bot for the same platform is there? If you have two or three slaves for each platform, then the buildbot is robustified against downtime of any of the machines (intentional, like going on holiday for a couple of

Re: Become a GHC build slave!

2007-02-05 Thread Neil Mitchell
Hi, One of the issues the Yhc people had with Mac buildbots is that no one figured out how to get the buildbot slaves to run on startup with a Mac. If one of the Mac people does figure that out, adding it to the wiki would be most appreciated. Thanks Neil On 2/5/07, Malcolm Wallace [EMAIL

Re: [Haskell-cafe] Become a GHC build slave!

2007-02-05 Thread Simon Marlow
Neil Mitchell wrote: Hi Simon, Thanks largely to Ian Lynagh, GHC now has a BuildBot infrastructure to automate nightly builds on multiple platforms. This replaces the old set of shell scripts that we used to run nightly builds; now adding new clients to the setup is relatively easy,

(no subject)

2007-02-05 Thread Tays Soares
Hello everyone, I did at my master thesis a compiler that generates Haskell code. Now I need to measure the execution time of my generated code and I've been searched and I don't know if I'm looking with the wrong keywords but I could not find anything. I just need to measure the time of

Re: time profiling (was: (no subject))

2007-02-05 Thread Kirsten Chevalier
On 2/5/07, Tays Soares [EMAIL PROTECTED] wrote: Hello everyone, I did at my master thesis a compiler that generates Haskell code. Now I need to measure the execution time of my generated code and I've been searched and I don't know if I'm looking with the wrong keywords but I could not

No instance for (Monad ((-) Integer))

2007-02-05 Thread Chad Scherrer
I'm getting this error in ghci, and I think it should typecheck just fine. Prelude let fs = [(+2), (*4)] Prelude :t fs fs :: [Integer - Integer] Prelude :t sequence fs interactive:1:0: No instance for (Monad ((-) Integer)) arising from use of `sequence' at interactive:1:0-10 Possible

Re: (no subject)

2007-02-05 Thread Neil Mitchell
Hi Tays, I did at my master thesis a compiler that generates Haskell code. Now I need to measure the execution time of my generated code and I've been searched and I don't know if I'm looking with the wrong keywords but I could not find anything. I just need to measure the time of simple

Re: No instance for (Monad ((-) Integer))

2007-02-05 Thread Neil Mitchell
Hi Chad, Prelude let fs = [(+2), (*4)] Prelude :t fs fs :: [Integer - Integer] Prelude :t sequence fs I think you need to import Control.Monad.Instances to get the appropriate instance in scope. Thanks Neil ___ Glasgow-haskell-users mailing list

Re: No instance for (Monad ((-) Integer))

2007-02-05 Thread Chad Scherrer
On 2/5/07, Neil Mitchell [EMAIL PROTECTED] wrote: Hi Chad, Prelude let fs = [(+2), (*4)] Prelude :t fs fs :: [Integer - Integer] Prelude :t sequence fs I think you need to import Control.Monad.Instances to get the appropriate instance in scope. Hmm, that's weird. The instance Monad ((-)

Re: [Haskell-cafe] Become a GHC build slave!

2007-02-05 Thread Seth Kurtzberg
I'm joining this discussion a bit late, but ... I can provide a build machines for netbsd and freebsd. I didn't see those on the URL cited below. They are fairly common, so perhaps I just missed them. In any event, if netbsd and/or freebsd will be helpful, please let me know. Seth Kurtzberg

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread Chris Kuklewicz
Twan van Laarhoven wrote: Hello all, I would like to announce my attempt at making a Unicode version of Data.ByteString. The library is named Data.CompactString to avoid conflict with other (Fast)PackedString libraries. The library uses a variable length encoding (1 to 3 bytes) of Chars

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread Twan van Laarhoven
Chris Kuklewicz wrote: Can I be among the first to ask that any Unicode variant of ByteString use a recognized encoding? snip In reading all the poke/peek function I did not see anything that your tag bits accomplish that the tag bits in utf-8 do not, except that you want to write only a

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread shelarcy
Hello Twan, On Mon, 05 Feb 2007 08:46:35 +0900, Twan van Laarhoven [EMAIL PROTECTED] wrote: I would like to announce my attempt at making a Unicode version of Data.ByteString. The library is named Data.CompactString to avoid conflict with other (Fast)PackedString libraries. How about add

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread Chris Kuklewicz
shelarcy wrote: Hello Twan, On Mon, 05 Feb 2007 08:46:35 +0900, Twan van Laarhoven [EMAIL PROTECTED] wrote: I would like to announce my attempt at making a Unicode version of Data.ByteString. The library is named Data.CompactString to avoid conflict with other (Fast)PackedString

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread Alistair Bayley
On 05/02/07, Chris Kuklewicz [EMAIL PROTECTED] wrote: shelarcy wrote: Many Hasekll UTF-8 libraries doesn't support over 3 byte encodings. UTF-8 uses 1,2,3, or 4 bytes. Anything that does not support 4 bytes does not support UTF-8 Well, some of them are probably a bit dated; they likely

[Haskell] Haskell Xlib bindings

2007-02-05 Thread Dimitry Golubovsky
Hi, This message does not answer the original question, but may be useful if anyone really wants to work on the X protocol interface to Haskell. Just adding from my past experience. I had a (experimental, unfinished, and most likely it never will be finished) project to bind directly to the

[Haskell] Dynamic database updated by list using existential types

2007-02-05 Thread Rene de Visser
The following code took me several hours to work out. I post it here, so perhaps other can avoid the difficulties of working out how to use existential types. Improvements welcome. If anyone thinks it is worth it I could add it to the wiki under existential types (I didn't find the examples

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread David Menendez
Alistair Bayley writes: On 05/02/07, Chris Kuklewicz [EMAIL PROTECTED] wrote: UTF-8 is a 4 byte encoding. There is no valid UTF-8 5 or 6 byte encoding. Chris is right here, in that Takusen's decoder is incorrect w.r.t. the standard, in allowing up to 6 bytes to encode a single char.

Re: [Haskell] ANNOUNCE: Data.CompactString 0.1 - my attempt at a Unicode ByteString

2007-02-05 Thread shelarcy
On Tue, 06 Feb 2007 00:25:45 +0900, Chris Kuklewicz [EMAIL PROTECTED] wrote: UTF-8 also uses 4 to 6 byte encodings now. CJK Unified Ideographs Extension B, Tai Xuan Jing Symbol and Music Symbol, etc ... use 4 byte encoding. Looking at several sources, it seems you are incorrect. Haskell

RE: Polymorphic components, so far

2007-02-05 Thread Simon Peyton-Jones
| | * Pattern matching on polymorphic fields. This does not appear to be | | too controversial, although Atze had some reservations about this | | design choice. ... | So far, most replys seemed to agree that this is not a big | restriction. Could you give more details on how you think that

RE: rank-2 vs. arbitrary rank types

2007-02-05 Thread Simon Peyton-Jones
| I don't think that the rank-N system is any more expressive then the | rank-2 one. The reason is that by placing a polymorphic value in a | datatype we can decrese its rank. In this way we can reduce a program Hmm. To be consistent, then, you'd have to argue for rank-2 data constructors

Re: List syntax (was: Re: help from the community?)

2007-02-05 Thread Ulf Norell
On Feb 3, 2007, at 6:35 AM, Douglas Philips wrote: Well, if we're going to bring personal points of view in, it highly pisses me off that in a construct such as: ( expr , expr , expr , expr , expr , ) I have to be vigilant to remove that trailing comma when it is in _no way_

Re: rank-2 vs. arbitrary rank types

2007-02-05 Thread Malcolm Wallace
Iavor Diatchki [EMAIL PROTECTED] wrote: I don't think that the rank-N system is any more expressive then the rank-2 one. The reason is that by placing a polymorphic value in a datatype we can decrese its rank. In this way we can reduce a program of any rank to just rank-2. The same

Re: [Haskell-cafe] Re: nested maybes

2007-02-05 Thread Bulat Ziganshin
Hello Martin, Monday, February 5, 2007, 2:47:33 AM, you wrote: main = do minput - getInput case minput of Nothing - printError Just input - do mresult - processInput input case mresult of Nothing - printError Just result - printResult

Re: [Haskell-cafe] Re: nested maybes

2007-02-05 Thread Yitzchak Gale
J. Garrett Morris wrote: This is where my favorite part of the mtl steps in: monad transformers. I agree, the Error monad is very helpful here. First, we'll create a transformed version of the IO monad, Why go to the trouble of creating a new monad? The existing ones are fine. (While

Re: Re[2]: [Haskell-cafe] nested maybes

2007-02-05 Thread Martin DeMello
On 2/5/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello J., Sunday, February 4, 2007, 11:46:57 PM, you wrote: exists s wmap = isJust $ find (==s) . snd = Map.lookup (sort s) wmap exists s wmap = Map.lookup (sort s) wmap == snd == find (==s)

[Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread Thomas Hartman
haskellers, I'm contemplating returning to school after a decade as a worker bee, and almost that long as a worker bee doing computer consulting / miscelaneous tech stuff. Ideally I'd like to get a masters, but I don't know if that's feasible this late in the game. If it's not, I might settle

Re: [Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread minh thu
2007/2/5, Thomas Hartman [EMAIL PROTECTED]: haskellers, I'm contemplating returning to school after a decade as a worker bee, and almost that long as a worker bee doing computer consulting / miscelaneous tech stuff. Ideally I'd like to get a masters, but I don't know if that's feasible this

Re: [Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread Greg Fitzgerald
Thomas, Here's a good place to start, although I'm not sure how up to date it is: http://haskell.org/haskellwiki/Haskell_in_education I too am interested in an FP-related, higher education in California. Could you please send another post with whatever information you find? Thanks, Greg On

Re: [Haskell-cafe] Generalizing three programs

2007-02-05 Thread Yitzchak Gale
Andrew Wagner wrote: I've got several problems which seem to have a very similar structure. I want to find a way to abstract them to solve other problems which can be thought about in the same way. Here they are: http://hpaste.org/307 http://hpaste.org/308 http://hpaste.org/309 Note that these

Re: [Haskell-cafe] Re: nested maybes

2007-02-05 Thread J. Garrett Morris
On 2/5/07, Yitzchak Gale [EMAIL PROTECTED] wrote: J. Garrett Morris wrote: First, we'll create a transformed version of the IO monad, Why go to the trouble of creating a new monad? The existing ones are fine. Mainly to keep the type error messages simpler. A project I was working on started

Re: [Haskell-cafe] Re: nested maybes

2007-02-05 Thread Yitzchak Gale
I wrote: Why go to the trouble of creating a new monad? The existing ones are fine. J. Garrett Morris wrote: Mainly to keep the type error messages simpler. There are two ways to get around that problem: 1. Make your functions polymorphic, using MonadState, MonadError, etc. Each function

Re: [Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread Malcolm Wallace
Thomas Hartman [EMAIL PROTECTED] wrote: Whether master's, bachelor's, or other, I am specifically interested in programs that are functional friendly. You might find that Utrecht has something of interest, e.g. the Masters in Software Technology.

Re: [Haskell-cafe] mixing wxhaskell state and file io

2007-02-05 Thread Martin DeMello
On 2/5/07, Martin DeMello [EMAIL PROTECTED] wrote: On 2/5/07, Matthew Brecknell [EMAIL PROTECTED] wrote: This is probably what you wanted (untested): w - readWords words words - varCreate w That didn't work, because (as someone on #haskell explained to me) readWords has type IO and the wx

Re: [Haskell-cafe] Re: nested maybes

2007-02-05 Thread J. Garrett Morris
On 2/5/07, Yitzchak Gale [EMAIL PROTECTED] wrote: J. Garrett Morris wrote: Mainly to keep the type error messages simpler. There are two ways to get around that problem: 1. Make your functions polymorphic, using MonadState, MonadError, etc. Each function mentions only the capabilities that it

Re: [Haskell-cafe] nested maybes

2007-02-05 Thread Bryan Donlan
Martin DeMello wrote: On 2/5/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello J., Sunday, February 4, 2007, 11:46:57 PM, you wrote: exists s wmap = isJust $ find (==s) . snd = Map.lookup (sort s) wmap exists s wmap = Map.lookup (sort s) wmap == snd ==

[Haskell-cafe] Re: Generalizing three programs

2007-02-05 Thread apfelmus
Andrew Wagner wrote: Hi everyone, I've got an interesting problem here I'm trying to solve. Actually, I've got several problems which seem to have a very similar structure. I want to find a way to abstract them to solve other problems which can be thought about in the same way. Here they are:

[Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Miranda Kajtazi
Help, How to calculate the sum of list of lists in Haskell? Please help me, Miranda ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Neil Mitchell
Hi Miranda, How to calculate the sum of list of lists in Haskell? What do you mean by this? What is the value of a list? If you mean sum the numbers such that [[1,2],[3,4]] = 1+2+3+4 then you are able to ask two alternative questions - how do i convert a list of lists to a list, and how do i

Re: [Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Eric Olander
If I understand you correctly, this should do it: sums :: Num a = [[a]] - a sums l = sum [sum p | p - l] -Eric On 2/5/07, Miranda Kajtazi [EMAIL PROTECTED] wrote: Help, How to calculate the sum of list of lists in Haskell? Please help me, Miranda

Re: [Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Maxime Henrion
Miranda Kajtazi wrote: Help, How to calculate the sum of list of lists in Haskell? Do you mean something of the form Num a = [[a]] - a ? If so, this should do it: Prelude let foo = sum . concat Prelude foo [[1,2,3],[4,5]] 15 Cheers, Maxime ___

Re: [Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread Björn Bringert
Thomas Hartman wrote: haskellers, I'm contemplating returning to school after a decade as a worker bee, and almost that long as a worker bee doing computer consulting / miscelaneous tech stuff. Ideally I'd like to get a masters, but I don't know if that's feasible this late in the game. If it's

Re: [Haskell-cafe] how to calculate the sum of list of lists?

2007-02-05 Thread Mark T.B. Carroll
Miranda Kajtazi [EMAIL PROTECTED] writes: Help, How to calculate the sum of list of lists in Haskell? So the answer for [[1,2],[3,4]] would be 10? (Is this homework? If so, we're still happy to give hints.) -- Mark ___ Haskell-Cafe mailing list

[Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Miranda Kajtazi
Hi, Thanx to all for the previous hints how to solve and write the function to calculate the sum of a list of lists. Now I need to know how to remove all numbers that are divisable by an integer. Lets say I have a list [2,4,5,6,8] and when I divide them with number 2, my list should look like

Re: [Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Neil Mitchell
Hi Miranda, Now I need to know how to remove all numbers that are divisable by an integer. Is this a homework problem? Is there some bigger goal you are trying to achieve? I tried to use some zipWith...filter and other predefined functions..but I can't really find the right solution :(

[Haskell-cafe] How to use infinite lists to define the list of all negative integers

2007-02-05 Thread Bahtijar Vogel
Hi, How am I supposed to use infinite lists to define the list of all negative integers? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: How to use infinite lists to define the list of all negative integers

2007-02-05 Thread Max Vasin
Bahtijar == Bahtijar Vogel [EMAIL PROTECTED] writes: Bahtijar Hi, How am I supposed to use infinite lists to define Bahtijar the list of all negative integers? negs = [-1,-2..] -- WBR, Max Vasin. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] How to use infinite lists to define the list of all negative integers

2007-02-05 Thread Andrew Wagner
Hi Bahtijar! I'm not going to answer your question directly, but let me give you some background that will hopefully help you discover the pretty solution yourself. Consider this definition: ones = 1 : ones -- This list is essentially [1,1,1,...] And this expression: take 5 ones Now,

[Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Miranda Kajtazi
Hi all, I'm trying to create a function which filters out all number from a list that are divisible by an integer. Ex. the list [2,3,4,5,6] div 2...should give me the list like: [3,5], other numbers should be removed divisible by 2. filter :: (a - Bool) - [a] - [a] filter p [] = [] filter p

[Haskell-cafe] Space leaks in large mutable data structures

2007-02-05 Thread C Rodrigues
I'd like to hear what tips and techniques you guys have for avoiding space leaks. I understand the basic techniques to force evaluation of closures. What I'd like to know is how you avoid space leaks in large, long-lived, mutable data structures. These kind of data are particularly sensitive

Re: [Haskell-cafe] How to remove all numbers from a list that are divisible by an integer

2007-02-05 Thread Neil Mitchell
Hi Miranda, filter :: (a - Bool) - [a] - [a] filter p [] = [] filter p (x:xs) = if p 'mod' x then x : filter p xs else filter p xs I tried this, but it doesn't work You are mixing a few things together. First point, mod should be `mod` and not

Re: [Haskell-cafe] How is laziness defined?

2007-02-05 Thread David House
On 05/02/07, TJ [EMAIL PROTECTED] wrote: I went through the entry on laziness on the wikipedia wikibook. Very nice. The wikibook sure has grown a lot since I last visited. http://en.wikibooks.org/wiki/Haskell/Laziness Great! I was about to suggest this! This is one of our

Re: [Haskell-cafe] How to use infinite lists to define the list of all negative integers

2007-02-05 Thread David House
On 05/02/07, Bahtijar Vogel [EMAIL PROTECTED] wrote: Hi, How am I supposed to use infinite lists to define the list of all negative integers? Don't forget the iterate function: http://haskell.org/ghc/docs/latest/html/libraries/base/Data-List.html#v%3Aiterate Also, I may be off the mark here,

Re: [Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread Michael Vanier
FYI we teach and do a fair amount of functional programming here at Caltech. We have courses using scheme, ocaml, and haskell with more on the way. Mike Greg Fitzgerald wrote: Thomas, Here's a good place to start, although I'm not sure how up to date it is:

Re: [Haskell-cafe] Timezone Database Library

2007-02-05 Thread Ian Lynagh
On Fri, Feb 02, 2007 at 01:54:13PM +, Martin Percossi wrote: Hello, is there a haskell library that provides facilities to read and use the tzfile format [1], or equivalent in Windows? Not as far as I am aware. Thanks Ian ___ Haskell-Cafe

Re: [Haskell-cafe] OT: any haskell-friendly / functional programming friendly comp sci programs? (for a 30s guy who did his undergrad in liberal arts)

2007-02-05 Thread Kirsten Chevalier
On 2/5/07, Paul Johnson [EMAIL PROTECTED] wrote: If you are already a hacker then the right kinds of people to start a company with may not be the ones you find in a Masters or Bachelor comp-sci course. Different people have different views on this, of course. Yeah, actually, I have to agree

Re: [Haskell-cafe] List operation question

2007-02-05 Thread ihope
On 2/4/07, Eric Olander [EMAIL PROTECTED] wrote: Hi, I'm still somewhat new to Haskell, so I'm wondering if there are better ways I could implement the following functions, especially shiftl: moves the last element to the head of the list shiftl :: [a] - [a] shiftl [] = []

[Haskell-cafe] Re: nested maybes

2007-02-05 Thread Benjamin Franksen
Udo Stenzel wrote: Sure, you're right, everything flowing in the same direction is usually nicer, and in central Europe, that order is from the left to the right. What a shame that the Haskell gods chose to give the arguments to (.) and ($) the wrong order! But then application is in the

[Haskell-cafe] Final issues to fix for the shootout entries (Was: no subject)

2007-02-05 Thread Donald Bruce Stewart
Yeah, have a look on the shootout: http://shootout.alioth.debian.org/gp4/benchmark.php?test=recursivelang=all Has an ackerman. More detailed comparisions, across the 19 benchmarks on the shootout, with notes on which of the 19 GHC Haskell is significantly slower (4x) at: Haskell verus

[Haskell-cafe] A function callable from C

2007-02-05 Thread John Ky
Hi, The following code works: type ServiceMainClosure = DWORD - IO () foreign import ccall wrapper mkServiceMainClosure :: ServiceMainClosure - IO (FunPtr ServiceMainClosure) But the following doesn't: type ServiceMainClosure = DWORD - [String] - IO () foreign import ccall wrapper

Re: [Haskell-cafe] A function callable from C

2007-02-05 Thread Stefan O'Rear
On Tue, Feb 06, 2007 at 12:33:58PM +1100, John Ky wrote: Hi, The following code works: type ServiceMainClosure = DWORD - IO () foreign import ccall wrapper mkServiceMainClosure :: ServiceMainClosure - IO (FunPtr ServiceMainClosure) But the following doesn't: type

Re: [Haskell-cafe] A function callable from C

2007-02-05 Thread John Ky
Hi Stefan, In that case, how do I marshall [String] to Ptr (Ptr CChar)? Thanks -John On 2/6/07, Stefan O'Rear [EMAIL PROTECTED] wrote: You have to use a type that C's tiny brain understains. IANAWP but I'm guessing you want: type ServiceMainClosure = DWORD - Ptr (Ptr CChar) - IO ()

Re: [Haskell-cafe] A function callable from C

2007-02-05 Thread Stefan O'Rear
On Tue, Feb 06, 2007 at 12:40:38PM +1100, John Ky wrote: Hi Stefan, In that case, how do I marshall [String] to Ptr (Ptr CChar)? look at Foreign.C.String and Foreign.Ptr ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] A function callable from C

2007-02-05 Thread John Ky
Actually, what I need to do is a fair bit more complex than string marshalling. It feels like I'll need to pull together a number of different concepts so I may as well describe the problem directly. The C function I want to call is StartServiceCtrlDispatcher: *BOOL*

[Haskell-cafe] Trouble representing a set of flags

2007-02-05 Thread Stefan O'Rear
I have a structure: data Attr = Attr { fg :: !Color, bg :: !Color, bold :: !Bool, blink :: !Bool, rv :: !Bool, halfBright :: !Bool, underline :: !Bool }

Re: [Haskell-cafe] How is laziness defined?

2007-02-05 Thread ajb
G'day all. Quoting Matthew Brecknell [EMAIL PROTECTED]: Although it covers irrefutable (lazy) pattern matching in the second section, it does appear to miss the point that let bindings are always irrefutable. Thus, there is no difference between these two: let (x,y) = foo in ... let

Re: [Haskell-cafe] List operation question

2007-02-05 Thread Eric Olander
That's a clever routine. It should be faster than mine since it only makes a single pass though the list. Thanks for all the suggestions from everyone that responded. Here is a link to some more info on the project I'm working on if anyone is interested: http://ehaskell.blogspot.com/ -Eric

Re: [Haskell-cafe] How is laziness defined?

2007-02-05 Thread Matthew Brecknell
I said: Although it covers irrefutable (lazy) pattern matching in the second section, it does appear to miss the point that let bindings are always irrefutable. Thus, there is no difference between these two: let (x,y) = foo in ... let ~(x,y) = foo in ... Andrew Bromage said: let (x,())

Re: [Haskell-cafe] How is laziness defined?

2007-02-05 Thread ajb
G'day all. Quoting Matthew Brecknell [EMAIL PROTECTED]: In other words, the irrefutability of a pattern match does not distribute inside the top-level data constructor of the pattern. I wasn't disagreeing with you, which is why I didn't comment. Note also that if Haskell prime incorporates

Re: [Haskell-cafe] Re: nested maybes

2007-02-05 Thread Udo Stenzel
Benjamin Franksen wrote: Udo Stenzel wrote: Sure, you're right, everything flowing in the same direction is usually nicer, and in central Europe, that order is from the left to the right. What a shame that the Haskell gods chose to give the arguments to (.) and ($) the wrong order! But