Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tom Ellis
On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: On 1/07/2013, at 1:04 PM, Richard Cobbe wrote: I should have been clearer in my original question: I'm curious about what to do when a multi-argument function application gets split across lines. That wiki page dicsusses

Re: [Haskell-cafe] question automatic indentation (and so on)

2013-07-01 Thread Joachim Breitner
Hi, on a related note: At HaL8 I was wondering how well Haskell would be suited for a workflow similar to what the go programmers do: Do not worry about code layout, but let the computer handle it! For more rationale and examples see http://golang.org/doc/effective_go.html#formatting While

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Johannes Waldmann
Code which is part of some expression should be indented further in than the beginning of that expression [...] Yes. Then the next question is how much further in. My answer is: it does not matter, but make it consistent (like 4 spaces), with the implication that indentation

Re: [Haskell-cafe] question automatic indentation (and so on)

2013-07-01 Thread Richard Cobbe
On Mon, Jul 01, 2013 at 09:48:42AM +0200, Joachim Breitner wrote: SNIP I found https://github.com/jaspervdj/stylish-haskell/ (found via http://stackoverflow.com/q/6870148/946226) which formats just some very few aspects of Haskell. Does anyone have a more complete solution? Or is interested

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard Cobbe
On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: It looked pretty explicit to me: The golden rule of indentation ... you will do fairly well if you just remember a single rule: Code which is part of some expression should be indented further

Re: [Haskell-cafe] question automatic indentation (and so on)

2013-07-01 Thread Joachim Breitner
Hi, Am Montag, den 01.07.2013, 07:59 -0400 schrieb Richard Cobbe: How does the indentation tool know if (a b c) is supposed to be the next item in the do block, or merely a continuation of the previous application of f? I would still expect the developer to write correctly intended Haskell,

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Sturdy, Ian
-cafe-boun...@haskell.org [haskell-cafe-boun...@haskell.org] on behalf of Richard Cobbe [co...@ccs.neu.edu] Sent: Monday, July 01, 2013 8:00 AM To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] question about indentation conventions On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 3:43 AM, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: is OK but f (g x y z) is not. It seems to me that this means f x1 x2 x3 x4 is not. The OP was initially asking about this situation. If you wrote that in a do, the

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
] on behalf of Richard Cobbe [co...@ccs.neu.edu] Sent: Monday, July 01, 2013 8:00 AM To: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] question about indentation conventions On Mon, Jul 01, 2013 at 05:18:39PM +1200, Richard A. O'Keefe wrote: It looked pretty explicit to me

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 9:56 AM, Tikhon Jelvis tik...@jelv.is wrote: I've thought about writing an automatic indenting tool for Haskell (or, more accurately, a pretty-printer) for another project I have, and this is the main thing that threw me off. While automatic indentation might make sense

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
That's certainly true. As I mentioned, I was actually considering a *pretty-printer* rather than an automatic indentation tool per se. The end results are similar, but the pretty-printer is really only the latter part of the problem: it's predicated on already having a valid AST. My particular

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard A. O'Keefe
On 2/07/2013, at 12:00 AM, Richard Cobbe wrote: Sure. So my first question boils down to which of the two alternatives below does the community prefer? (To be clear about the intended semantics: this is the application of the function f to the arguments x, y, and z.) f x y z

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Richard Cobbe
On Sun, Jun 30, 2013 at 07:53:08PM -0400, Richard Cobbe wrote: Two questions: And what I've concluded by reading this thread: 1) Are there wide-spread conventions in the Haskell community for how to indent an application expression that's split across multiple lines? Well, there's general

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Patrick Mylund Nielsen
I prefer the other style--as do others, evidently (see the example in my first reply.) I agree that this was a good discussion, but let's not conclude so easily that the entire community is in favor of one thing or the other. On Mon, Jul 1, 2013 at 8:24 PM, Richard Cobbe co...@ccs.neu.edu wrote:

[Haskell-cafe] question about indentation conventions

2013-06-30 Thread Richard Cobbe
I hope I'm not starting a holy war with this, but I'm curious about an aspect of coding style that's been bugging me for a while, and I'm not finding much discussion of this question on the web or in the mailing list archives. Two questions: 1) Are there wide-spread conventions in the Haskell

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Darren Grant
Hi Richard, This page helped me when starting out: http://en.wikibooks.org/wiki/Haskell/Indentation On 2013-06-30 4:55 PM, Richard Cobbe co...@ccs.neu.edu wrote: I hope I'm not starting a holy war with this, but I'm curious about an aspect of coding style that's been bugging me for a while,

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Richard Cobbe
On Sun, Jun 30, 2013 at 05:41:46PM -0700, Darren Grant wrote: Hi Richard, This page helped me when starting out: http://en.wikibooks.org/wiki/Haskell/Indentation On 2013-06-30 4:55 PM, Richard Cobbe co...@ccs.neu.edu wrote: snip 1) Are there wide-spread conventions in the Haskell

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Patrick Mylund Nielsen
The Haskell Style Guide is quite popular: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md (accompying elisp module: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.el) I am not sure what the verdict is on functions spanning multiple lines, other

Re: [Haskell-cafe] question about indentation conventions

2013-06-30 Thread Richard A. O'Keefe
On 1/07/2013, at 1:04 PM, Richard Cobbe wrote: I should have been clearer in my original question: I'm curious about what to do when a multi-argument function application gets split across lines. That wiki page dicsusses how the layout rule interacts with various special forms (let, where,

Re: [Haskell-cafe] Question about Newtype op() function arguments.

2013-06-12 Thread David Banas
Ah, so is the idea, then, to use *op()* when `n` wasn't actually constructed formally, but rather assembled by the user, so as to match the type of the accessor function normally supplied as the argument to the constructor? On 6/7/2013 4:51 PM, Tom Ellis wrote: On Fri, Jun 07, 2013 at

[Haskell-cafe] Question about Newtype op() function arguments.

2013-06-07 Thread David Banas
Hi All, Referring to the following, which is taken from the *Control.Newtype *documentation page: op :: Newtypehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype n o = (o - n) - n -

Re: [Haskell-cafe] Question about Newtype op() function arguments.

2013-06-07 Thread Roman Cheplyaka
* David Banas capn.fre...@gmail.com [2013-06-07 07:08:19-0700] Hi All, Referring to the following, which is taken from the *Control.Newtype *documentation page: op :: Newtypehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype n o = (o - n) -

Re: [Haskell-cafe] Question about Newtype op() function arguments.

2013-06-07 Thread Tom Ellis
On Fri, Jun 07, 2013 at 07:08:19AM -0700, David Banas wrote: op :: Newtypehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/Control-Newtype.html#t:Newtype n o = (o - n) - n - oSourcehttp://hackage.haskell.org/packages/archive/newtype/0.2/doc/html/src/Control-Newtype.html#op

Re: [Haskell-cafe] Question about Newtype op() function arguments.

2013-06-07 Thread Joe Q
The phantom parameter solves the same problem as scoped type variables. Granted, if you find yourself in that kind of polymorphic soup you have deeper problems... On Jun 7, 2013 2:53 PM, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: On Fri, Jun 07, 2013 at 07:08:19AM -0700, David

Re: [Haskell-cafe] Question about Newtype op() function arguments.

2013-06-07 Thread Tom Ellis
On Fri, Jun 07, 2013 at 04:05:09PM -0400, Joe Q wrote: The phantom parameter solves the same problem as scoped type variables. Granted, if you find yourself in that kind of polymorphic soup you have deeper problems... I don't understand this. Scoped type variables are used when you want to

Re: [Haskell-cafe] Question about Newtype op() function arguments.

2013-06-07 Thread Joe Quinn
On 6/7/2013 4:51 PM, Tom Ellis wrote: On Fri, Jun 07, 2013 at 04:05:09PM -0400, Joe Q wrote: The phantom parameter solves the same problem as scoped type variables. Granted, if you find yourself in that kind of polymorphic soup you have deeper problems... I don't understand this. Scoped type

Re: [Haskell-cafe] question about singletons

2013-06-02 Thread TP
Thanks Richard, now I have my answers. Richard Eisenberg wrote: - The type system of Haskell is based on theoretical work that resolutely assumes that types of non-* kind are uninhabited. While it is possible to stretch imagination to allow types like 'Zero to be inhabited, the designers of

Re: [Haskell-cafe] question about singletons

2013-06-01 Thread TP
Thanks Richard for your detailed answer. Please find my reply below (note I have rearranged some of your paragraphs). Richard Eisenberg wrote: * Types at kind other than * do not have any inhabitants -- in fact, some people would hesitate to call type-like things at kind other than * types!

Re: [Haskell-cafe] question about singletons

2013-06-01 Thread Richard Eisenberg
On Jun 1, 2013, at 8:18 PM, TP wrote: In other words, bottom can be an inhabitant of a concrete type, not a type constructor, which I can understand. But a type of kind Nat is a concrete type, so why bottom cannot be an inhabitant of this type? We also have the nice maxim that every

Re: [Haskell-cafe] question about singletons

2013-06-01 Thread wren ng thornton
On 6/1/13 3:18 PM, TP wrote: In other words, bottom can be an inhabitant of a concrete type, not a type constructor, which I can understand. But a type of kind Nat is a concrete type, so why bottom cannot be an inhabitant of this type? The technical term is proper type. That is, types are used

[Haskell-cafe] question about singletons

2013-05-31 Thread TP
Hi all, Following a discussion on Haskell Cafe some time ago (1), Roman C. wrote: On the other hand, the type 'Succ 'Zero has kind 'Nat and doesn't have any inhabitants — only types of kind * do. Indeed, this is what seems to occur in the following example: --- {-#

Re: [Haskell-cafe] question about singletons

2013-05-31 Thread Richard Eisenberg
...@haskell.org] On Behalf Of TP Sent: 31 May 2013 13:58 To: haskell-cafe@haskell.org Subject: [Haskell-cafe] question about singletons Hi all, Following a discussion on Haskell Cafe some time ago (1), Roman C. wrote: On the other hand, the type 'Succ 'Zero has kind 'Nat and doesn't have any

Re: [Haskell-cafe] question about type constructors

2013-05-23 Thread Roman Cheplyaka
* TP paratribulati...@free.fr [2013-05-23 00:34:57+0200] Hi, In the program I am trying to write, I have a problem that can be reduced to the following dummy example: -- {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-#

Re: [Haskell-cafe] question about type constructors

2013-05-23 Thread TP
Roman Cheplyaka wrote: The rule of thumb is that you should never use IncoherentInstances. The proper way to do it is: data Person :: Gender - * where Person :: String - Person b Child :: (PrettyPrint a, PrettyPrint b) = String - Person a - Person b -

Re: [Haskell-cafe] question about type constructors

2013-05-23 Thread Roman Cheplyaka
* TP paratribulati...@free.fr [2013-05-23 13:23:36+0200] Roman Cheplyaka wrote: The rule of thumb is that you should never use IncoherentInstances. The proper way to do it is: data Person :: Gender - * where Person :: String - Person b Child ::

[Haskell-cafe] question about type constructors

2013-05-22 Thread TP
Hi, In the program I am trying to write, I have a problem that can be reduced to the following dummy example: -- {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE IncoherentInstances #-}

Re: [Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-18 Thread TP
Chris Wong wrote: data Person :: Gender - * where Dead :: Person Gender -- WHAT DO I PUT HERE Alive :: { name :: String , weight :: Float , father :: Person Gender } - Person Gender Here's the problem. In the line: Dead :: Person Gender you

Re: [Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-18 Thread Denis Kasak
On 18 May 2013 11:16, TP paratribulati...@free.fr wrote: snip However, I have not managed to make the version with forall work. Below, the first occurrence of forall is ok, but the three following yield error. {-# LANGUAGE GADTs #-} {-# LANGUAGE

Re: [Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-18 Thread TP
Denis Kasak wrote: Note that all of this would work even without explicit quantification since you have already specified that Person accepts an argument of kind Gender. In other words, this works as expected: data Person :: Gender - * where Dead :: Person a Alive :: { name ::

[Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-17 Thread TP
Hi everybody, I have a question about deriving automatically a Show instance when using GADT. It works in this situation: {-# LANGUAGE GADTs #-} data Male data Female data Person gender where Dead :: Person gender Alive :: { name :: String ,

Re: [Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-17 Thread Adam Gundry
Hi TP, On 17/05/13 15:32, TP wrote: | [...] | | So I modify my code by removing deriving Show, and adding the line: | | instance Show (Person gender) | | | But now, I obtain: | | $ runghc test_show.hs | GHC stack-space overflow: current

Re: [Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-17 Thread TP
Adam Gundry wrote: [...] To use standalone deriving, you need to write deriving instance Show (Person gender) and everything will work fine. By writing instance Show (Person gender) you are instead giving an instance with no methods, and the default methods in the Show class contain

Re: [Haskell-cafe] question about GADT and deriving automatically a Show instance

2013-05-17 Thread Chris Wong
On Sat, May 18, 2013 at 9:11 AM, TP paratribulati...@free.fr wrote: So the following version does not work: [..] data Person :: Gender - * where Dead :: Person Gender -- WHAT DO I PUT HERE Alive :: { name :: String , weight ::

[Haskell-cafe] question about PutM patterns

2013-03-22 Thread Alexander V Vershilov
Hello, cafe. I have a big problem using builders, so currently I'm using own builder based on Nettle one [1]. It uses Strict bytestring to build into and unchecked writes, thus it's very unsafe, plus other builders/PutM, developed rapidly so I like to switch to another one. However I use some

Re: [Haskell-cafe] Question about updating GHC on MacOS

2013-03-14 Thread Alfredo Di Napoli
From my $0.2 experience, if you are planning of having multiple GHC installation, it would be better to do a fresh install using the bootstrapped GHC you can find on the website. Roughly I have done this way (on my Mac and on My EC2 instance): (inside a ghc bootstrapped folder) ./configure

Re: [Haskell-cafe] Question about updating GHC on MacOS

2013-03-11 Thread Alp Mestanogullari
I don't think so. However, you can install the OS X binaries for ghc 7.6.2 and make that sit just next to your Haskell Platform install. You can even use your existing cabal-install to install packages for the freshly installed ghc by doing 'cabal install foo --with-ghc=/path/to/ghc'. Just watch

[Haskell-cafe] Question about updating GHC on MacOS

2013-03-07 Thread Graham Klyne
Hi, I have Haskell Platform with GHC[i] 7.4.2 installed on a MacOS system. There's a problem with the handling of certain Markdown constructs in literate Haskell (lines starting with '#') that I understand is fixed in 7.6.2. Therefore, I'd like to be able to update my GHC installation to

[Haskell-cafe] Question about forkIO

2013-02-28 Thread C K Kashyap
Hi All, Say I have a haskell function 'f' that does a forkIO and starts an action a. I create a DLL of this haskell code and inovke f from C. Can I expect the a to continue to run once f has returned to C? Regards, Kashyap ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread C K Kashyap
Just to clarify, here is the sample haskell code that I am using - {-# LANGUAGE ForeignFunctionInterface #-} module Glue where import Foreign.C.String import qualified Control.Concurrent as CC funHaskell :: CString - IO Int funHaskell cstr = do putStrLn Haskell function called str -

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread Brandon Allbery
On Thu, Feb 28, 2013 at 6:09 AM, C K Kashyap ckkash...@gmail.com wrote: Say I have a haskell function 'f' that does a forkIO and starts an action a. I create a DLL of this haskell code and inovke f from C. Can I expect the a to continue to run once f has returned to C? While you're off in C

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread Donn Cave
Quoth C K Kashyap ckkash...@gmail.com, ... Say I have a haskell function 'f' that does a forkIO and starts an action a. I create a DLL of this haskell code and inovke f from C. Can I expect the a to continue to run once f has returned to C? Once control returns to f's caller, outside of the

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread C K Kashyap
Hey Donn .. thanks, it turns out that threads do resume!!! This is how I got my gmail stuff working. I only have a doubt if the TCP keep/alive stuff continues to happen or not Regards, Kashyap On Thu, Feb 28, 2013 at 9:07 PM, Donn Cave d...@avvanta.com wrote: Quoth C K Kashyap

Re: [Haskell-cafe] question about: --hyperlink-source

2013-02-22 Thread Albert Y. C. Lai
On 13-02-21 05:18 AM, Doaitse Swierstra wrote: I ran into the problem that for the packages which I install using cabal install The generated html does not contain links to the sources. This issue was raised before in:

[Haskell-cafe] question about: --hyperlink-source

2013-02-21 Thread Doaitse Swierstra
I ran into the problem that for the packages which I install using cabal install The generated html does not contain links to the sources. This issue was raised before in: http://stackoverflow.com/questions/1587635/haddock-for-cabal-installed-modules I have been looking into the documentation

Re: [Haskell-cafe] question about: --hyperlink-source

2013-02-21 Thread Ivan Lazar Miljenovic
On 21 February 2013 21:18, Doaitse Swierstra doai...@swierstra.net wrote: I ran into the problem that for the packages which I install using cabal install The generated html does not contain links to the sources. This issue was raised before in:

Re: [Haskell-cafe] Question about type inference of a GADT term

2012-09-22 Thread Florian Lorenzen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yes, of course! Stupid me, thanks for pointing that out Daniel. Now it works as expected. Florian On 09/22/2012 12:55 AM, Daniel Peebles wrote: Shouldn't you have IxZero :: Ix (CtxCons ty ctx) ty instead of IxZero :: Ix ctx ty On

[Haskell-cafe] Question about type inference of a GADT term

2012-09-21 Thread Florian Lorenzen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello cafe, I have the following GADT definitions capturing the simply typed lambda calculus with de Bruijn indices for variables and explicitly annotated types for variables: {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE

Re: [Haskell-cafe] Question about type inference of a GADT term

2012-09-21 Thread Daniel Peebles
Shouldn't you have IxZero :: Ix (CtxCons ty ctx) ty instead of IxZero :: Ix ctx ty On Fri, Sep 21, 2012 at 8:34 AM, Florian Lorenzen florian.loren...@tu-berlin.de wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello cafe, I have the following GADT definitions capturing the

[Haskell-cafe] Question on proper use of Data.IORef

2012-06-22 Thread Captain Freako
Hi experts, I fear I don't understand how to properly use *Data.IORef*. I wrote the following code: 1 -- Testing Data.IORef 2 module Main where 3 4 import Data.IORef 5 6 bump :: IORef Int - IO() 7 bump theRef = do 8 tmp - readIORef theRef 9 let tmp2 = tmp + 1 10

Re: [Haskell-cafe] Question on proper use of Data.IORef

2012-06-22 Thread Adam Smith
theValueRef isn't a pointer to theValue that you can use to somehow change theValue (which is immutable). theValueRef is a reference to a box that contains a totally separate, mutable value. When you use newIORef to create theValueRef, it's *copying* theValue into the box. When you mutate

Re: [Haskell-cafe] Question on proper use of Data.IORef

2012-06-22 Thread Max Rabkin
On Fri, Jun 22, 2012 at 5:30 PM, Captain Freako capn.fre...@gmail.com wrote:  12 main = do  13 let theValue = 1  14 print theValue  15 theValueRef - newIORef theValue  16 bump theValueRef  17 return theValue theValue is a plain old immutable Haskell variable. newIORef

Re: [Haskell-cafe] Question on proper use of Data.IORef

2012-06-22 Thread Captain Freako
Okay, I get it now. Thanks to all of you for your quick replies! So, here's what I need to do: 1. My Haskell code gets called by a higher level C function and asked to initialize itself. 2. As part of that initialization, I'm expected to return a pointer to an instance of a

Re: [Haskell-cafe] Question on proper use of Data.IORef

2012-06-22 Thread Antoine Latter
On Fri, Jun 22, 2012 at 11:18 AM, Captain Freako capn.fre...@gmail.com wrote: Okay, I get it now. Thanks to all of you for your quick replies! So, here's what I need to do: My Haskell code gets called by a higher level C function and asked to initialize itself. As part of that

Re: [Haskell-cafe] question about linking with sqlite3

2012-05-24 Thread Canhua
I know it. I used a sqlite.dll file that is compiled for 32bit, while my computer is 64bit. sorry for this stupid question. On Thu, May 24, 2012 at 10:04 AM, Canhua dreamerat...@gmail.com wrote: Hi, I made a cabal package that use HDBC-sqlite3 on Windows. When cabal install it, I got an error

[Haskell-cafe] question about linking with sqlite3

2012-05-23 Thread Canhua
Hi, I made a cabal package that use HDBC-sqlite3 on Windows. When cabal install it, I got an error from ld.exe: cannot find -lsqlite3. How can I tell ld.exe where sqlite3.dll is plcaed? Thanks. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-12 Thread Paul Graphov
Hi! Thanks to all who responded! I got a lot of information to read and think about. For now I decided to use stm-channelize as the simplest approach which seem to be enough. On Mon, Mar 5, 2012 at 9:50 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello. I've also written

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-05 Thread C K Kashyap
Thank you Jason. On Mon, Mar 5, 2012 at 1:05 PM, Jason Dagit dag...@gmail.com wrote: I don't know if timeline has been established, but my understanding is that there is a need for this and that the right people are aware of it and looking into it. The GHC trac has a ticket for this:

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-05 Thread Simon Marlow
There is a possibility that the IHG might fund this during the next cycle, which would mean that it would be in 7.6.1. Cheers, Simon On 05/03/2012 07:35, Jason Dagit wrote: I don't know if timeline has been established, but my understanding is that there is a need for this and that

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-05 Thread C K Kashyap
On Mon, Mar 5, 2012 at 2:54 PM, Simon Marlow marlo...@gmail.com wrote: There is a possibility that the IHG might fund this during the next cycle, which would mean that it would be in 7.6.1. Cheers, Simon That is very good to hear!!! Regards, Kashyap

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-05 Thread Alexander V Vershilov
Hello. I've also written simple chat server based on conduits and stm channels https://github.com/qnikst/chat-server/blob/master/src/Main.hs it has quite similar aproach and maybe this solution can be used together to have better results. -- Alexander Vershilov Sat, Mar 03, 2012 at 02:05:17AM

[Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-04 Thread C K Kashyap
Hi All, Can someone please let me know if there is a 64bit target on Windows on the horizon for GHC? I am trying to push for changing the current implementation in my organization in C++ to Haskell - Our primary targets are Windows and Mac. Not being able to generate 64bit DLL's on Windows would

Re: [Haskell-cafe] [haskell-cafe] Question about 64bit target on Windows platform

2012-03-04 Thread Jason Dagit
I don't know if timeline has been established, but my understanding is that there is a need for this and that the right people are aware of it and looking into it. The GHC trac has a ticket for this: http://hackage.haskell.org/trac/ghc/ticket/1884 On Sun, Mar 4, 2012 at 9:59 PM, C K Kashyap

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-03 Thread Gregory Collins
On Fri, Mar 2, 2012 at 5:19 PM, Paul Graphov grap...@gmail.com wrote: Hello Cafe! I am trying to implement networked application in Haskell. It should accept many client connections and support bidirectional conversation, that is not just loop with Request - Response function but also

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-03 Thread Alp Mestanogullari
Hi, On Sat, Mar 3, 2012 at 10:38 AM, Gregory Collins g...@gregorycollins.netwrote: Hi, The tutorial I gave for CUFP 2011 was a multi-user web chat program using the Snap Framework. STM channels make this kind of problem super-easy to deal with. Don't be afraid of forking lots of Haskell

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-03 Thread Gregory Collins
On Sat, Mar 3, 2012 at 12:50 PM, Alp Mestanogullari alpmes...@gmail.comwrote: That's exactly what I would have needed, several times in the past 2 years. I've been wondering about a good way to abstract this to have a library where you'd just plug your business logic and thus not have to care

[Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Paul Graphov
Hello Cafe! I am trying to implement networked application in Haskell. It should accept many client connections and support bidirectional conversation, that is not just loop with Request - Response function but also sending notifications to clients etc. NB: I came from C++ background and used to

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Alexander V Vershilov
Hello, Paul. It seems you should not use 3 threads, but run in a data-driven behaviour with one thread per client. You can take a look at network-conduit [1] example, there is a very good aproach to tcp-network application. There are some iteratee based examples but they are not so extensible.

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Joey Adams
On Fri, Mar 2, 2012 at 3:04 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello, Paul. It seems you should not use 3 threads, but run in a data-driven behaviour with one thread per client. I don't think this will work for Paul's situation. He needs to be able to send

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Alexander V Vershilov
Fri, Mar 02, 2012 at 07:34:41PM -0500, Joey Adams wrote On Fri, Mar 2, 2012 at 3:04 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello, Paul. It seems you should not use 3 threads, but run in a data-driven behaviour with one thread per client. I don't think this

Re: [Haskell-cafe] Question about concurrency, threads and GC

2012-03-02 Thread Joey Adams
On Fri, Mar 2, 2012 at 7:34 PM, Joey Adams joeyadams3.14...@gmail.com wrote: I'll try to put together a simple chat server example, like the one I wrote for stm-channelize. Here it is: https://github.com/joeyadams/haskell-chat-server-example See, in particular, the serveLoop function.

[Haskell-cafe] question about conduit source

2012-02-28 Thread Alexander V Vershilov
Hello, cafe. Is it possible to read data from different concurrent sources, i.e. read data from source as soon as it become avaliable, e.g. runResourceT $ (source1 stdin $= CL.map Left) = (source2 handle $= CL.map Right) $= application $$ sink

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Michael Snoyman
On Tue, Feb 28, 2012 at 6:04 PM, Alexander V Vershilov alexander.vershi...@gmail.com wrote: Hello, cafe. Is it possible to read data from different concurrent sources, i.e. read data from source as soon as it become avaliable, e.g.  runResourceT $ (source1 stdin $= CL.map Left)              

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Clark Gaebel
First of all, I'd probably name that operator =, since = is Kleisli composition in Control.Monad. Second, you're going to need new threads for this, since you'll be reading from two sources concurrently. This isn't as big a problem as you might think, because Haskell threads are dirt cheap,

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Clark Gaebel
Finally, I've uploaded a new version of stm-conduit [1] with these combinators included. You should cabal update and then cabal install stm-conduit to get the latest version, and now you can vertically compose your sources! Regards, - clark [1]

Re: [Haskell-cafe] question about conduit source

2012-02-28 Thread Alexander V Vershilov
Hello. Naming operator = instead of = is a good idea. But this functions are looks very good and will make code easier to understand. Also I'll try using non-STM channel (as Michael adviced) because in such a task I don't need all STM power. Thanks for response. -- Alexander Tue, Feb 28,

[Haskell-cafe] question in install gtk2hs's webkit hackage

2012-02-26 Thread Canhua
hi, I am cabal-installing webkit hackage on windows, and get a error: pkg-config pckage webkit-1.0 version 1.1.15 is required but could be not found What should I next? install webkit? How to? I find there is a webkitgtk+ project. Which one should I install. I have try to install both of them

Re: [Haskell-cafe] question regarding Data.Array.Accelerate

2012-02-12 Thread Philipp
Nevermind, I just realised I got something mixed up. Sorry to bother you. -- View this message in context: http://haskell.1045720.n5.nabble.com/question-regarding-Data-Array-Accelerate-tp5476144p5476586.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

[Haskell-cafe] question regarding Data.Array.Accelerate

2012-02-11 Thread Philipp
Hi, I have read the papers about the accelerate package that provides a high-level interface to nvidia's cuda library and am very intrigued. However, I have some start-up problems. Is this the right place for such questions? In particular, I'm having trouble with lifting and unlifting. From

[Haskell-cafe] Question on `runState'

2011-10-17 Thread Captain Freako
In this excerpt from the `StateArrow' page: runState :: Arrowhttp://hackage.haskell.org/packages/archive/base/4.2.0.2/doc/html/Control-Arrow.html#t:Arrowa = StateArrowhttp://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/Control-Arrow-Transformer-State.html#t:StateArrows a *e* b -

Re: [Haskell-cafe] Question on `runState'

2011-10-17 Thread Conrad Parker
On 17 October 2011 23:59, Captain Freako capn.fre...@gmail.com wrote: In this excerpt from the `StateArrow' page: runState :: Arrow a = StateArrow s a e b - a (e, s) (b, s)Source what's the significance of having written StateArrow s a e b, instead of StateArrow s a b c? In the context of

Re: [Haskell-cafe] Question on `runState'

2011-10-17 Thread David Fox
On Mon, Oct 17, 2011 at 5:32 PM, Conrad Parker con...@metadecks.org wrote: On 17 October 2011 23:59, Captain Freako capn.fre...@gmail.com wrote: In this excerpt from the `StateArrow' page: runState :: Arrow a = StateArrow s a e b - a (e, s) (b, s)Source what's the significance of having

Re: [Haskell-cafe] Question, re: using Automaton

2011-10-16 Thread Ertugrul Soeylemez
Captain Freako capn.fre...@gmail.com wrote: Encapsulating an automaton by running it on a stream of inputs, obtaining a stream of outputs. Typical usage in arrow notation: proc p - do ...*ys - (|runAutomaton (\x - ...)|) xs* Here xs refers to the input

Re: [Haskell-cafe] Question, re: using Automaton

2011-10-16 Thread Paterson, Ross
Captain Freako (quoting Control.Arrow.Transformer.Automaton): Encapsulating an automaton by running it on a stream of inputs, obtaining a stream of outputs. Typical usage in arrow notation: proc p - do ... ys - (|runAutomaton (\x - ...)|) xs Here

[Haskell-cafe] Question, re: using Automaton

2011-10-15 Thread Captain Freako
Hi all, In this excerpt from the Automatonhttp://hackage.haskell.org/packages/archive/arrows/0.4.1.2/doc/html/Control-Arrow-Transformer-Automaton.html#t:Automatonpage: runAutomaton :: (ArrowLoopChttp://hackage.haskell.org/packages/archive/base/4.2.0.2/doc/html/Control-Arrow.html#t:ArrowLoopa,

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-10 Thread Christian Maeder
Am 08.10.2011 16:04, schrieb Captain Freako: Hi all, In this definition from the Parsec library: parse :: (Stream s Identity t) = Parsec s () a - SourceName - s - Either ParseError a parse p = runP p () what's the significance of `Identity t'? (`t' isn't used

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-10 Thread Benjamin Redelings
On 10/08/2011 12:46 PM, Jan-Willem Maessen wrote: On Fri, Oct 7, 2011 at 2:46 PM, Brandon Moorebrandon_m_mo...@yahoo.com wrote: Margnus Carlsson did something monadic several years ago. http://dl.acm.org/citation.cfm?doid=581478.581482 Perhaps there is an implementation on Hackage or on his

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-08 Thread Heinrich Apfelmus
David Barbour wrote: Heinrich Apfelmus wrote: Even then, events and behaviors are one abstraction level too low. In my opinion, you are better off with a library/approach geared directly towards incremental computations. I believe behaviors are precisely the 'right' abstraction if the goal is

[Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Captain Freako
Hi all, In this definition from the Parsec library: parse :: (Stream s Identity t) = Parsec s () a - SourceName - s - Either ParseError aparse p = runP p () what's the significance of `Identity t'? (`t' isn't used anywhere.) Thanks, -db ___

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-08 Thread Jan-Willem Maessen
On Fri, Oct 7, 2011 at 2:46 PM, Brandon Moore brandon_m_mo...@yahoo.com wrote: Margnus Carlsson did something monadic several years ago. http://dl.acm.org/citation.cfm?doid=581478.581482 Perhaps there is an implementation on Hackage or on his website. This stuff also goes by the moniker

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Yves Parès
If I have this right, Stream is a monad transformer. Stream s m t means that it parses 's', is stacked with monad 'm' and has a result of type 't' So Identity is a monad, the simplest monad, defined as such: newtype Indentity t = Identity { runIdentity :: t } It's the identity monad, that does

  1   2   3   4   5   >