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 wrote: > On Sun, Jun 30

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 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

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 use

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 9:56 AM, Tikhon Jelvis 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 for less e

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Tikhon Jelvis
<|> baz > > ~IRS > > From: haskell-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:

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 th

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Sturdy, Ian
___ From: haskell-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:

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 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 >

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: > 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 i

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 sh

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 everyo

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 dicsus

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, whe

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 tha

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" wrote: > > 1) Are there wide-spread conventions in the Haskell community for how to

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" 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, and I'm not > fi

[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 com

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 04:05:0

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 v

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 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, D

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 :: > Newtype > n > o => (o -> n) -> n -> > oSource

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

2013-06-07 Thread Roman Cheplyaka
* David Banas [2013-06-07 07:08:19-0700] > Hi All, > > Referring to the following, which is taken from the *Control.Newtype > *documentation > page: > > op :: > Newtype > n > o => (o -> n) -> n -> >

[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 :: Newtype n o => (o -> n) -> n -> oSource

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

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

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 ev

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-05-31 Thread Richard Eisenberg
#x27;re asking all the right questions! Richard -Original Message- From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@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,

[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 type constructors

2013-05-23 Thread Roman Cheplyaka
* TP [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 > > :: (PrettyPrint a,

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 -> Pe

Re: [Haskell-cafe] question about type constructors

2013-05-22 Thread Roman Cheplyaka
* TP [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 #-} > {-# LANGUAGE FlexibleIns

[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 #-} clas

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 :: {

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 wrote: > > 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 StandaloneDeriving #-} > {

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

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 wrote: > > So the following version does not work: > > [..] > data Person :: Gender -> * where > Dead :: Person Gender -- WHAT DO I PUT HERE > Alive :: { name :: String > , weight :: Float >

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 cl

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 l

[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 , w

[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 patt

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 --pref

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 wh

[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 7.6

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 wrote: > Quoth C K Kashyap , > ... > > Say I hav

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread Donn Cave
Quoth C K Kashyap , ... > 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 Haskell ru

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread Brandon Allbery
On Thu, Feb 28, 2013 at 6:09 AM, C K Kashyap 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 the I/O

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 <-

[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 mail

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: http://stackoverflow.com/questions/1587635/haddock-for-cabal-installed-mod

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

2013-02-21 Thread Ivan Lazar Miljenovic
On 21 February 2013 21:18, 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: > > http://stackoverflow.com/questions/1587635/haddock-for-ca

[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 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 > >

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 th

[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 DataK

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 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 initialization, I'm expected

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 particular

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 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" creates an IORe

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 theVal

[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 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 wrote: > Hi, I made a cabal package that use HDBC-sqlite3 on Windows. > When cabal install it, I got an error from ld.exe: cannot

[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 http

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 wrote: > Hello. > > I've also written simple chat server based on c

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

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 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] [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 the

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 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: > http://hackage.h

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 wrot

[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 be

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 wrote: > 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 anymore about

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 wrote: > 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 threads for programs >

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 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 sending notifi

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 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. When a message is received

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 > 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 Pau

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 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 notifications to clients. This m

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. [

[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 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

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] http://hackage.haskell.org/package/stm-conduit

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, or

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 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) >                   >=> (source2 hand

[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

[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 wh

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

2011-10-17 Thread David Fox
On Mon, Oct 17, 2011 at 5:32 PM, Conrad Parker wrote: > On 17 October 2011 23:59, Captain Freako 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", ins

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

2011-10-17 Thread Conrad Parker
On 17 October 2011 23:59, Captain Freako 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 that page,

[Haskell-cafe] Question on `runState'

2011-10-17 Thread Captain Freako
In this excerpt from the `StateArrow' page: runState :: Arrowa => StateArrows a *e*

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

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

2011-10-16 Thread Ertugrul Soeylemez
Captain Freako 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 stream and x

[Haskell-cafe] Question, re: using Automaton

2011-10-15 Thread Captain Freako
Hi all, In this excerpt from the Automatonpage: runAutomaton :: (ArrowLoopCa,

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 Moore 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

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 on definition of `parse' function in Parsec library.

2011-10-08 Thread Yves Parès
Wow... my bad. Stream is in no way a monad transformer. I really should read before speaking... Stream s m t is such as "An instance of Stream has stream type s, underlying monad m and token type t determined by the stream" ( http://hackage.haskell.org/packages/archive/parsec/3.1.1/doc/html/Text-P

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 n

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 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 "adaptive compu

[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 ___ H

  1   2   3   4   5   >