[Haskell-cafe] Erlang VM in Haskell

2007-08-15 Thread Joel Reymont
Folks, I would like to write an Erlang VM in Haskell. I first thought of OCaml but Haskell has SMP and lazy evaluation may come in handy. Plus, I'll need help in this project like in no other and support from the Haskell community has always been outstanding. I'm doing this to learn more

Re: [Haskell-cafe] Erlang VM in Haskell

2007-08-16 Thread Joel Reymont
On Aug 16, 2007, at 1:36 PM, Neil Bartlett wrote: However, wouldn't it be rather difficult, given that there doesn't seem to be a publicly available specification for the Erlang VM or the BEAM file format Very difficult, correct. I use Erlang daily, in fact Erlang is what brings bread to

[Haskell-cafe] Quasiquotations part of GHC?

2007-10-29 Thread Joel Reymont
Folks, Did quasiquotations ever make it into the GHC tree? They were implemented as a patch to 6.7. Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Embedding the GHC API

2007-10-31 Thread Joel Reymont
Has anyone tried to embed GHC as a library recently? What is the size of the resulting binary? I'm assuming a bare minimum of needed libraries. Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] CPP, Leopard and Haskell Objective-C bindings

2007-11-06 Thread Joel Reymont
It seems that the current approach taken by HOC is to strip preprocessing directives. This may not have been a problem before Leopard but Cocoa header files are now full of macros in most unusual places, e.g. @interface NSObject (NSDeprecatedMethods) + (void)poseAsClass:(Class)aClass

[Haskell-cafe] Re: CPP, Leopard and Haskell Objective-C bindings

2007-11-06 Thread Joel Reymont
On Nov 6, 2007, at 6:57 PM, Wolfgang Thaller wrote: That is not exactly what we want, I think. Currently, HOC parses things file-by-file, so we do NOT want to follow #include directives. We might just process the line pragmas from CPP to keep track of where things came from, OTOH. You

[Haskell-cafe] Leopard: ghc 6.8.1 and the case of the missing _environ

2007-11-06 Thread Joel Reymont
Symptoms: You build 6.8.1 from source on Leopard (x86 in my case) and then junior:ghc-6.8.1 joelr$ ghci GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help ghc-6.8.1: /usr/local/lib/ghc-6.8.1/lib/base-3.0.0.0/HSbase-3.0.0.0.o: unknown symbol `_environ' Loading package base ...

[Haskell-cafe] HOC is dead! Long live HOC!

2007-11-07 Thread Joel Reymont
BridgeSupport [1] is new functionality in Leopard that makes the current Haskell Objective-C bindings (HOC) obsolete (almost). --- The metadata is intended to be a resource for use beyond bridging. Most frameworks on the system provide two chunks of XML BridgeSupport metadata; succinct and

[Haskell-cafe] Memory-mapped arrays?

2007-11-07 Thread Joel Reymont
Is there such a thing as memory-mapped arrays in GHC? I'm looking for something that would let me memory-map a file of floats and access it as an array. Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list

[Haskell-cafe] Should I step into a minefield? / Writing a trading studio in Haskell

2007-11-07 Thread Joel Reymont
I need to pick among the usual list of suspects for a commercial product that I'm writing. The suspects are OCaml, Haskell and Lisp and the product is a trading studio. My idea is to write something like TradeStation [1] or NinjaTrader, only for the Mac. It would be quite nifty to use

[Haskell-cafe] Re: HOC is dead! Long live HOC!

2007-11-07 Thread Joel Reymont
On Nov 7, 2007, at 9:57 PM, Wolfgang Thaller wrote: One big piece of information we need that is currently missing from the BridgeSupport files is which declaration comes form which header file. HOC's module structure currently follows Apple's .h files, and we need the module system for

[Haskell-cafe] Re: Composing trading strategies (was: Should I step into a minefield? / Writing a trading studio in Haskell)

2007-11-08 Thread Joel Reymont
Greg, Can you post a couple of examples of what the trading strategies look like? Thanks, Joel On Nov 8, 2007, at 7:32 PM, Greg Fitzgerald wrote: The idea is that the user composes an 'openPosition' and 'closePosition' trading strategies from a combinator library and gives them

[Haskell-cafe] Missing _environ

2007-11-09 Thread Joel Reymont
Dan, On Nov 9, 2007, at 12:58 AM, Dan Piponi wrote: Well that was the crucial fact I needed. 6.8.1 is now built. ghci doesn't work, it complains about an unknown symbol '_environ' in HSbase-3.0.0.0.o The installation process strips the binaries which strips away _environ. You need to

[Haskell-cafe] Expert systems

2007-12-04 Thread Joel Reymont
Is there an expert system implemented in Haskell, or a library perhaps? A CLIPS/RETE implementation? The main stumbling point, from my perspective, is how to implement a knowledge base and check whether patterns with a certain shape have been asserted. It's much easier to do this in a

Re: [Haskell-cafe] Yampa / AFRPVectorSpace.hs

2007-12-17 Thread Joel Reymont
On Dec 17, 2007, at 4:30 PM, Peter Verswyvelen wrote: Maybe you could place Yampa in a Darcs depot? darcs get http://wagerlabs.com/yampa I think we should move it to Google Code, though. -- http://wagerlabs.com ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Haskell RPC

2006-05-30 Thread Joel Reymont
Thank you Bjorn! I'll take a look but it sounds like exactly what I'm looking for! On May 30, 2006, at 2:35 AM, Bjorn Bringert wrote: Hi Joel, the attached example is a simple RPC library. It uses show and read for serialization, and some type class tricks to allow functions with

[Haskell-cafe] HAppS in production?

2006-06-06 Thread Joel Reymont
Folks, Is anyone using HAppS in production right now? It seems to be the most advanced Haskell web development platform right now but I would like to hear about others as well. Production (heavy) use is what I'm looking for. Thanks, Joel -- http://wagerlabs.com/

Re: [Haskell-cafe] HAppS in production?

2006-06-07 Thread Joel Reymont
Alex, On Jun 7, 2006, at 9:08 PM, S. Alexander Jacobson wrote: I am using it on http://pass.net which is live in production but not yet high volume. I hope to have some other projects live soon, but they are currently works in progress. What type of machine are you running this on?

Re: [Haskell-cafe] HAppS in production?

2006-06-07 Thread Joel Reymont
On Jun 7, 2006, at 10:20 PM, S. Alexander Jacobson wrote: Does this make sense? Makes sense but almost sounds too good. What package would you recommend I use with HAppS to merge HTML templates with application data? Thanks, Joel -- http://wagerlabs.com/

Re: [Haskell-cafe] what do you think of haskell ? (yes, it's a bit general ...:)

2006-06-15 Thread Joel Reymont
On Jun 15, 2006, at 6:18 PM, Sebastian Sylvan wrote: This may not be very helpful, but I would say that an Image is neither a list nor an array - it's a function! :-) How exactly do you manipulate the bits and bytes of a function? -- http://wagerlabs.com/

[Haskell-cafe] Parsec and destructuring HTML content

2006-06-18 Thread Joel Reymont
Has anyone explored destructuring HTML with Parsec? Any other ideas on how to best do this? I'm looking to scrape bits of information from more or less unstructured HTML pages. I'm looking to structure, tag and classify the content afterwards. I think that developing HTML scrapers

Re: [Haskell-cafe] Computing lazy and strict list operations at the same time

2006-06-19 Thread Joel Reymont
Where's the solution and what is the repmin problem? On Jun 19, 2006, at 5:21 PM, Jerzy Karczmarczuk wrote: Such tricks become your second nature, when you take the solution (lazy) of the repmin problem by Richard Bird, you put it under your pillow, and sleep for one week with your head close

Re: [Haskell-cafe] Re: Functional programming for processing of large raster images

2006-06-21 Thread Joel Reymont
I think the issue wasn't using functional programming for large image processing, it was using Haskell. OCaml is notoriously fast and strict. Haskell/GHC is... lazy. Everyone knows that laziness is supposed to be a virtue. In practice, though, I'm one of the people who either can't wrap

[Haskell-cafe] Re: Not in scope: type constructor or class

2006-07-01 Thread Joel Reymont
I should have opened my eyes real wide. This does the trick and makes TH look for HOC.Arguments.ObjCArgument which is proper. thModulePrefix mod id = HOC. ++ mod ++ . ++ id On Jul 1, 2006, at 10:33 PM, Joel Reymont wrote: Folks, I'm getting this error: ./HOC/StdArgumentTypes.hs:1:0

[Haskell-cafe] Trading with Haskell

2006-07-04 Thread Joel Reymont
Is there anyone trading with Haskell or interested in doing it? Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] HDF5

2006-07-04 Thread Joel Reymont
Does anyone have bindings for HDF5 [1]? [1] http://hdf.ncsa.uiuc.edu/whatishdf5.html Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: HDF5

2006-07-04 Thread Joel Reymont
And a related question... Would there be an advantage in using lazy byte strings or Bulat's streams library over HDF5? There's a good performance review [1] of PyTables (thin wrapper on top of HDF5) vs. SqlLite that I just read and it made me wonder. I'm looking to model the trading

Re: [Haskell-cafe] HDF5

2006-07-04 Thread Joel Reymont
On Jul 4, 2006, at 6:29 PM, Bulat Ziganshin wrote: isn't it better to use sql database? Not necessarily but it's better to start simple. I'll try SQLlite first. -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Haskell as embedded DSL

2006-07-05 Thread Joel Reymont
Folks, Do you have examples of using Haskell as a DSL in an environment NOT targeted at people who know it already? I'm thinking of using Haskell to build my Mac trading app but I'm very concerned about dumping Haskell on the trading systems developers. It seems that using, say, Ruby as

Re: [Haskell-cafe] Haskell as embedded DSL

2006-07-05 Thread Joel Reymont
On Jul 5, 2006, at 3:07 PM, Niklas Broberg wrote: Lava: http://www.cs.chalmers.se/~koen/Lava/ Excellent example, thank you Niklas! Are you using QuickCheck for verification? Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe

Re: [Haskell-cafe] Re: Trading with Haskell

2006-07-05 Thread Joel Reymont
On Jul 5, 2006, at 11:56 PM, Ashley Yakeley wrote: Trading financial instruments? You might be interested in the SPJ/ Eber/Seward paper Composing contracts: http://research.microsoft.com/~simonpj/Papers/financial-contracts/ contracts-icfp.htm Yes, that paper and an hour or so on the phone

[Haskell-cafe] Haskell performance in heavy numerical computations

2006-07-06 Thread Joel Reymont
Is anyone using Haskell for heavy numerical computations? Could you share your experience? My app will be mostly about running computations over huge amounts of stock data (time series) so I'm thinking I might be better of with OCaml. Thanks, Joel -- http://wagerlabs.com/

Re: [Haskell-cafe] instance Binary Data

2006-07-11 Thread Joel Reymont
I don't see how this can work for arbitrary types without auto- generating the serialization code. Once the code is generated you can just store the type dictionary at the beginning of the file and use it to deserialize. I'm not sure this can be done on top of Binary since the type tag

[Haskell-cafe] Comma in the front

2006-07-12 Thread Joel Reymont
Are cool kids supposed to put the comma in front like this? , foo , bar , baz Is this for historical or other reasons because Emacs formats Haskell code well enough regardless. Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe

[Haskell-cafe] Glasgow Distributed Haskell

2007-01-01 Thread Joel Reymont
Is anyone using GdH? Can someone tell me why it's not part of the GHC distribution? It seems that GdH is not being developed anymore and I think it's a real pity! Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Glasgow Distributed Haskell

2007-01-02 Thread Joel Reymont
On Jan 2, 2007, at 8:33 AM, Simon Peyton-Jones wrote: GdH is maintained and distributed by Phil Trinder and his colleagues at Heriot Watt. I think it's still alive, but it's based on a much earlier version of GHC. I wonder how much work would it be to integrate it. Also, their servers

Re: [Haskell-cafe] Glasgow Distributed Haskell

2007-01-02 Thread Joel Reymont
On Jan 2, 2007, at 1:48 AM, Bulat Ziganshin wrote: btw, may be the following can help you: http://www.inf.ufes.br/~ffranzosi/BSPHlib-0.1.tar.gz Thanks Bulat. I don't know what this is, though, and the link is broken. -- http://wagerlabs.com/

[Haskell-cafe] darcs repo for yampa + gadt

2007-01-03 Thread Joel Reymont
Folks, I have a version of Yampa with Henrik Nilsson's GADT optimizations that I cleaned up for ghc 6.6 and cabalized. Would it be possible to set it up at darcs.haskell.org and if so how should I go about it? Thanks, Joel -- http://wagerlabs.com/

[Haskell-cafe] ANN: Yampa + GADT for ghc 6.6

2007-01-07 Thread Joel Reymont
Folks, This is a raw version of cabalized Yampa + GADT for ghc 6.6. darcs get http://wagerlabs.com/yampa I would like to change the layout of the directory tree and I think there should be a single Cabal file that builds the source, tests and examples. I'm not sure if this is possible,

[Haskell-cafe] Financial Engineering with Haskell

2007-01-23 Thread Joel Reymont
Alexy, This is a subject near and dear to my heart and I also dabble in Lisp and Erlang. Google for Composing Financial Contracts, you will surely like the paper. This is the paper that got me started with Haskell. I'm sure you could do financial data mining in either Lisp, Haskell or

Re: [Haskell-cafe] Strings in Haskell

2007-01-23 Thread Joel Reymont
On Jan 23, 2007, at 10:37 PM, Tim Docker wrote: I'm not aware of any ongoing haskell work in finance, I'm gearing up to do something but don't have anything to show yet. I'd be happy to learn of any more, however. I don't think there's any reasons right now why one ought to favour ocaml

Re: [Haskell-cafe] Re: ANNOUNCE: binary: high performance, pure binary serialisation

2007-01-26 Thread Joel Reymont
On Jan 26, 2007, at 2:40 PM, Arie Peterson wrote: Using DrIFT would probably automate the deriving just as well, but in my particular situation TH support is easier to maintain than DrIFT support. May I ask why TH is easier to maintain than DrIFT? I'm not familiar with DrIFT. Why would

Re: [Haskell-cafe] proposal: HaBench, a Haskell Benchmark Suite

2007-01-28 Thread Joel Reymont
On Jan 28, 2007, at 8:51 AM, Andy Georges wrote: it is nice to know that e.g., Data.ByteString performs as good as C, but is would be even nicer to see that large, real-life apps can reach that same performance. What about using darcs as a benchmark? I heard people say it's slow. The

Re: [Haskell-cafe] Connected!

2007-02-01 Thread Joel Reymont
What part of Russia do you live in? On Feb 1, 2007, at 1:23 PM, Bulat Ziganshin wrote: Hello haskell-cafe, i've just got ADSL connection here! it's slow (64k) and not cheap, but at least it is completely different from dial-up i've used before -- http://wagerlabs.com/

[Haskell-cafe] A distributed and replicating native Haskell database

2007-02-02 Thread Joel Reymont
Folks, Allegro Common Lisp has AllegroCache [1], a database built on B-Trees that lets one store Lisp objects of any type. You can designate certain slots (object fields) as key and use them for lookup. ACL used to come bundled with the ObjectStore OODBMS for the same purpose but then

Re: [Haskell-cafe] A distributed and replicating native Haskell database

2007-02-02 Thread Joel Reymont
On Feb 2, 2007, at 3:06 PM, Paul Johnson wrote: As a rule, storing functions along with data is a can of worms. Either you actually store the code as a BLOB or you store a pointer to the function in memory. Either way you run into problems when you upgrade your software and expect the

Re: [Haskell-cafe] How did you stumble on Haskell?

2007-02-03 Thread Joel Reymont
I'll go for the shortest story... I stumbled upon Simon's Composing Financial Contracts paper, Simon was gracious enough to spend a fair bit of time on the phone with me. The rest is history :-). Joel -- http://wagerlabs.com/ ___

[Haskell-cafe] Embedding ghc

2007-02-10 Thread Joel Reymont
Has anyone tried embedding ghc into their app? How big are the resulting binaries? Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell vs Ruby as a scripting language

2007-02-10 Thread Joel Reymont
Is anyone using Haskell as a scripting language in their app? I'm thinking of viable it would be to embed ghc in a Mac (Cocoa) app. TextMate [1] uses Ruby as the extension language and quite successfully at that. Everybody loves Ruby since it's simple. I need a trading systems language and

Re: [Haskell-cafe] Haskell vs Ruby as a scripting language

2007-02-10 Thread Joel Reymont
On Feb 10, 2007, at 2:25 PM, Brian Smith wrote: Is your application primarily written in Haskell? If not, you would have to create an interface between that language and Haskell in order for your Haskell programs to manipulate your domain objects and user interface. It would be

[Haskell-cafe] Lambada and connecting Haskell to a Weblogic server

2007-02-10 Thread Joel Reymont
Folks, Where can I find Lambada these days and would it be of any use to me in trying to connect to a Weblogic server? To make the long story short, my broker's Java software connects to a remote Weblogic server and I would like to do the same. I suppose this would require me to

[Haskell-cafe] Parsec and Java

2007-02-10 Thread Joel Reymont
Folks, Is there a Java parser implemented using Parsec? Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Lambada and connecting Haskell to a Weblogic server

2007-02-11 Thread Joel Reymont
Yep, don't have access to the Weblogic server. I'm re-evaluating my options, though, since I'm lazy by nature. On Feb 11, 2007, at 12:30 PM, Neil Bartlett wrote: Joel, Implementing Java RMI in Haskell sounds like a nightmare. Why not use HTTP? You could easily write a wrapper Servlet that

Re: [Haskell-cafe] questions about core

2007-02-12 Thread Joel Reymont
On Feb 12, 2007, at 5:45 AM, Matt Roberts wrote: - The hackathon videos, - A transformation-based optimiser for Haskell, - An External Representation for the GHC Core Language (DRAFT for GHC5.02), and - Secrets of the Glasgow Haskell Compiler inliner. Matt, can you please post

Re: [Haskell-cafe] questions about core

2007-02-12 Thread Joel Reymont
On Feb 12, 2007, at 7:06 AM, Stefan O'Rear wrote: We have Core because Simon lacks the patience to solve the halting problem and properly perform effects analysis on STG. We have STG because Simon lacks the patience to wait for the 6.6 Simplifier to finish naively graph-reducing every

[Haskell-cafe] C# parser written in Haskell

2008-01-27 Thread Joel Reymont
Does anyone have a C# parser written in Haskell? Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Case-insensitive lexing with Alex

2008-01-28 Thread Joel Reymont
Any suggestions on how to implement case-insensitive lexing with Alex? Thanks, Joel -- http://wagerlabs.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Case-insensitive lexing with Alex

2008-01-28 Thread Joel Reymont
On Jan 28, 2008, at 2:44 PM, Geoffrey Mainland wrote: map toLower onto your input before you pass it to your lexer? Or do you only want keywords to be case-insensitive? Just keywords. You can have Array or array or aRrAy. -- http://wagerlabs.com

[Haskell-cafe] Haskell poker server

2005-08-28 Thread Joel Reymont
Folks, I wrote a poker server in Erlang (link in signature) and I'm learning Haskell with an eye towards using it with Erlang. Erlang would take care of the overall control, etc. whereas Haskell would take care of the rest. I'm stuck with the basics I'm afraid and Haskell hackers don't

Re: [Haskell-cafe] Haskell poker server

2005-08-28 Thread Joel Reymont
Alistair, Thanks alot for your examples. I still have one unanswered question... How would you read a tuple of values (24, GID, Seq) like in my Erlang example, where 24 is one byte, GID is a 4-byte integer and Seq is a 2- byte word? Is there an elegant way of specifying packet format and

Re: [Haskell-cafe] Haskell poker server

2005-08-30 Thread Joel Reymont
Erlang does this nicely, I replied to the LtU thread. I positively got the impression that nobody was parsing binary data in Haskell ;). On Aug 30, 2005, at 12:29 PM, Bayley, Alistair wrote: There's a request on LtU for a similar ability (somewhat wider in scope, perhaps):

Re: [Haskell-cafe] Haskell poker server

2005-08-30 Thread Joel Reymont
Can I beg for examples? On Aug 30, 2005, at 1:29 PM, Tomasz Zielonka wrote: BTW, if efficiency is not a primary concern, Parsec can be quite nice for decoding binary messages of many protocols. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Where to start about writing web/HTTP apps ?

2005-09-12 Thread Joel Reymont
Why not XML-RPC? On Sep 12, 2005, at 9:54 PM, S. Alexander Jacobson wrote: 6. define how busines logic maps to URLs ... a POST _ [u] = doXML addUser a GET myapp.com (s:path) = fileServe mimeTypes static path myApp appCtx = let ?style=XSL /s/style.xsl in simpleHTTP a appCtx

Re: [Haskell-cafe] wxHaskell: getting a checkbox state

2005-09-14 Thread Joel Reymont
On Sep 14, 2005, at 5:54 PM, Arthur Baars wrote: This means you can get and set the checked property for checkboxes. for example: c - get cbEdit checked set cbEdit [checked := not c ] Any particular reason to enclose the arguments in square brackets apart from cool-looking syntax? Do

Re: [Haskell-cafe] Autrijus Tang interviewed by Perl.com

2005-09-15 Thread Joel Reymont
What is the meaning of xxs@(x:xs) in the code below? I understand that x:xs is a list /head:tail/ but a tuple of (x:xs) does not make sense. main = print (take 1000 hamming) hamming = 1 : map (2*) hamming ~~ map (3*) hamming ~~ map (5*) hamming where xxs@(x:xs) ~~

Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Joel Reymont
I have faced these issues twice, always starting from Lisp and moving on somewhere else. There's more on my travails at http:// wagerlabs.com/tech and http://wagerlabs.com/uptick. I implemented a poker engine in Lisp but it appeared that to deliver it on Windows, Linux and Mac OSX I would

[Haskell-cafe] Local quantification annotations

2005-09-23 Thread Joel Reymont
Folks, What are the local quantification annotations they talk about here? http://www.cc.gatech.edu/~saswat/research/Summary.ps Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Neural networks and optimization in Haskell

2005-09-27 Thread Joel Reymont
Folks, I got a project where I have a large number of variables and an outcome and I need to figure out which 20% of the variables has the largest effect on the outcome. Of course I also need to optimize the 20% of variables I end up with. This sounds like a job for a neural network to

Re: [Haskell-cafe] Neural networks and optimization in Haskell

2005-09-28 Thread Joel Reymont
Thank you Tomasz! This is exactly what I was looking for. On Sep 28, 2005, at 8:25 AM, Tomasz Zielonka wrote: Check this paper - it seems they solved a similar problem with a hill-climbing algorithm: http://www.cs.uu.nl/dazzle/f08-schrage.pdf -- http://wagerlabs.com/

[Haskell-cafe] Converting [Word8] to String

2005-10-02 Thread Joel Reymont
Folks, How do I convert a list of bytes to a string? Cale has suggested a neat way of parsing binary packets in this thread: http://www.mail-archive.com/haskell-cafe@haskell.org/msg09413.html and I'm trying to create a packet reader for a Pascal-style string where the length is the first

[Haskell-cafe] Reading Word16, Word32, etc. from a FPS

2005-10-02 Thread Joel Reymont
Folks, How would I implement reading of big/little-endian shorts, longs, floats, etc. from a fast packed string? Thanks, Joel -- http://wagerlabs.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Endian conversion

2005-10-02 Thread Joel Reymont
Folks, Are there any endian conversion routines for Haskell? I'm looking to build binary packets on top of NewBinary.Binary but my data is coming in little-endian whereas I'll need to send it out big endian. Thanks, Joel -- http://wagerlabs.com/idealab

Re: [Haskell-cafe] Endian conversion

2005-10-03 Thread Joel Reymont
Well, I'm looking for suggestions on how to implement this. I'll basically get a chunk of data from the socket that will have things little-endian and will need to send out a chunk that will have the numbers big-endian. This is a proxy server that does binary protocol conversion. It's a

[Haskell-cafe] Replacing a shovel (was Re: Endian conversion)

2005-10-03 Thread Joel Reymont
Well, I can make the problem a little more complex to give you a better picture of where Haskell fits in... I need to write a simulation environment to be able to run bots against a poker server and reproduce this intermittent memory corruption that happens within it. The poker server is

Re: [Haskell-cafe] Endian conversion

2005-10-03 Thread Joel Reymont
On Oct 3, 2005, at 6:51 AM, Marc Ziegert wrote: data (Integral a) = BigEndian a = BigEndian a deriving (Eq,Ord,Enum,...) be = $( (1::CChar)/=(unsafePerformIO $ with (1::CInt) $ peekByteOff `flip` 0) ) :: Bool Will this always correctly determine if the platform is big-endian? How does

Re: [Haskell-cafe] Endian conversion

2005-10-03 Thread Joel Reymont
Well, I liked that bit of Template Haskell code that Marc sent. I'm now stuck trying to adapt it to read Storables :-). It seems, on a second glance, that there's not that much to adapt. If I read Marc's code correctly it derives Storable and uses the peek, etc. methods to swap bytes

Re: [Haskell-cafe] Converting [Word8] to String

2005-10-04 Thread Joel Reymont
I know it does since I control the protocol :-). On Oct 4, 2005, at 11:04 AM, Wolfgang Jeltsch wrote: You seem to think that one byte has to correspond to one character but this isn't the case in certain character encodings. In addition, even if one byte corresponds to one character, a

Re: [Haskell-cafe] Endian conversion

2005-10-06 Thread Joel Reymont
Regarding NewBinary... I think my challenge is how to add endian- conversion without duplicating all the put and get methods from NewBinary. I would still use that bit of TH code to figure out whether my platform is big or little endian. I don't care about cross- compilation and what that

Re: [Haskell-cafe] Endian conversion

2005-10-06 Thread Joel Reymont
I don't want to replicate all the code in NewBinary for Little/Big endian. I'm looking for an elegant solution (Haskell, the elegant language, you know). I don't care about cross-compiling stuff and the server that I need to work with runs on Wintel whereas I can be either on Windows or

Re: [Haskell-cafe] Endian conversion

2005-10-06 Thread Joel Reymont
Why doesn't this compile? be = $( (1::CChar) /= (unsafePerformIO $ with (1::CInt) $ peekByteOff `flip` 0) ) :: Bool Endian.hs:10:8: Couldn't match `Language.Haskell.TH.Lib.ExpQ' against `Bool' Expected type: Language.Haskell.TH.Lib.ExpQ

Re: [Haskell-cafe] Endian conversion

2005-10-06 Thread Joel Reymont
Solution by TheHunter on #haskell: be = $(lift $ (1::CChar) /= (unsafePerformIO $ with (1::CInt) $ peekByteOff `flip` 0) ) :: Bool Thanks, Joel On Oct 6, 2005, at 9:13 PM, Joel Reymont wrote: Why doesn't this compile? be = $( (1

[Haskell-cafe] Emacs Haskell Mode: Indenting after where

2005-10-06 Thread Joel Reymont
Folks, Does anyone know how to make the Haskell mode (Emacs) indent the line after where for this type of look: peek = if be then peek0 else peekR where peek0 a = fmap BigEndian $ peek (castAway a) peekR a = peekByteOff a 0 instead of this: peek = if

[Haskell-cafe] Re: Emacs Haskell Mode: Indenting after where

2005-10-07 Thread Joel Reymont
describing keywords to complete when standing at the first word of a line.) On Oct 6, 2005, at 10:40 PM, Joel Reymont wrote: Folks, Does anyone know how to make the Haskell mode (Emacs) indent the line after where for this type of look: peek = if be then peek0 else peekR where

Re: [Haskell-cafe] Endian conversion

2005-10-07 Thread Joel Reymont
What I have in mind is composing a packet structure from a list of storables. These would be the packet fields. Alternatively, I guess I could declare my record to be an instance of storable and implement the peek, poker, etc. Would this work? On Oct 7, 2005, at 4:39 PM, Benjamin Franksen

Re: [Haskell-cafe] Endian conversion

2005-10-07 Thread Joel Reymont
This code hangs for me for whatever reason when I run it at the ghci prompt. It does not matter whether I load it from a file or type it in. On Oct 7, 2005, at 2:50 PM, Benjamin Franksen wrote: You would probably want to wrap/unwrap values (using BigEndian/LittleEndian) just before/after

Re: [Haskell-cafe] Endian conversion

2005-10-07 Thread Joel Reymont
It seems that (BigEndian x) - peek ptr_x is the culprit. On Oct 7, 2005, at 4:48 PM, Joel Reymont wrote: This code hangs for me for whatever reason when I run it at the ghci prompt. It does not matter whether I load it from a file or type it in. On Oct 7, 2005, at 2:50 PM, Benjamin

[Haskell-cafe] MutableByteArray as a Ptr

2005-10-07 Thread Joel Reymont
Folks, http://www.haskell.org/hdirect/ffi-6.html GHC's ByteArray and MutableByteArray primitive types are (im)mutable chunks of memory allocated on the Haskell heap, and pointers to these can be passed to foreign imported external functions provided they are marked as unsafe. Does this

[Haskell-cafe] Trouble understanding NewBinary

2005-10-07 Thread Joel Reymont
Folks, In http://www.n-heptane.com/nhlab/repos/NewBinary/NewBinary/Binary.hs there's the following bit of code. What are the I#, S# and J#? instance Binary Integer where put_ bh (S# i#) = do putByte bh 0; put_ bh (I# i#) put_ bh (J# s# a#) = do p - putByte bh 1; put_ bh (I#

Re: [Haskell-cafe] Trouble understanding NewBinary

2005-10-08 Thread Joel Reymont
Not knowing where to search is often the problem :-). Thanks Chris! On Oct 8, 2005, at 12:43 AM, ChrisK wrote: In GHC.Exts are the definitions data Char = C# Char# data Int = I# Int# data Integer = S# Int# | J# Int# ByteArray# data Double = D# Double# data Float = F# Float# --

Re: [Haskell-cafe] MutableByteArray as a Ptr

2005-10-08 Thread Joel Reymont
This is no longer an issue as I found how to read and write Float and Double at the link below http://www.n-heptane.com/nhlab/repos/NewBinary/Tests/BinDouble.hs Originally, I was looking to get a chunk of memory using getByteArray from NewBinary.Binary and read a Storable after converting

[Haskell-cafe] NewBinary: What is the license?

2005-10-08 Thread Joel Reymont
Folks, NewBinary is based on nhc98's Binary and nhc98 is GPL. Does this mean that I cannot use NewBinary in commercial software? I'm afraid I just wasted a few days of work then :-(. Thanks, Joel -- http://wagerlabs.com/idealab ___

Re: [Haskell-cafe] NewBinary: What is the license?

2005-10-08 Thread Joel Reymont
I read the license carefully and it appears that the NHC license does not prevent you from using NewBinary in commercial software. More details below: http://www.cs.york.ac.uk/fp/nhc98/copyright.html On Oct 8, 2005, at 4:18 PM, Murray Gross wrote: Because I really don't want to get

[Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-13 Thread joel reymont
Folks, Are there any examples on using STUArray and friends? I'm trying to convert the following bit of code which uses deprecated features. I don't understand the syntax needed to create a new double or float array with newArray from Data.Array.MArray. I also don't yet understand how to cast

Re: [Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-14 Thread Joel Reymont
If I don't cast then how do I convert this code? doubleToInts d = runST ( do arr - newDoubleArray (1,2) writeDoubleArray arr 1 d i1 - readIntArray arr 1 i2 - readIntArray arr 2 return (i1,i2)) Or can I just read an array of ints from the double array using the

Re: [Haskell-cafe] Examples of using STUArray + help with converting code

2005-10-14 Thread Joel Reymont
I'm just trying to replicate the example using the fresh syntax that does not use readDoubleArray, readIntArray, etc. On Oct 14, 2005, at 4:32 PM, Ketil Malde wrote: Yes, sorry, my bad. I was (and is) confused about what you wanted to do. -- http://wagerlabs.com/

Re: [Haskell-cafe] pre-built ghc 6.4.1 crashes building FPS

2005-10-18 Thread Joel Reymont
Just the latest darcs repo. It's a memory access error 0x0:0x0 I think (null pointer reference?) at the setup build stage. On Oct 18, 2005, at 2:01 AM, Donald Bruce Stewart wrote: Oh, now that's interesting. Do you have a log of where it crashes? It could be some Cabal code, or perhaps

Re: [Haskell-cafe] pre-built ghc 6.4.1 crashes building FPS

2005-10-18 Thread Joel Reymont
Another person reports that the same happens while building HSQL. https://sourceforge.net/tracker/? func=detailatid=108032aid=1328684group_id=8032 On Oct 18, 2005, at 2:01 AM, Donald Bruce Stewart wrote: Oh, now that's interesting. Do you have a log of where it crashes? It could be some

[Haskell-cafe] Zlib bindings

2005-10-18 Thread Joel Reymont
Folks, Are there any zlib bindings for Haskell? The docs for HDirect mention the examples directory with the bindings but I cannot find the examples directory in the source distro. The MissingH code works with gzipped files apparently but not with memory buffers. Thanks, Joel --

Re: [Haskell-cafe] Zlib bindings

2005-10-18 Thread Joel Reymont
I need to deflate buffers that were compressed with zlib's compress and sent to me over the network. I don't think files help me there :-). On Oct 18, 2005, at 3:49 PM, Henning Thielemann wrote: Darcs works with gzipped files. -- http://wagerlabs.com/

[Haskell-cafe] Prebuilt FPS for Windows

2005-10-18 Thread Joel Reymont
Folks, Since I cannot build Data.FastPackedString on Windows (ghc crashes) and it's the only library I really depend on, would someone have a pre-built version or let me know how I can build it without Cabal? On a related note, Haskell tools for Windows (happy, alex) come with extra

  1   2   3   4   5   >