Re: [Haskell-cafe] pure Haskell database

2008-09-25 Thread Rich Neswold
On Thu, Sep 25, 2008 at 11:09 AM, Manlio Perillo [EMAIL PROTECTED]wrote: Rich Neswold ha scritto: On Wed, Sep 24, 2008 at 4:17 PM, Manlio Perillo [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] wrote: I need a simple, concurrent safe, database, written in Haskell. A database

Re: [Haskell-cafe] pure Haskell database

2008-09-24 Thread Rich Neswold
to use SQLite. How about MVar (Map k Int)? or even Map k (MVar Int)? -- Rich LOI: https://www.google.com/reader/shared/00900594587109808626 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Rich Neswold
Functor (Either a), but not Monad (Either a) or even Monad (Either String)...] It's used in the Error Monad. -- Rich JID: [EMAIL PROTECTED] LOI: https://www.google.com/reader/shared/00900594587109808626 ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Help using CGIT

2007-08-24 Thread Rich Neswold
On 8/24/07, Bjorn Bringert [EMAIL PROTECTED] wrote: On Aug 23, 2007, at 3:34 , Rich Neswold wrote: Bingo! Method #3 works beautifully! I missed the using-lift-with- the-constructor permutation. Thanks for your help! I started writing a tutorial for Haskell web programming with the cgi

[Haskell-cafe] Help using CGIT

2007-08-22 Thread Rich Neswold
didn't find any from Google)? Shouldn't I be able to use 'runCGI' with my monad? CGIT users shouldn't be required to re-implement 'runCGI, right? Any help or ideas is appreciated! -- Rich JID: [EMAIL PROTECTED] AIM: rnezzy ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Help using CGIT

2007-08-22 Thread Rich Neswold
On 8/22/07, Ian Lynagh [EMAIL PROTECTED] wrote: On Wed, Aug 22, 2007 at 01:27:00PM -0500, Rich Neswold wrote: newtype App a = App (ReaderT Connection (CGIT IO) a) deriving (Monad, MonadIO, MonadReader Connection) Unfortunately, when another module tries to actually use the monad

Re: [Haskell-cafe] Re: Bi-directional Maps

2007-08-20 Thread Rich Neswold
mapping in each direction. The Bimap should have the uniqueness promise that Set (k, v) gives. Yet you should be able to search on either tuple value. -- Rich JID: [EMAIL PROTECTED] AIM: rnezzy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] interrupting an accept()ing thread

2007-07-07 Thread Rich Neswold
context. Otherwise once the process is forked, the socket gets closed by the parent process. Something more along the lines of: unblock (forkIO $ doStuff t `finally` sClose t) -- Rich JID: [EMAIL PROTECTED] AIM: rnezzy ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] interrupting an accept()ing thread

2007-07-06 Thread Rich Neswold
exceptions to make spin exit. What about using bracketOnError? nextClient s = bracketOnError (fst . accept s) sClose spin = do nextClient s (\s' - forkIO $ dealWith s') spin If bracketOnError leaks the resource in the event of an exception, then it needs to be fixed. -- Rich JID: [EMAIL

Re: [Haskell-cafe] Telling the time

2007-06-21 Thread Rich Neswold
layouts in your files (hopefully consistent in the same file!), you simply change the format string for each file. -- Rich JID: [EMAIL PROTECTED] AIM: rnezzy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

[Haskell-cafe] Re: Darcs on Solaris x86

2007-06-15 Thread Rich Collins
, at 3:40 AM, Christian Maeder wrote: Rich Collins schrieb: I was able to install the ghc binary for solaris x86, but darcs fails on configure: It's not a darcs problem. configure:2718: ghc -o conftest conftest.hs ld: fatal: symbol `GHC_ZCCReturnable_static_info' in file /opt/local/lib/ghc

[Haskell-cafe] Darcs on Solaris x86

2007-06-14 Thread Rich Collins
I was able to install the ghc binary for solaris x86, but darcs fails on configure: configure:2718: ghc -o conftest conftest.hs ld: fatal: symbol `GHC_ZCCReturnable_static_info' in file /opt/local/ lib/ghc-6.6.1/libHSrts.a(PrimOps.o): section [1] .text: size 8212: symbol (address 0x2014,

Re: Locating shared libraries

2007-06-13 Thread Rich Neswold
ought to be placed in /usr/local/lib (or /usr/pkg/lib for systems that use the Package System: http://www.pkgsrc.org). Haskell libraries shouldn't mingle with the base OS libraries. But it shouldn't be separate from the other third-party libraries, either. -- Rich JID: [EMAIL PROTECTED] AIM

Re: Locating shared libraries

2007-06-12 Thread Rich Neswold
binaries is seen as a security problem. Since every NetBSD system has its libraries in one directory and third-party libraries are in /usr/pkg/lib, there's no problem in hardcoding the paths. Just another data point... -- Rich JID: [EMAIL PROTECTED] AIM: rnezzy

Re: [Haskell-cafe] [IO Int] - IO [Int]

2007-05-04 Thread Rich Neswold
/docs/latest/html/libraries/;. Just start looking at modules that sound interesting and see what has already been defined. Some modules at first may be too advanced, but if you go back to them in a few days (weeks?), they'll start making more sense, too. -- Rich AIM : rnezzy ICQ : 174908475 Jabber

Re: [Haskell] What's with Network.Socket?

2007-04-10 Thread Rich Neswold
the PortNum type does. -- Rich AIM : rnezzy ICQ : 174908475 Jabber: [EMAIL PROTECTED] ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: Re[2]: [Haskell-cafe] Tracking characters and a timestamp ?

2007-04-05 Thread Rich Neswold
On 4/5/07, Bulat Ziganshin [EMAIL PROTECTED] wrote: you definitely should read http://haskell.org/haskellwiki/IO_inside Thanks for mentioning this link -- I wasn't aware of it. I wish it existed when I first started learning Haskell... -- Rich AIM : rnezzy ICQ : 174908475 Jabber: [EMAIL

Re: Network.Socket endian problem?

2006-12-15 Thread Rich Neswold
or Marshall libraries that help Haskell programmers write out network byte order values. I didn't check any third party libraries yet. -- Rich AIM : rnezzy ICQ : 174908475 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http

Re: Network.Socket endian problem?

2006-12-14 Thread Rich Neswold
. Thanks to everyone for their help and suggestions. I agree, however, with Tomasz that the address should be in host byte order to the application. At the very least, the port value and the address should use the same byte ordering. For now, I'll use inet_addr as a constructor. Thanks again. -- Rich

Network.Socket endian problem?

2006-12-13 Thread Rich Neswold
this is a regression in 6.6 or simply an overlooked detail. Should I file a PR? Am I doing something wrong? -- Rich AIM : rnezzy ICQ : 174908475 ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo

Re: Network.Socket endian problem?

2006-12-13 Thread Rich Neswold
:6802 ESTABLISHED (I removed my IP address.) The second bound address, however, is wrong: the octets are in the wrong order. Notice, though, that the port number is correct! Thanks for looking into this! -- Rich AIM : rnezzy ICQ : 174908475 ___ Glasgow

Re: [Haskell-cafe] split string into n parts

2006-10-23 Thread Rich Neswold
On 10/23/06, jim burton [EMAIL PROTECTED] wrote: I want to split a string into 5 parts of equal length, with the last fifth padded if necessary, but can't get it right I got this:fifths :: String - Stringfifths xs = let len = (length xs + 4) `div` 5 padded = take (len * 5) (xs ++ ) in unwords $

threadDelay not ending

2006-09-18 Thread Rich Fought
. Any ideas? What would have changed between 6.4 and 6.4.2 that would cause this behavior? Thanks, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: threadDelay not ending

2006-09-18 Thread Rich Fought
I am running on Red Hat Enterprise Linux with the latest RH 2.6 kernel. This is very bizarre and I am having a hard time figuring out what is going on. I don't see any issues in the project code itself, just my unit tests. Rich Seth Kurtzberg wrote: What is your environment? My project

Re: getMBlocks

2006-08-10 Thread Rich Fought
retained elsewhere. I do pass the handle off to another thread via forking - this shouldn't be an issue should it? Another retainer involves SYSTEM and Network.accept - what exactly does SYSTEM mean? Regards, Rich ___ Glasgow-haskell-users mailing list

Re: getMBlocks

2006-08-08 Thread Rich Fought
. It should at least look different. Thanks, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

getMBlocks

2006-08-07 Thread Rich Fought
somewhere in my Haskell code, though none of leak check tools I utilize indicate such. Thanks, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Chasing a memory leak

2006-07-28 Thread Rich Fought
Thanks, you are absolutely right. There is an offset between the function addresses defined in the link map and the addresses that show up in gdb. I've rolled up my Jump to Conclusions mat. Rich Simon Marlow wrote: Rich Fought wrote: I'm getting into the weeds of a GHC-compiled program

Chasing a memory leak

2006-07-27 Thread Rich Fought
internally for the GHC runtime. What does this function do, or how can I find out what it does? Thanks, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Heap Profiling Question

2006-07-24 Thread Rich Fought
://hackage.haskell.org/trac/ghc/ticket/769 So the out of order timetag of 3.100 in my original e-mail should really be 4.0. Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell

Re: Heap Profiling Question

2006-07-21 Thread Rich Fought
time0.00s ( 0.00s elapsed) Total time4.22s ( 5.65s elapsed) %GC time 0.7% (0.5% elapsed) Alloc rate4,988,795 bytes per MUT second Productivity 98.8% of total user, 73.8% of total elapsed Rich ___ Glasgow-haskell-users

Re: Heap Profiling Question

2006-07-21 Thread Rich Fought
? Thanks, Rich Rich Fought wrote: I'm trying to use heap profiling with +RTS -hc -i1 options and running my program for about 30 seconds. However, I only get around 7 samples with seemingly bogus timetags (i.e. 0.00, 3.69, 3.73, 3.10, 4.05, 4.12). What's going on? I'm running GHC 6.4.2 on Windows

regex.h included with GHC 6.4.2

2006-07-21 Thread Rich Fought
Am I crazy or is there an error in regex.h included with GHC? On line 110 there appears to be an extraneous or unterminated 'extern C {' Regards, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org

Heap Profiling Question

2006-07-20 Thread Rich Fought
I'm trying to use heap profiling with +RTS -hc -i1 options and running my program for about 30 seconds. However, I only get around 7 samples with seemingly bogus timetags (i.e. 0.00, 3.69, 3.73, 3.10, 4.05, 4.12). What's going on? I'm running GHC 6.4.2 on Windows (MSYS/MinGW). Thanks, Rich

Re: Text.Regex.Posix regcomp

2006-07-20 Thread Rich Fought
Thanks, upgrading to 6.4.2 seems to have done the trick. I've obviously put it off too long! Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Text.Regex.Posix regcomp

2006-07-18 Thread Rich Fought
times with each incoming request. I'm pretty sure it's not a multi-threading issue, as there is only one client sending requests over and over again. Can anyone suggest some ideas or debugging tips? TIA, Rich ___ Glasgow-haskell-users mailing list

[Haskell-cafe] Receiving multicasts

2006-06-15 Thread Rich Neswold
Hello, Has anyone figured out a way to receive multicasts in a Haskell program? It doesn't appear that Network.Socket.setSocketOption provides enough information to join a multicast address. Any information would be appreciated. -- Rich AIM : rnezzy ICQ : 174908475

solutions for errors installing ghc-6.4.1 (Mac OS X 10.4.6, Xcode 2.2.1)

2006-05-28 Thread Rich Talley
, if you want to run ghc-6.4.1 on a recent version of OS X which uses gcc 4.0 as default you'll need to run gcc_select to set gcc 3.3 as the default since that's what ghc_6.4.1 is compatible with.) Rich Talley ___ Glasgow-haskell-bugs mailing list Glasgow

GHC and Cygwin/MinGW

2006-04-13 Thread Rich Fought
targets MinGW. Does this mean that the GnuTLS libraries must be compiled for MinGW as well, or is it possible to link in cygwin libraries via the cygwin.dll somehow? Also, any ideas how difficult a Cygwin port of GHC would be? Tips would be much appreciated. Thanks, Rich

Full Release Notes for GHC 6.4.1?

2006-01-25 Thread Rich Fought
nasty FFI/threading issues that are causing GHC 6.4 to crash. Thanks, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Cross-Compiling with GHC?

2005-10-18 Thread Rich Fought
tells me however that this C code still may have some x86 specific stuff in it. Regards, Rich ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

[Haskell-cafe] Constructor constraints

2005-09-20 Thread Rich Neswold
Hello,I've looked through the two tutorials and the Report, but couldn't find help on this topic. My question is whether you can place constraints on new data types. For instance, I want to make a new type that is a 4 element tuple where each element is greater than or equal to the previous entry.

Re: [Haskell-cafe] Constructor constraints

2005-09-20 Thread Rich Neswold
On 9/20/05, Malcolm Wallace [EMAIL PROTECTED] wrote: You can make a 'smart' constructor function, and hide the real dataconstructor so that it cannot be used:Thanks! I'll give your solution a try.-- RichAIM : rnezzy ICQ : 174908475 ___ Haskell-Cafe

Re: FFI: calling Haskell from C++?

2005-09-14 Thread Rich Neswold
On 9/14/05, Simon Peyton-Jones [EMAIL PROTECTED] wrote: There's been a bit of traffic about calling Haskell from C++ recently, and I know that calling C++ from Haskell is a frequently asked question. Would someone like to write up a description of how to successfully call

Re: FFI: calling Haskell from C++?

2005-09-13 Thread Rich Neswold
On 9/13/05, Felix Breuer [EMAIL PROTECTED] wrote: $ ghc -fffi Foo.o Foo_stub.o main.cppmain.o(.text+0x22): In function `main':main.cpp: undefined reference to `__stginit_Foo()'main.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'collect2: ld returned 1 exit status In main.cpp,

order of computation in 'do' notation

2002-04-25 Thread Rich
is just silly. Surely the 'do' notation was designed to sequence computations, but it obviously isn't behaving quite right here! I'd be very grateful for any suggestions as to how to fix this. thanks, Rich. mainLoop :: IO TRS - IO () mainLoop t = do putStr \n (c,a) - getCommand 0

RE: order of computation in 'do' notation

2002-04-25 Thread Rich
Thanks very much everyone! I added the line hFlush stdout to the code and it works fine now - thanks for your help! Rich. ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

a more practical version of getLine???

2002-02-25 Thread Rich
normal text prompt. Any suggestins as to an alternative method to read the input??? (I'm by no means a Haskell expert btw, so I may have to be spoon fed!) thanks for your help, Rich. ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http