[Haskell-cafe] how to change a process name

2011-07-06 Thread 山本和彦
Hello, I would like to know how to change a process name in Haskell. When we are programming in C, we can change it by overriding argv on Unix. But I cannot find the same way to do in Haskell. Can anyone suggest how in Haskell? I'm not talking about the result of System.Environment.getProgName but

[Haskell-cafe] GHC/ARM registerised port

2011-07-06 Thread Karel Gardas
Hello, Stephen Blackheath, David Terei and me are working together on ARM registerised port of GHC. The port is using LLVM as a code generator and is kind of working already. (GHCi support still missing) If you are curious and would like to try the code, please read last two paragraphs cont

Re: [Haskell-cafe] [Haskell-Cafe] Constructive Probability Theory and RandProc's σ-algebras

2011-07-06 Thread David Banas
Hi Edward, Thanks for your interest in `RandProc`. I'm very interested in continuing this conversation with you, but I think I'd better read the papers you recommend, below first, so that I can do so intelligently. ;-) In the mean time, I do have these rather imprecise thoughts: (Please, see i

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread wren ng thornton
On 7/6/11 8:46 PM, Richard O'Keefe wrote: >> I've been working over the last year+ on an optimized HMM-based POS >> tagger/supertagger with online tagging and anytime n-best tagging. I'm >> planning to release it this summer (i.e., by the end of August), though >> there are a few things I'd like to

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread wren ng thornton
On 7/6/11 6:45 PM, Aleksandar Dimitrov wrote: > One hint, if you ever find yourself reading in quantitative linguistic data with > Haskell: forget lazy IO. Forget strict IO, except your documents aren't ever > bigger than a few hundred megs. In case you're not keeping the whole document in > memory

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread wren ng thornton
On 7/6/11 5:58 PM, Aleksandar Dimitrov wrote: > On Wed, Jul 06, 2011 at 09:32:27AM -0700, wren ng thornton wrote: >> On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: >>> Hi, >>> Continuing my search of Haskell NLP tools and libs, I wonder if the >>> following Haskell libraries exist (googling them doe

[Haskell-cafe] Haskell Weekly News: Issue 189

2011-07-06 Thread Daniel Santa Cruz
Welcome to issue 189 of the HWN, a newsletter covering developments in the Haskell community during the week of June 26 to July 2, 2011. It seems that it was a pretty quiet week in the mailing list. There were no significant announcements made, and the number of threads was low by c

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Richard O'Keefe
On 7/07/2011, at 7:04 AM, Dmitri O.Kondratiev wrote: > I am looking for Haskell implementation of sentence tokenizer such as > described by Tibor Kiss and Jan Strunk’s in “Unsupervised Multilingual > Sentence Boundary Detection”, which is implemented in NLTK: That method is multilingual but re

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Aleksandar Dimitrov
On Wed, Jul 06, 2011 at 03:14:07PM -0700, Rogan Creswick wrote: > Have you used that particular combination yet? I'd like to know the > details of how you hooked everything together if that's something you > can share. (We're working on a similar Frankenstein at the moment.) These Frankensteins,

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Rogan Creswick
On Wed, Jul 6, 2011 at 3:03 PM, Aleksandar Dimitrov wrote: > > So you'd use, say, UIMA+OpenNLP to do sentence boundaries, tokens, tags, > named-entities whatnot, then spit out some annotated format, read it in with > Haskell, and do the logic/magic there. Have you used that particular combination

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Aleksandar Dimitrov
On Wed, Jul 06, 2011 at 11:04:30PM +0400, Dmitri O.Kondratiev wrote: > On Wed, Jul 6, 2011 at 8:32 PM, wren ng thornton wrote: > > > On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: > > > Hi, > > > Continuing my search of Haskell NLP tools and libs, I wonder if the > > > following Haskell libraries

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Aleksandar Dimitrov
On Wed, Jul 06, 2011 at 09:32:27AM -0700, wren ng thornton wrote: > On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: > > Hi, > > Continuing my search of Haskell NLP tools and libs, I wonder if the > > following Haskell libraries exist (googling them does not help): > > 1) End of Sentence (EOS) Detecti

Re: [Haskell-cafe] unbuffered raw keyboard input on Windows

2011-07-06 Thread David Barbour
You could try the SDL package to support user input. 2011/7/6 José Romildo Malaquias > Hello. > > I want to write a Haskell console application (a game) in ghc where the > user will interact using the keyboard. I need to read the keys as soon > as they are typed and without echoing to the consol

[Haskell-cafe] unbuffered raw keyboard input on Windows

2011-07-06 Thread José Romildo Malaquias
Hello. I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console. Although Haskell provides this capability in the standard libraries (using hSetEcho and hSetB

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Jason Dagit
On Wed, Jul 6, 2011 at 12:52 PM, Simon Marlow wrote: > On 06/07/11 17:14, David Barbour wrote: >> >> >> On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow > > wrote: >> >>    On 06/07/2011 15:42, Jason Dagit wrote: >> >>        How can I make sure my library works from GHC (wi

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread David Barbour
On Wed, Jul 6, 2011 at 12:52 PM, Simon Marlow wrote: > > I think the real issue is that GHC has a different behavior than GHCi, >> and I think this causes a lot of difficulties for people working on GUI >> and other FFI integration. >> > Well, GHCi has no main, so it doesn't seem surprising (to m

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 06/07/11 17:19, Gábor Lehel wrote: On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit wrote: On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlowwrote: On 06/07/2011 07:37, Jason Dagit wrote: On Jul 5, 2

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 06/07/11 17:14, David Barbour wrote: On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow mailto:marlo...@gmail.com>> wrote: On 06/07/2011 15:42, Jason Dagit wrote: How can I make sure my library works from GHC (with arbitrary user threads) and from GHCI? Right, but usual

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Dmitri O.Kondratiev
On Wed, Jul 6, 2011 at 8:32 PM, wren ng thornton wrote: > On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: > > Hi, > > Continuing my search of Haskell NLP tools and libs, I wonder if the > > following Haskell libraries exist (googling them does not help): > > 1) End of Sentence (EOS) Detection. Brea

Re: [Haskell-cafe] How to ensure code executes in the context ofaspecific OS thread?

2011-07-06 Thread Donn Cave
Quoth Brandon Allbery , ... > I don't know about the general case, but OS X does treat the main > thread specially here; the (native, not X11) framework sets up the > connection to Core Graphics in the main thread before invoking the > main program, so you can't make whatever it is (thread local st

Re: [Haskell-cafe] How to ensure code executes in the context of aspecific OS thread?

2011-07-06 Thread Brandon Allbery
2011/7/6 Gábor Lehel : > Hmm. That does seem like a pretty strong "disproof". I wonder if my > hypothesis is wrong in general, or if this particular library does in > fact have other requirements (thread-local storage or such) (and in > this case whether my other assumption was wrong and this is ac

Re: [Haskell-cafe] (no subject)

2011-07-06 Thread Thomas DuBuisson
Ian, This requires dynamic typing using Data.Dynamic (for application) and Data.Typeable (to do the typing). Namely, you are asking for the "dynApply" function: START CODE import Data.Dynamic import Data.Typeable import Control.Monad maybeApp :: (Typeable a, Typeable b, Typeable c) => a ->

Re: [Haskell-cafe] How to ensure code executes in the context of aspecific OS thread?

2011-07-06 Thread Gábor Lehel
2011/7/6 Donn Cave : > Quoth =?ISO-8859-1?Q?G=E1bor_Lehel?= , > ... >> Stated another way: I suspect most GUI libraries don't really actually >> care that you only execute GUI code from the main OS thread, as much >> as they care that only one (thread-unsafe) GUI function is being >> called at any

Re: [Haskell-cafe] How to ensure code executes in the context of aspecific OS thread?

2011-07-06 Thread Donn Cave
Quoth =?ISO-8859-1?Q?G=E1bor_Lehel?= , ... > Stated another way: I suspect most GUI libraries don't really actually > care that you only execute GUI code from the main OS thread, as much > as they care that only one (thread-unsafe) GUI function is being > called at any given time. If you only ever

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Gábor Lehel
2011/7/6 Gábor Lehel : > 2011/7/6 Gábor Lehel : >> On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit wrote: >>> On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: On 06/07/2011 15:42, Jason Dagit wrote: > > On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow  wrote: >> >> On 06/07/2011 0

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread wren ng thornton
On 7/6/11 9:27 AM, Dmitri O.Kondratiev wrote: > Hi, > Continuing my search of Haskell NLP tools and libs, I wonder if the > following Haskell libraries exist (googling them does not help): > 1) End of Sentence (EOS) Detection. Break text into a collection of > meaningful sentences. Depending on ho

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Gábor Lehel
2011/7/6 Gábor Lehel : > On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit wrote: >> On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: >>> On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow  wrote: > > On 06/07/2011 07:37, Jason Dagit wrote: >>

Re: [Haskell-cafe] How to ensure code executes in the context of aspecific OS thread?

2011-07-06 Thread Donn Cave
Quoth Jason Dagit , ... > Yes. From my perspective (that of a library writer) that's what makes > this tricky in GHCi. I need GHCi's cooperation. From GHCi's > perspective it's tricky too. It seems to me that ideally, GHCi would do its thing in a child thread, like the extra runtime threads, an

Re: [Haskell-cafe] Arrow instance of function type [a] -> [b]

2011-07-06 Thread David Barbour
On Wed, Jul 6, 2011 at 6:04 AM, Markus Läll wrote: > Is it possible to define an Arrow instance of list to list functions? > > import Control.Arrow > import Control.Category > > type X a b = [a] -> [b] > You need a newtype here. (->) is already an arrow. _

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread David Barbour
On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: > On 06/07/2011 15:42, Jason Dagit wrote: > >> How can I make sure my library works from GHC (with arbitrary > > user threads) and from GHCI? >> > Right, but usually the way this is implemented is with some cooperation from > the main thread. [

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Gábor Lehel
On Wed, Jul 6, 2011 at 5:24 PM, Jason Dagit wrote: > On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: >> On 06/07/2011 15:42, Jason Dagit wrote: >>> >>> On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow  wrote: On 06/07/2011 07:37, Jason Dagit wrote: > > On Jul 5, 2011 1:04 PM, "J

Re: [Haskell-cafe] Automatic Reference Counting

2011-07-06 Thread David Barbour
On Tue, Jul 5, 2011 at 9:00 PM, steffen wrote: > The important point about reference counting on idevices is the near > realtime performance, since stops for collecting garbage are actually very > short in comparison to collecting compilers (despite more frequent). You can get near realtime perf

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Jason Dagit
On Wed, Jul 6, 2011 at 8:51 AM, Simon Marlow wrote: > On 06/07/2011 16:24, Jason Dagit wrote: >> >> On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow  wrote: >>> >>> On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow  wrote: > > On 06/07/2011 07:

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 06/07/2011 16:24, Jason Dagit wrote: On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlowwrote: On 06/07/2011 07:37, Jason Dagit wrote: On Jul 5, 2011 1:04 PM, "Jason Dagit"mailto:dag...@gmail.com>>

Re: [Haskell-cafe] NVIDIA's CUDA and Haskell

2011-07-06 Thread Johannes Waldmann
Trevor L. McDonell cse.unsw.edu.au> writes: > hmm... so libcuda and libcudart are in /usr/local/cuda/lib ... actually libcuda is in /usr/lib/nvidia-current , unbeknownst to ./configure. I think this comes from package "nvidia-current(-dev)" in ubuntu. I could solve this with LDFLAGS='-L/usr/li

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Jason Dagit
On Wed, Jul 6, 2011 at 8:09 AM, Simon Marlow wrote: > On 06/07/2011 15:42, Jason Dagit wrote: >> >> On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow  wrote: >>> >>> On 06/07/2011 07:37, Jason Dagit wrote: On Jul 5, 2011 1:04 PM, "Jason Dagit">>> >  wrote:  > >>>

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 06/07/2011 15:42, Jason Dagit wrote: On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow wrote: On 06/07/2011 07:37, Jason Dagit wrote: On Jul 5, 2011 1:04 PM, "Jason Dagit"mailto:dag...@gmail.com>> wrote: > > On Tue, Jul 5, 2011 at 12:33 PM, Ian Lynaghmailto:ig...@earth.li>> wrote: > >

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Jason Dagit
On Wed, Jul 6, 2011 at 2:23 AM, Simon Marlow wrote: > On 06/07/2011 07:37, Jason Dagit wrote: >> >> On Jul 5, 2011 1:04 PM, "Jason Dagit" > > wrote: >>  > >>  > On Tue, Jul 5, 2011 at 12:33 PM, Ian Lynagh > > wrote: >>  > > On Tue, Jul 05, 2011 at 08

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Jason Dagit
On Wed, Jul 6, 2011 at 2:20 AM, Simon Marlow wrote: > On 05/07/2011 20:38, Jason Dagit wrote: >> >> On Tue, Jul 5, 2011 at 12:11 PM, Simon Marlow  wrote: >>> >>> On 04/07/11 06:02, Jason Dagit wrote: Hello, I'm trying to get some GUI code working on OSX and numerous forums

Re: [Haskell-cafe] Arrow instance of function type [a] -> [b]

2011-07-06 Thread Brandon Allbery
On Wed, Jul 6, 2011 at 09:43, Steffen Schuldenzucker wrote: > > Hi Markus, > > On 07/06/2011 03:04 PM, Markus Läll wrote: >> >> [...] >> >> import Control.Arrow >> import Control.Category >> >> type X a b = [a] ->  [b] >> >> instance Category X where >>    id = map Prelude.id >>    g . f = g Prelu

Re: [Haskell-cafe] Arrow instance of function type [a] -> [b]

2011-07-06 Thread Steffen Schuldenzucker
Hi Markus, On 07/06/2011 03:04 PM, Markus Läll wrote: [...] import Control.Arrow import Control.Category type X a b = [a] -> [b] instance Category X where id = map Prelude.id g . f = g Prelude.. f instance Arrow X where arr f = map f first f = unzip>>> first f>>> uncurry

Re: [Haskell-cafe] NLP libraries and tools?

2011-07-06 Thread Dmitri O.Kondratiev
Hi, Continuing my search of Haskell NLP tools and libs, I wonder if the following Haskell libraries exist (googling them does not help): 1) End of Sentence (EOS) Detection. Break text into a collection of meaningful sentences. 2) Part-of-Speech (POS) Tagging. Assign part-of-speech information to ea

[Haskell-cafe] Arrow instance of function type [a] -> [b]

2011-07-06 Thread Markus Läll
Hi! Is it possible to define an Arrow instance of list to list functions? Something like import Control.Arrow import Control.Category type X a b = [a] -> [b] instance Category X where id = map Prelude.id g . f = g Prelude.. f instance Arrow X where arr f = map f first f = unzip >>>

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread John Lato
Message: 23 > Date: Wed, 06 Jul 2011 10:14:56 +0100 > From: Simon Marlow > Subject: Re: [Haskell-cafe] How to ensure code executes in the context >of aspecific OS thread? > To: Jason Dagit , cvs-...@haskell.org,Haskell > Cafe > > Message-ID: <4e142790.8090...@gmail.com

Re: [Haskell-cafe] function terms

2011-07-06 Thread oleg
Ian Childs wrote: > I have a function that returns a witness to 's :: Term a' and 't :: > Term b' having the same type, if they do, but I am wondering how to > extend this to the first argument of an arrow type. Basically you have to write the deconstruct that takes (TRepr a), the witness for typ

Re: [Haskell-cafe] function terms

2011-07-06 Thread Ian Childs
Sorry, that should be (Const "="). The GADT is defined as follows: data Var a where MkVar :: (GType a) => String -> Var a data LTerm a where Var :: (GType a) => Var a -> LTerm a Const :: (GType a) => String -> LTerm a (:.) :: (GType a, GType b) => LTerm (a -> b) -> LTerm a -> LTerm b A

Re: [Haskell-cafe] function terms

2011-07-06 Thread Henning Thielemann
On Wed, 6 Jul 2011, Ian Childs wrote: Term a is meant to be the simply-typed lambda-calculus as a GADT. Then given two terms App (App "=" l1) r1, and App (App "=" l2) r2, I want to form App (App "=" (App l1 l2)) (App r1 r2), but as you can see this will only work if the types of l1 and l2, an

Re: [Haskell-cafe] function terms

2011-07-06 Thread Ian Childs
Term a is meant to be the simply-typed lambda-calculus as a GADT. Then given two terms App (App "=" l1) r1, and App (App "=" l2) r2, I want to form App (App "=" (App l1 l2)) (App r1 r2), but as you can see this will only work if the types of l1 and l2, and r1 and r2, match as detailed previ

Re: [Haskell-cafe] function terms

2011-07-06 Thread Henning Thielemann
On Wed, 6 Jul 2011, Ian Childs wrote: Yes they are Haskell expressions - I called them terms because actually they are GADTs of type Term a and Term b. I can't use type 'b -> c' as they are part of a larger pattern. I have a function that returns a witness to 's :: Term a' and 't :: Term b'

Re: [Haskell-cafe] function terms

2011-07-06 Thread Ian Childs
Yes they are Haskell expressions - I called them terms because actually they are GADTs of type Term a and Term b. I can't use type 'b -> c' as they are part of a larger pattern. I have a function that returns a witness to 's :: Term a' and 't :: Term b' having the same type, if they do, but

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 06/07/2011 07:37, Jason Dagit wrote: On Jul 5, 2011 1:04 PM, "Jason Dagit" mailto:dag...@gmail.com>> wrote: > > On Tue, Jul 5, 2011 at 12:33 PM, Ian Lynagh mailto:ig...@earth.li>> wrote: > > On Tue, Jul 05, 2011 at 08:11:21PM +0100, Simon Marlow wrote: > >> > >> In GHCi it's a different

Re: [Haskell-cafe] function terms

2011-07-06 Thread Henning Thielemann
On Wed, 6 Jul 2011, Ian Childs wrote: Suppose I have two terms s and t of type "a" and "b" respectively, and I want to write a function that returns s applied to t if "a" is an arrow type of form "b -> c", and nothing otherwise. How do i convince the compiler to accept the functional applicat

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 05/07/2011 20:38, Jason Dagit wrote: On Tue, Jul 5, 2011 at 12:11 PM, Simon Marlow wrote: On 04/07/11 06:02, Jason Dagit wrote: Hello, I'm trying to get some GUI code working on OSX and numerous forums around the internet keep reiterating that on OSX to correctly handle GUI events you nee

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-06 Thread Simon Marlow
On 05/07/2011 20:33, Ian Lynagh wrote: On Tue, Jul 05, 2011 at 08:11:21PM +0100, Simon Marlow wrote: In GHCi it's a different matter, because the main thread is running GHCi itself, and all the expressions/statements typed at the prompt are run in forkIO'd threads (a new one for each statement,

[Haskell-cafe] (no subject)

2011-07-06 Thread Ian Childs
Suppose I have two terms s and t of type "a" and "b" respectively, and I want to write a function that returns s applied to t if "a" is an arrow type of form "b -> c", and nothing otherwise. How do i convince the compiler to accept the functional application only in the correct instance?