Re: [Haskell-cafe] representing differencial equations in haskell

2007-09-25 Thread Antoine Latter
I don't see anything in hackage off the top of my head. If it's a set of DEs like that, Runge-Kutta is a good place to start if you want to code your own integrator: http://en.wikipedia.org/wiki/Runge-Kutta#The_classical_fourth-order_Runge.E2.80.93Kutta_method But if it were me I would just use

Re: [Haskell-cafe] Rewriting Char.ord

2007-09-29 Thread Antoine Latter
(sending to the whole list this time ...) On 9/29/07, PR Stanley [EMAIL PROTECTED] wrote: Okay, a couple of things what is fromEnum? fromEnum :: (Enum a) = a - Int fromEnum 'c' :: Int 'fromEnum' converts any member of the Enum typeclass to an 'Int'. It works fine for a Char. What's the

Re: [Haskell-cafe] Rewriting char

2007-09-29 Thread Antoine Latter
You may want to look at the library function `toEnum' toEnum :: (Enum a) = Int - a since Char is an Enum, the following code should work just fine: toEnum 70 :: Char ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Trouble with types

2007-12-24 Thread Antoine Latter
On Dec 25, 2007 12:11 AM, Konstantin Vladimirov [EMAIL PROTECTED] wrote: class FirstClass a where firstFunction :: (SecondClass b) = a - b snip! instance FirstClass FirstData where firstFunction (FirstData d) = SecondData d The problem is that the type of firstFunction as producing

Re: [Haskell-cafe] Re: Data.Number.BigFloat/Fixed

2010-03-21 Thread Antoine Latter
On Sun, Mar 21, 2010 at 4:49 PM, H. h._h._...@hotmail.com wrote: Ivan Lazar Miljenovic ivan.miljenovic at gmail.com writes: I'm sorry, but is there a question in there? H. h._h._h._ at hotmail.com writes: (7e-3 :: BigFloat Prec50) (6e-4 :: BigFloat Prec50) False (7e-3 :: BigFloat

Re: [Haskell-cafe] The 8 Most Important GSoC Projects

2010-04-03 Thread Antoine Latter
On Sat, Apr 3, 2010 at 12:45 PM, Don Stewart d...@galois.com wrote: schlepptop: Don Stewart schrieb: While at ZuriHac, a few of us GSoC mentors got together to discuss what we think the most important student projects for the summer should be. Here's the list:    

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-06 Thread Antoine Latter
On Tue, Apr 6, 2010 at 8:22 PM, Thomas Schilling nomin...@googlemail.com wrote: Ok, last revision for tonight:  http://i.imgur.com/d3ARq.png I'm no web design guru, but this is definitely better than what we have now. Good job on it. Antoine ___

Re: [Haskell-cafe] Re: GSoC: Hackage 2.0

2010-04-08 Thread Antoine Latter
On Thu, Apr 8, 2010 at 6:38 PM, Matthew Gruen wikigraceno...@gmail.com wrote: On Wed, Apr 7, 2010 at 9:02 AM, Maciej Piechotka uzytkown...@gmail.com wrote: I guess 'works also with B in version X.Y.Z' is also. Most of the above changes should not be IMHO in cabal (sorry for answering PS

Re: [Haskell-cafe] Re: GSoC: Hackage 2.0

2010-04-09 Thread Antoine Latter
On Thu, Apr 8, 2010 at 11:07 PM, Matthew Gruen wikigraceno...@gmail.com wrote: On Thu, Apr 8, 2010 at 10:58 PM, Antoine Latter aslat...@gmail.com wrote: One thing in the branch over in http://code.haskell.org/hackage-server  is the ability for package maintainers to upload documentation

Re: [Haskell-cafe] What is the consensus about -fwarn-unused-do-bind ?

2010-04-14 Thread Antoine Latter
On Tue, Apr 13, 2010 at 9:59 PM, Max Cantor mxcan...@gmail.com wrote: I'm in the camp of adding -fno-warn-unused-do-bind to my cabal files.  I hate sacrificing the purity of -Wall but I have so many forkIOs in my code that I think it was the best option. Max I think a nice compromise

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-30 Thread Antoine Latter
On Fri, Apr 30, 2010 at 3:37 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Donnerstag 29 April 2010 20:08:00 schrieb Ben: A technical question: it seems like the instance of ArrowLoop is too strict (this is something I've wondered about in Liu's paper too.) Shouldn't it be  instance

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-12 Thread Antoine Latter
On Tue, May 11, 2010 at 8:28 PM, wren ng thornton w...@freegeek.org wrote: Max Cantor wrote: Based on some discussions in #haskell, it seemed to be a consensus that using a modified continuation monad for Error handling instead of Eithers would be a significant optimization since it would

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-14 Thread Antoine Latter
On Fri, May 14, 2010 at 4:25 PM, Derek Elkins derek.a.elk...@gmail.com wrote: You did it wrong.  All you did was Church encode the Either type. Your bind is still doing a case-analysis.  All you have to do is use ContT r (Either e).  The bind implementation for ContT is completely independent

[Haskell-cafe] ANNOUNCE: hmumps, a MUMPS interpreter in Haskell

2010-05-15 Thread Antoine Latter
Hi folks, As an educational project a few years back I started working on an interpreter for the MUMPS language in Haskell. It's got a REPL and can call into functions defined in external files. It doesn't support a lot of the built-in-functions, nor does it have support for on-disk persistent

Re: [Haskell-cafe] Speed of Error handling with Continuations vs. Eithers

2010-05-15 Thread Antoine Latter
On Fri, May 14, 2010 at 4:25 PM, Derek Elkins derek.a.elk...@gmail.com wrote: You did it wrong.  All you did was Church encode the Either type. Your bind is still doing a case-analysis.  All you have to do is use ContT r (Either e).  The bind implementation for ContT is completely independent

Re: [Haskell-cafe] Enum instantiation

2010-05-21 Thread Antoine Latter
2010/5/21 R J rj248...@hotmail.com: I'd like to make Day an instance of class Enum, but the definition of toEnum below seems to be completely wrong, because integers seem not permit pattern matching.  How is toEnum defined?  Thanks. Hi, What error are you getting when you try your class

Re: [Haskell-cafe] Enum instantiation

2010-05-21 Thread Antoine Latter
On Fri, May 21, 2010 at 8:59 PM, R J rj248...@hotmail.com wrote: If I type toEnum 5, the error I get is: interactive:1:0:     Ambiguous type variable `a' in the constraint:       `Enum a' arising from a use of `toEnum' at interactive:1:0-7     Probable fix: add a type signature that fixes

[Haskell-cafe] ANNOUNCE: MonadCatchIO-foreign

2010-05-30 Thread Antoine Latter
Hello Haskell, I'd like to announce a very small library in two flavors. The problem I'm trying to solve is that we have some capabilities for writing functions which are polymorphic over monad but still use IO capabilities - liftIO :: (IO a - m a) from the packages transformers and mtl. The

Re: [Haskell-cafe] Sockets get bound to wrong port on Windows

2010-06-02 Thread Antoine Latter
On Wed, Jun 2, 2010 at 10:10 PM, Matthias Reisner matthias.reis...@googlemail.com wrote: Hi, there's something wrong with port numbers in the Network.Socket module of package network. Printing values gives:   *Main PortNum   47138   *Main PortNum 47138   So I thought it's just

Re: [Haskell-cafe] Weird socket problem on Mac OS X

2010-06-03 Thread Antoine Latter
Hi Arnaud, One thing you might want to try is to stop using the PortNumber data constructor, and instead rely on 'fromInteger' to do the right thing. The data constructor assumes that it's argument is in network byte order, which won't always be the case. It's not obvious that the constructor

Re: [Haskell-cafe] Weird socket problem on Mac OS X

2010-06-04 Thread Antoine Latter
On Fri, Jun 4, 2010 at 12:11 AM, Arnaud Bailly arnaud.oq...@gmail.com wrote: Yes, I have also seen the other post on the same topic, but it seemed to refer to the PortNumber in Network.Socket with a PortNum constructor I think, not the one in Network (but I am probably misleading myself as one

Re: [Haskell-cafe] How to set a GHC option for a single module and a specific version of GHC?

2010-06-07 Thread Antoine Latter
On Sat, Jun 5, 2010 at 3:28 AM, Bernie Pope florbit...@gmail.com wrote: Hi, I'm looking for a way to set a GHC compile option on a specific module (not every module in the program) but only for a specific version of GHC. Ideally within the confines of cabal, and in a portable way. GHC

Re: [Haskell-cafe] GATD and pattern matching

2010-06-11 Thread Antoine Latter
On Friday, June 11, 2010, Felipe Lessa felipe.le...@gmail.com wrote: On Sat, Jun 12, 2010 at 12:13:14AM +0200, Dupont Corentin wrote: Thanks all, it works fine (see below). I lamentably try to make the same for show: showTypeable :: (Typeable a) = a - String showTypeable x = case cast x of

Re: [Haskell-cafe] parsec: how to get end location

2010-06-13 Thread Antoine Latter
On Sun, Jun 13, 2010 at 4:17 PM, Roman Cheplyaka r...@ro-che.info wrote: Suppose I have some parser 'p'. I want to parse it as well as get its span in the text. So I could write \begin{code] pWithLocation = do  loc_start - getPosition  pval - p  loc_end - getPosition  return

[Haskell-cafe] Re: Modules and their explicit export lists (are an annoyance)

2010-06-19 Thread Antoine Latter
Hi Christian, Is there a specific library you're having trouble with? One reason library authors can prefer explicit export lists is that they can hide implementation details, which can then make it easier to change in the future without breaking the users of the library. Antoine Cc'ing the

Re: [Haskell-cafe] Installing Haskell on OSX

2010-06-20 Thread Antoine Latter
On Sun, Jun 20, 2010 at 9:49 AM, Giuseppe Luigi Punzi Ruiz glpu...@lordzealon.com wrote: WTF! Sorry for the mistake in the title, is the problem of doing 124 different things at the same time :P It looks like it is failing to install the 'glib' haskell package. What do you see when you try:

Re: [Haskell-cafe] Installing Haskell on OSX

2010-06-20 Thread Antoine Latter
/Main.o ) Linking dist/build/gtk2hsC2hs/gtk2hsC2hs ... Installing executable(s) in /Users/glpunzi/.cabal/bin Here we've installed gtk2hsC2hs in /Users/glpunzi/.cabal/bin. If that isn't in your path, it won't be available for 'glib' to use during its install. El 20/06/2010, a las 17:01, Antoine

Re: [Haskell-cafe] Installing Haskell on OSX

2010-06-20 Thread Antoine Latter
leksah-0.8.0.6 depends on leksah-server-0.8.0.6 which failed to install. leksah-server-0.8.0.6 failed during the building phase. The exception was: ExitFailure 1 El 20/06/2010, a las 17:29, Antoine Latter escribió: On Sun, Jun 20, 2010 at 10:08 AM, Giuseppe Luigi Punzi Ruiz glpu

Re: [Haskell-cafe] Call for comments: neither package

2010-06-28 Thread Antoine Latter
It looks like good work, but I would be hesitent about depending on a package which pulled in both mtl and tranformers. Maybe that's just superstition - I haven't tried it. Antoine On Jun 28, 2010 5:51 PM, Michael Snoyman mich...@snoyman.com wrote: Hi all, I'll admit, the original idea for

Re: [Haskell-cafe] Re: Mining Twitter data in Haskell and Clojure

2010-06-28 Thread Antoine Latter
On Mon, Jun 28, 2010 at 2:32 PM, Don Stewart d...@galois.com wrote: claus.reinke: To binary package users/authors: is there a typed version of binary (that is, one that records and checks a representation of the serialized type before actual (de-)serialization)? It would be nice to have such

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-06-29 Thread Antoine Latter
On Tue, Jun 29, 2010 at 10:26 PM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Hi all, I'm reading John Hughes' paper Generalizing Monads to Arrows and found the statement regarding parser combinators:   ... depend on the programmer using an additional combinator similar   to Prolog's

[Haskell-cafe] Re: [Haskell-beginners] upgrade Hackage show to QuickCheck 2 for lambdabot

2010-07-02 Thread Antoine Latter
Including the café. On Jul 2, 2010 8:49 AM, Mark Wright markwri...@internode.on.net wrote: Hi, I'm trying to upgrade Hackage show to QuickCheck 2, after applying the diffs below (which may not be correct, since I am a beginner), I am left which this error message: runghc ./Setup.hs build

[Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-10 Thread Antoine Latter
On Sat, Jul 10, 2010 at 1:47 AM, John Meacham j...@repetae.net wrote: Announcing jhc 0.7.4! There have been a few major changes, the main one being that there is now support for a garbage collector. This drastically increases the number of programs which are feasable to compile with jhc.  

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-10 Thread Antoine Latter
On Sat, Jul 10, 2010 at 4:15 PM, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/10/10 17:01 , Antoine Latter wrote: * The way you use sed doesn't work with the BSD sed that ships with my Mac Book. Installing GNU sed and using it works

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-11 Thread Antoine Latter
On Sat, Jul 10, 2010 at 4:33 PM, John Meacham j...@repetae.net wrote: On Sat, Jul 10, 2010 at 04:01:53PM -0500, Antoine Latter wrote: * running DrIFT on src/E/TypeCheck.hs fails with an illegal bytesequence in hGetContents. I'm guessing that this is only an issue when building DrIFT with GHC

Re: [Haskell-cafe] src/Text/XML/HaXml/Lex.hs:(156, 0)-(160, 22): Non-exhaustive patterns in function white

2010-07-20 Thread Antoine Latter
On Wed, Jul 21, 2010 at 1:19 AM, Alexander Kotelnikov sa...@myxomop.com wrote: Hello. I decided to run a couple of test XML-RPC applications using haxr. Everything worked fine while responces from my (actually, other people's) server were something relatively small (a number, a line), but

[Haskell-cafe] Re: [Haskell] ANNOUNCE: vorbiscomment 0.0.1

2010-07-21 Thread Antoine Latter
On Wed, Jul 21, 2010 at 10:16 AM, Chris Wagner christopher.t.wag...@gmail.com wrote: I'm happy to announce that I have packaged up my first Haskell library, vorbiscomment, which allows for reading of Vorbis comments from Ogg Vorbis files.  The code is rugged and surely buggy, but any feedback,

Re: [Haskell-cafe] Is 'flip' really necessary?

2010-07-25 Thread Antoine Latter
On Sun, Jul 25, 2010 at 4:13 PM, aditya siram aditya.si...@gmail.com wrote: Eta-reducing is nice, and sometimes it makes code more readable. But 'flip' is one of those functions that always seems to hinder rather than help readability, conversely factoring out flip always makes code easier to

Re: [Haskell-cafe] Error Monad and strings

2010-07-27 Thread Antoine Latter
On Tue, Jul 27, 2010 at 6:29 PM, Dietrich Epp d...@zdome.net wrote: I'll say yes, a pattern match failure is a bug.  This is one of the great debates in the language: whether all pattern matching code should be guaranteed complete at compile time or not.  However, any function you call which

[Haskell-cafe] ANNOUNCE: parsec2 - a fork or parsec circa 2.1

2010-08-01 Thread Antoine Latter
Hello, I would like to announce the parsec2 package, which is a maintained fork of the parsec library as of version 2.1.0.1. This project is for folks who would like to use the simpler interface and fewer extensions relative to parsec-3.0+, but don't want to rely on an old version of a package

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: parsec2 - a fork or parsec circa 2.1

2010-08-02 Thread Antoine Latter
On Mon, Aug 2, 2010 at 1:55 AM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: On 2 August 2010 16:24, Jean-Philippe Bernardy berna...@chalmers.se wrote: Can you explain why you could not use the parsec name, with revision number (say) 2.2? This would help improve hackage/cabal/...

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: parsec2 - a fork or parsec circa 2.1

2010-08-02 Thread Antoine Latter
On Mon, Aug 2, 2010 at 6:32 AM, Antoine Latter aslat...@gmail.com wrote: On Mon, Aug 2, 2010 at 1:55 AM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: That said, if parsec2 is only a bug-fix branch of parsec-2.x, is there any particular reason work couldn't be done to improve

Re: [Haskell-cafe] OT: Isorecursive types and type abstraction

2008-01-24 Thread Antoine Latter
Can Fix be made to work with higher-kinded types? If so, would the following work: Perfect = /\ A . Fix (L :: * - *) . (A + L (A,A)) Keep in mind I have no idea what the Perfect data structure is supposed to look like. -Antoine On Jan 24, 2008 9:52 AM, Edsko de Vries [EMAIL PROTECTED] wrote:

Re: [Haskell-cafe] OT: Isorecursive types and type abstraction

2008-01-24 Thread Antoine Latter
should be okay. Am I missing something, again? -Antoine On Jan 24, 2008 10:31 AM, Edsko de Vries [EMAIL PROTECTED] wrote: On Thu, Jan 24, 2008 at 10:06:04AM -0600, Antoine Latter wrote: Can Fix be made to work with higher-kinded types? If so, would the following work: Perfect = /\ A . Fix (L

Re: [Haskell-cafe] parsec3 pre-release [attempt 2]

2008-02-02 Thread Antoine Latter
I'm not a fan of parameterizing the Stream class over the monad parameter `m': class Stream s m t | s - t where uncons :: s - m (Maybe (t,s)) which leads to instance declarations like so: instance Monad m = Stream [tok] m tok where uncons [] = return $ Nothing uncons (t:ts)

Re: [Haskell-cafe] parsec3 pre-release [attempt 2]

2008-02-02 Thread Antoine Latter
On Feb 2, 2008 5:28 PM, Antoine Latter [EMAIL PROTECTED] wrote: I'm not a fan of parameterizing the Stream class over the monad parameter `m': class Stream s m t | s - t where uncons :: s - m (Maybe (t,s)) which leads to instance declarations like so: instance Monad m = Stream [tok

Re: [Haskell-cafe] parsec3 pre-release [attempt 2]

2008-02-03 Thread Antoine Latter
Another picky nit: The monad transformer type is defined as such: data ParsecT s u m a = ParsecT { runParsecT :: State s u - m (Consumed (m (Reply s u a))) } with the Consumed and reply types as: data Consumed a = Consumed a | Empty !a data Reply s u a = Ok !a

Re: [Haskell-cafe] parsec3 pre-release [attempt 2]

2008-02-04 Thread Antoine Latter
On Feb 4, 2008 9:11 PM, Philippa Cowderoy [EMAIL PROTECTED] wrote: It's a necessary part of how Parsec works - both the Consumed and the Reply depend on the input stream, which is now generated from within the base monad. The Consumed result is evaluated in advance of the Reply, so keeping the

Re: [Haskell-cafe] ANN: Leksah 0.1 - Haskell IDE written in Haskell

2008-02-13 Thread Antoine Latter
The package `binary' should be on hackage.haskell.org. The others can be found in gtk2hs, I think: http://www.haskell.org/gtk2hs/ Antoine On Feb 13, 2008 11:52 AM, Justin Bailey [EMAIL PROTECTED] wrote: That looks really cool and I'd like to try it out. Can you provide links to these

Re: [Haskell-cafe] Help with error

2008-02-15 Thread Antoine Latter
(sent to the list this time) The problem is in the type-signature for from_seq: from_seq :: (Sequence seq) = (seq e) - (t e) Neither the From_seq class or the type signature of the from_seq function place any restrictions on the type of e, so the type can be rewritten as: from_seq :: forall e

[Haskell-cafe] build-depends contraints in a .cabal file

2008-02-18 Thread Antoine Latter
Can I specify an equality constraint in the build-depends field of a .cabal file? This would say that I want one specific version (because all the rest of my packages are compiled against that version and I'm getting type-checking errors trying to install the new package). neither

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Antoine Latter
On Feb 20, 2008 12:48 PM, Chad Scherrer [EMAIL PROTECTED] wrote: StorableVector should fill this gap. http://code.haskell.org/~sjanssen/storablevector/ Yes, it could, but (1) it's way behind ByteString in terms of optimizations (== fusion) (2) there's (as far as I know) not a

Re: [Haskell-cafe] Re: The Proliferation of List-Like Types

2008-02-20 Thread Antoine Latter
On Feb 20, 2008 12:59 PM, Chad Scherrer [EMAIL PROTECTED] wrote: On Feb 20, 2008 10:57 AM, Antoine Latter [EMAIL PROTECTED] wrote: For anyone looking into it - the StorableVector fusion would have to be quite different from the current ByteString fusion framework. Maybe it would be enough

Re: [Haskell-cafe] Tutorial for using the state monad or a better suggestion?

2008-02-22 Thread Antoine Latter
I was trying to solve a similar problem while learning the FastCGI package. The regular CGI package allows the use of ReaderT to hold config data. Because FastCGI does the running of the passed in CGI action within a few calls to alloca :: (Ptr a - IO b) - IO b, I couldn't figure out a way to

Re: [Haskell-cafe] deriving instances of Enum for tuples of bounded, enumerable types (useful for generating QuickCheck.Arbitrary instances for collection of collection types)

2008-03-09 Thread Antoine Latter
On Sat, Mar 8, 2008 at 9:23 PM, Brandon S. Allbery KF8NH I think you might be able to do this as a typeclass instead, at the expense of having to insert an instance declaration for each type. (You will have to use an extension if you want to declare instances for types such as Int. I

Re: [Haskell-cafe] Problem with OpenAL

2008-03-22 Thread Antoine Latter
For those of you following along, you'll need: import qualified Sound.OpenAL as AL import Data.Maybe import Foreign.C.Types import Control.Monad import Control.Concurrent import Foreign.Storable import Foreign.Marshal.Alloc when I run playOpenAL 440 I get no sound, and the following is

Re: [Haskell-cafe] [GSoC] X Haskell bindings

2008-03-31 Thread Antoine Latter
I've been looking into to this a bit myself, and have had trouble with the fact that the XML descriptions of the protocol are extremely C-centric. As in, the union types defined in the XML are C-unions, and I've seen a struct definition which uses padding-bytes to store semantically useful data.

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Antoine Latter
On Thu, Apr 10, 2008 at 9:50 AM, Adam Smyczek [EMAIL PROTECTED] wrote: For a small webapi binding I try to implement a session like monad by building a stack including BrowserAction from Network.Browser module as following: newtype RBAction a = RBAction { exec :: ErrorT String (StateT

Re: [Haskell-cafe] Fighting the monad stack, MonadIO

2008-04-10 Thread Antoine Latter
On Thu, Apr 10, 2008 at 12:44 PM, Antoine Latter [EMAIL PROTECTED] wrote: {-# LANGUAGE GeneralizedNewtypeDeriving #-} import Control.Monad.Trans import Control.Monad.State import Control.Monad.Error type BrowserAction = IO -- or something else which is in MondaIO data RBState

Re: [Haskell-cafe] Hoogle

2008-04-16 Thread Antoine Latter
2008/4/16 Galchin, Vasili [EMAIL PROTECTED]: Hello, I tried d to use Hoogle to find openFd's signature and more importantly FileMode. I found FileMode which is a type synonym with CMode. I don't understand what are the values for FileMode (so I can call openFd). ?? Values of type

Re: [Haskell-cafe] Re: Parsec3 performance issues (in relation to v2)

2008-05-13 Thread Antoine Latter
On Tue, May 13, 2008 at 9:23 PM, Neal Alexander [EMAIL PROTECTED] wrote: I stripped the code down to just the parsec related stuff and retested it. http://72.167.145.184:8000/parsec_test/Parsec2.prof http://72.167.145.184:8000/parsec_test/Parsec3.prof And the parser with a 9mb (800 kb

Re: [Haskell-cafe] Re: Parsec3 performance issues (in relation to v2)

2008-05-18 Thread Antoine Latter
On Tue, May 13, 2008 at 9:23 PM, Neal Alexander [EMAIL PROTECTED] wrote: I stripped the code down to just the parsec related stuff and retested it. http://72.167.145.184:8000/parsec_test/Parsec2.prof http://72.167.145.184:8000/parsec_test/Parsec3.prof And the parser with a 9mb (800 kb

Re: [Haskell-cafe] Re: Parsec3 performance issues (in relation to v2)

2008-05-18 Thread Antoine Latter
On Sun, May 18, 2008 at 11:23 AM, Antoine Latter [EMAIL PROTECTED] wrote: Neal, those two profiling results aren't really comparable, because your Parsec2 profiling doesn't include any cost-centers from the Parsec library - so all of the costs associated with Parsec2 will be assigned to cost

Re: [Haskell-cafe] ByteString.pack behavior

2008-05-19 Thread Antoine Latter
On Mon, May 19, 2008 at 1:22 PM, Don Stewart [EMAIL PROTECTED] wrote: Safe Num wrappers for primitive types that throw exceptions on overflow would make a useful library. Any takers? Sounds like fun. Neither the error messages nor the code will be pretty. Are we just interested in the

Re: [Haskell-cafe] ByteString.pack behavior

2008-05-20 Thread Antoine Latter
On Mon, May 19, 2008 at 9:44 PM, Antoine Latter [EMAIL PROTECTED] wrote: Sounds like fun. Neither the error messages nor the code will be pretty. Are we just interested in the Data.Int types and the Data.Word types? It's up on hackage here: http://hackage.haskell.org/cgi-bin/hackage-scripts

Re: [Haskell-cafe] ByteString.pack behavior

2008-05-20 Thread Antoine Latter
On Tue, May 20, 2008 at 8:44 AM, Antoine Latter [EMAIL PROTECTED] wrote: It's up on hackage here: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/checked One more thing - there's no Data instance for these types. Presumably it wouldn't be hard to add, I just wasn't familiar

Re: [Haskell-cafe] Question on type synonym definition and language extensions

2008-05-29 Thread Antoine Latter
2008/5/29 Olivier Boudry [EMAIL PROTECTED]: After some read, guess, try, error cycles I came up with this: type Matrix = forall m. forall a. forall i. forall n. (Ix i, MArray a n m, Num i, Num n) = m (a (i,i) n) I've tried similar things before. You may run into subtle problems later.

Re: [Haskell-cafe] Re: Parsec, updateState, and failure

2008-05-31 Thread Antoine Latter
On Sat, May 31, 2008 at 12:12 PM, Achim Schneider [EMAIL PROTECTED] wrote: Dimitry Golubovsky [EMAIL PROTECTED] wrote: If a parser which updated user state fails, will such update be reverted? I have no idea, I gave up before investigating that far. You want to avoid state at any cost,

Re: [Haskell-cafe] Ptr Word8 display question

2008-06-28 Thread Antoine Latter
2008/6/28 Galchin, Vasili [EMAIL PROTECTED]: Hi, Suppose I have a value of type Ptr Word8 and also an Int which is the length of the Ptr Word8(sorry if I am thinking too much in a C string frame of mind). How can I display the Ptr Word8 value of the given length? Vasili You're best

Re: [Haskell-cafe] Ptr Word8 display question

2008-06-28 Thread Antoine Latter
2008/6/28 Galchin, Vasili [EMAIL PROTECTED]: Hi, Suppose I have a value of type Ptr Word8 and also an Int which is the length of the Ptr Word8(sorry if I am thinking too much in a C string frame of mind). How can I display the Ptr Word8 value of the given length? You mentioned C style

Re: [Haskell-cafe] Combining Wouter's expressions with extensible records

2008-07-09 Thread Antoine Latter
On Wed, Jul 9, 2008 at 9:40 PM, Ron Alford [EMAIL PROTECTED] wrote: Ok, but to make it part of a record, it needs to implement Data: data Expr f = In (f (Expr f)) deriving Data but this gives No instances for (Data (f (Expr f)), Typeable (Expr f)) arising from the 'deriving' clause

Re: [Haskell-cafe] Re: Combining Wouter's expressions with extensible records

2008-07-10 Thread Antoine Latter
On Thu, Jul 10, 2008 at 2:15 PM, Ron Alford [EMAIL PROTECTED] wrote: I'm making progress, but how would I make the following a Typeable instance: data (f :+: g) e = Inl (f e) | Inr (g e) deriving Eq Here is what I'm using for Expr: data Expr f = In (f (Expr f)) instance Typeable1 f =

Re: [Haskell-cafe] Re: Combining Wouter's expressions with extensible records

2008-07-10 Thread Antoine Latter
2008/7/10 Ron Alford [EMAIL PROTECTED]: Ok, I'm closer, but I'm running into a problem with typeOf and lists, of all things: *WouterTest typeOf (eVar v :: TermExpr) Planning.Wouter.Expr (Planning.Wouter.:+: WouterTest.Const WouterTest.Var) *WouterTest typeOf ([eVar v] :: [TermExpr]) ***

Re: [Haskell-cafe] Re: Combining Wouter's expressions with extensible records

2008-07-11 Thread Antoine Latter
On Fri, Jul 11, 2008 at 7:07 AM, Ron Alford [EMAIL PROTECTED] wrote: What's odd is that it works directly (typeOf ... (Expr (f :+: g)) returns a type), but if you enclose the expression in a list, it fails with Prelude.undefined. Do I also need a custom instance for Typeable [Expr ...] ? (See

Re: [Haskell-cafe] Generalizing IO

2009-10-05 Thread Antoine Latter
On Mon, Oct 5, 2009 at 10:54 PM, Floptical Logic flopticalo...@gmail.com wrote: If I were to make an instance of MonadIO be a parameter to StateT and I wanted to use the Net monad (from Roll your own IRC bot on the wiki) with it, I would need to make Net an instance of MonadIO.  What would

Re: [Haskell-cafe] Re: Wiki software?

2009-11-22 Thread Antoine Latter
On Sat, Nov 21, 2009 at 3:09 PM, Gwern Branwen gwe...@gmail.com wrote: This doesn't surprise me; but how much slower are we talking? If it's not at the point that a browser of a Gitit wiki could notice the difference, then it seems to me that the dep ought to be loosened: the

Re: [Haskell-cafe] Re: Wiki software?

2009-11-23 Thread Antoine Latter
On Sun, Nov 22, 2009 at 11:56 AM, Antoine Latter aslat...@gmail.com wrote: Running 'pandoc --strict' over the Markdown readme.text takes: ~0.09s with pandoc built against parsec-2 ~0.19s with pandoc built against parsec-3 on my machine. I have a branch of parsec-3 which seems to brings us

Re: [Haskell-cafe] instance Binary UTCTime (Was: Oprhan instances)

2009-11-26 Thread Antoine Latter
On Thu, Nov 26, 2009 at 2:27 PM, Joachim Breitner m...@joachim-breitner.de wrote: p...@-cafe: I still have doubts that this approach will scale as hackage grows. We’d get a lot more dependencies than we have now, and still would face this problem every now and then. Or do you really want

Re: [Haskell-cafe] Data.Binary and error handling

2009-11-27 Thread Antoine Latter
On Fri, Nov 27, 2009 at 3:14 PM, Khudyakov Alexey alexey.sklad...@gmail.com wrote: You might want to look at designs that interleave error tokens in the stream. Could you point out any examples? http://hackage.haskell.org/packages/archive/tar/0.3.1.0/doc/html/Codec-Archive-Tar.html#v%3Aread

Re: [Haskell-cafe] Re: Implicit newtype unwrapping

2009-12-03 Thread Antoine Latter
On Thu, Dec 3, 2009 at 6:00 PM, Joachim Breitner m...@joachim-breitner.de wrote: But when I uncommented the definition of toFoo and fromfoo, I got: Demo.hs:11:9:    Couldn't match expected type `Foo' against inferred type `Int'    In the expression: id    In the definition of `toFoo': toFoo

Re: [Haskell-cafe] Re: Implicit newtype unwrapping

2009-12-03 Thread Antoine Latter
On Thu, Dec 3, 2009 at 9:10 PM, Antoine Latter aslat...@gmail.com wrote: On Thu, Dec 3, 2009 at 6:00 PM, Joachim Breitner m...@joachim-breitner.de wrote: But when I uncommented the definition of toFoo and fromfoo, I got: Demo.hs:11:9:    Couldn't match expected type `Foo' against inferred

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-06 Thread Antoine Latter
On Fri, Dec 4, 2009 at 7:47 PM, Paulo Tanimoto tanim...@arizona.edu wrote: Great!  Antoine, other tests we should do?  Derek, I apologize if you're already following this, but can you give us your opinion? Paulo Well, the more eyes and test cases we can get on the new code the better. I'd

Re: [Haskell-cafe] Insert a laziness break into strict ST

2009-12-06 Thread Antoine Latter
On Sun, Dec 6, 2009 at 5:46 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: I have lot of ST actions that shall be bound strictly (they write to a buffer), but somewhere between these actions I like to have a laziness break. I thought I could do this by temporarily switching to

Re: [Haskell-cafe] Re: fgetc and fputc equivalents

2009-12-09 Thread Antoine Latter
On Wed, Dec 9, 2009 at 11:33 AM, John D. Earle johndea...@cox.net wrote: My interest isn't actually to push around characters. I do enough of that. What I really want to do is push bits and not bytes. I thought that fgetc and fputc worked on bytes, not bits? I've had great luck using the

Re: [Haskell-cafe] forkSequence, runPar, parallelize (was: Re: You are in a twisty maze of concurrency libraries, all different ...)

2009-12-09 Thread Antoine Latter
On Wed, Dec 9, 2009 at 2:17 PM, Mario Blazevic mblaze...@stilo.com wrote:        It appears there are several implementations existing on Hackage of the following function, in various disguises:   runPar :: [IO a] - IO [a] the idea being that the IO computations are run in parallel, rather

Re: [Haskell-cafe] forkSequence, runPar, parallelize

2009-12-09 Thread Antoine Latter
On Wed, Dec 9, 2009 at 3:44 PM, Mario Blazevic mblaze...@stilo.com wrote:        I can't test it right now, but wouldn't the following do the job in the Identity monad? forkExec :: Identity a - Identity (Identity a) forkExec k = let result = runIdentity k             in result `par` return

Re: [Haskell-cafe] What about adding a wiki for each haskell project?

2009-12-12 Thread Antoine Latter
On Fri, Dec 11, 2009 at 6:00 PM, Marc Weber marco-owe...@gmx.de wrote: Hackage is missing one feature: It is very static. I mean if you have a patch or a question or a comment you have to lookup the darcs repository, write the patch then contact the author and wait.. If the author replies

Re: [Haskell-cafe] Re: Optimizing Parsec 3 -- was: Wiki software?

2009-12-15 Thread Antoine Latter
On Tue, Dec 15, 2009 at 3:13 PM, Bryan O'Sullivan b...@serpentine.com wrote: Besides the performance issue, are there any other considerations keeping it from becoming the default? One thing that makes me a bit hesitant is that it's a pretty big change to the core parser data structure, to the

Re: [Haskell-cafe] Instances of `IsString`.

2009-12-20 Thread Antoine Latter
On Sun, Dec 20, 2009 at 4:12 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On Dec 20, 2009, at 17:09 , Jason Dusek wrote:  A quick check on Hayoo! and in my interpreter shows that  there are basically no instances of `IsString`. Is it  really so little used? The only 2 instances

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2009-12-21 Thread Antoine Latter
On Mon, Dec 21, 2009 at 3:43 PM, Tom Tobin korp...@korpios.com wrote: This time the install died on HJScript: ** [ 2 of 26] Compiling HJScript.Monad   ( src/HJScript/Monad.hs, dist/build/HJScript/Monad.o ) src/HJScript/Monad.hs:51:10:    A pattern match on a GADT requires -XGADTs

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Antoine Latter
On Fri, Dec 25, 2009 at 4:55 PM, Felipe Lessa felipe.le...@gmail.com wrote: On Fri, Dec 25, 2009 at 11:25:41PM +0200, Serguey Zefirov wrote: I am looking more for the way to serialize intermediate parser computations. The first problem is, actually, easy one. ;) Probably you'll have to create

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Antoine Latter
On Fri, Dec 25, 2009 at 5:06 PM, Serguey Zefirov sergu...@gmail.com wrote: AFAIK, one of HAppS modules does a similar transformation via Template Haskell.  The functions specify transactions, and each transaction is converted to a serializable data type.  Then it's possible to create a

Re: [Haskell-cafe] Invertible functions list

2009-12-28 Thread Antoine Latter
On Mon, Dec 28, 2009 at 10:32 PM, Jonathan Fischoff jonathangfisch...@gmail.com wrote: Hi, I would to create a list of tuples (or something similar) of invertible functions [((a - b), (b - a)), ((b - c), (c - b)), Such that I could call forward invertibleFuctionList domainValue = ? --

Re: [Haskell-cafe] Configuring cabal install readline on Snow Leopard with MacPorts

2009-12-29 Thread Antoine Latter
On Tue, Dec 29, 2009 at 2:48 AM, Alexy Khrabrov delivera...@gmail.com wrote: I've tried to do cabal install readline on Snow Leopard with MacPorts and it fails with the infamous: $ cabal install readline ... snip How should I properly tell cabal install readline where my readline is? As

Re: [Haskell-cafe] Template Haskell - substitution in pattern in a lambda

2010-01-03 Thread Antoine Latter
On Sun, Jan 3, 2010 at 8:30 PM, Patrick Caldon p...@pessce.net wrote: I'm trying to write some template haskell which will transform: $(buildCP 0)  into \(SimpleM d1 d2 d3) (SimpleM _ _ _) - (SimpleM d1 d2 d3) $(buildCP 1)  into \(SimpleM _ d2 d3) (SimpleM d1 _ _) - (SimpleM d1 d2 d3)

Re: [Haskell-cafe] ANN: uuid-0.1.2

2010-01-05 Thread Antoine Latter
2010/1/5 Mark Lentczner ma...@glyphic.com: Antione and I are please to announce the release of uuid-0.1.2. Thanks for doing the heavy lifting on this one, Mark. Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] wildcards for type variables?

2010-01-13 Thread Antoine Latter
On Wed, Jan 13, 2010 at 4:59 AM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On Jan 13, 2010, at 05:54 , David Virebayre wrote: On Wed, Jan 13, 2010 at 12:29 AM, Evan Laforge qdun...@gmail.com wrote: Occasionally I have a function with an unused argument, whose type I don't want to

Re: [Haskell-cafe] GHC bug? Cabal bug? Haddock bug?

2010-01-16 Thread Antoine Latter
This sounds similar to an issue I was seeing over here: http://groups.google.com/group/happs/msg/04ecfe4fd6285c0d The module being compiled also includes TH top-level statements, and was only reproducible when building from Cabal. Here's another occurance on a different platform:

Re: [Haskell-cafe] GHC bug? Cabal bug? Haddock bug?

2010-01-16 Thread Antoine Latter
2010/1/16 Mark Lentczner ma...@glyphic.com: Indeed - all those look exactly like the same issue. And the workaround: http://groups.google.com/group/happs/msg/1e7761d421b0e5eb That doesn't fix the real issue: It causes happstack-data to not need the thing that is built wrong in

[Haskell-cafe] Declarative binary protocols

2010-01-18 Thread Antoine Latter
Cafe, We have some fantastic tools for binary parsing in packages like binary and cereal (and presumably attoparsec, which I've not used). But they don't quite scratch an itch I have when writing implementations of binary communication protocols. A good example of my problem is in my

  1   2   3   4   5   6   >