[Haskell-cafe] X11 package bug: XClientMessageEvent long data
Does anyone know the current maintenance status of the X11 package? I emailed Spencer Janssen a number of months ago and never heard back. So, I'll put this here in case any one else runs into it or can get it to the right place. This is a proposed bug fix for a problem I ran into using xmonad client messages to send remote commands on 64LP architectures (i.e., amd64), wherein the C X11 library and Haskell's disagree about the size of client message arguments. Tue Nov 16 23:41:49 EST 2010 Dylan Simon * change XClientMessageEvent long data The XClientMessageEvent.data.l field is actually a long, not an int, so it must be interpreted as such, even though format is set to 32 in this case. Ostensibly this is an Xlib bug, but it is unlikely to be fixed there. diff -rN -u old-src/Graphics/X11/Xlib/Extras.hsc new-src/Graphics/X11/Xlib/Extras.hsc --- old-src/Graphics/X11/Xlib/Extras.hsc2011-03-15 22:40:39.687844812 -0400 +++ new-src/Graphics/X11/Xlib/Extras.hsc2011-03-15 22:40:39.724522814 -0400 @@ -601,7 +601,7 @@ 16 -> do a <- peekArray 10 datPtr return $ map fromIntegral (a::[Word16]) 32 -> do a <- peekArray 5 datPtr - return $ map fromIntegral (a::[Word32]) + return $ map fromIntegral (a::[CLong]) _ -> error "X11.Extras.clientMessage: illegal value" return $ ClientMessageEvent { ev_event_type= type_ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell mailing lists followup?
On Tue, Mar 15, 2011 at 6:44 PM, wren ng thornton wrote: > Earlier today I got messages from the three lists I'm on (libraries@, > haskell-cafe@, glasgow-haskell-users@) about delivery being disabled due > to excessive bounces. The re-enabling codes in those emails were expired > ---which is supposed to take a few days--- despite only getting them at > 4:00am today. I've since logged in to re-enable delivery, though it'll > only be a matter of time until it happens again. I got the same emails. I had noticed before I got those that I hadn't received any mail from @haskell.org for several days, whereas other email was coming through fine. Having re-enabled delivery, everything seems fine. -- Jeff Wheeler Undergraduate, Electrical Engineering University of Illinois at Urbana-Champaign ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] haskell mailing lists followup?
On 3/14/11 2:01 AM, pt...@acanac.net wrote: > Hi Wren; > > I CC'ed you on email I sent Thu, 10 Mar after seeing your post on > haskell-cafe Thu Mar 10 07:24:45 CET "Haskell mail server fail?". Did > you see that email? I didn't see it; though it looks like it just showed up in my inbox. The only other replies I've seen are from: [cc: haskell-cafe] On 3/10/11 2:18 AM, David Virebayre [cc: haskell-cafe] On 3/10/11 7:44 AM, Daniel Fischer Earlier today I got messages from the three lists I'm on (libraries@, haskell-cafe@, glasgow-haskell-users@) about delivery being disabled due to excessive bounces. The re-enabling codes in those emails were expired ---which is supposed to take a few days--- despite only getting them at 4:00am today. I've since logged in to re-enable delivery, though it'll only be a matter of time until it happens again. > Have you tried to reply to pt...@acanac.net? Have > you started seeing Haskell mailing list traffic again? Nope (well now I have), and nope. Actually, while writing this, I did just see: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition On 3/15/11 7:35 PM, Brent Yorgey come through. So maybe re-enabling delivery fixed it this time? > [...] I've seen web pages > reporting problems with google-based lists tripping over SPF when > misconfigured for forwarding, and so forth. It would be helpful to > see the error messages. Yeah, I've run into problems with SPF before. But since it's not just me I don't think it's an @freegeek.org problem. > I've successfully transferred messages to myself dummied up using smtp > connecting directly to my haskell-cafe list address. I haven't > received any approval messages from recent attempts to set up new > target addresses on the same receiving email host. Non-Haskell > mailing lists have continued uninterrupted, but haskell lists to > teerl...@acanac.net last received on 04 Mar. Ditto. My other mailing lists are coming through fine (e.g., a...@lists.chalmers.se) which also indicates the issue is on the @haskell.org side. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition
I am pleased to announce that the special Poetry and Fiction Edition of The Monad.Reader is now available [1]. Enjoy! Also, the submission deadline for Issue 18 has been extended one week, to Friday, April 8. Please get in touch if you would like to submit something! -Brent [1] http://themonadreader.files.wordpress.com/2011/03/specialissue.pdf ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Static linking problem // CentOS 5.5 - GHC 6.12.3
I've installed GHC version 6.12.3 on CentOS 5.5 x86_64. I'm trying to run a very simple Haskell program as CGI following the guide at: http://www.haskell.org/haskellwiki/Practical_web_programming_in_Haskell My .hs file I'm trying to use looks like this: -- import Network.CGI import Text.XHtml page :: Html page = body << h1 << "Hello World!" cgiMain :: CGI CGIResult cgiMain = output $ renderHtml page main :: IO () main = runCGI $ handleErrors cgiMain -- If I compile it using dynamic linking I can run it from the command line, since the environment is correct: # ghc haskell_v2.hs --make -o haskell_v2.cgi Linking haskell_v2.cgi ... # ./haskell_v2.cgi Content-type: text/html; charset=ISO-8859-1 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml"; >Hello World! [root@vps-1040050-2953 haskellTest]# However I do of course want to run it through CGI on a webserver. I'm running lighttpd. If I try to run the file compiled above I get "500 - Internal Server Error", most likely since the enviroment is not correct for dynamic linked files: # ldd haskell_v2.cgi librt.so.1 => /lib64/librt.so.1 (0x2aff22c25000) libutil.so.1 => /lib64/libutil.so.1 (0x2aff22e2e000) libdl.so.2 => /lib64/libdl.so.2 (0x2aff23031000) libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x2aff23236000) libm.so.6 => /lib64/libm.so.6 (0x2aff2346f000) libc.so.6 => /lib64/libc.so.6 (0x2aff236f2000) libpthread.so.0 => /lib64/libpthread.so.0 (0x2aff23a4a000) /lib64/ld-linux-x86-64.so.2 (0x2aff22a08000) # file haskell_v2.cgi haskell_v2.cgi: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped Hence I wanted to use static linking ( http://www.haskell.org/haskellwiki/Web/Literature/Static_linking ). However trying to compile using the "-optl-static" option fails: # ghc haskell_v2.hs --make -optl-static -fforce-recomp -o haskell_v2.cgi [1 of 1] Compiling Main ( haskell_v2.hs, haskell_v2.o ) Linking haskell_v2.cgi ... /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(HsNet.o): In function `hsnet_getaddrinfo': HsNet.c:(.text+0x11): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sAwu_info': (.text+0xd45d): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syh4_info': (.text+0x4364): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sygm_info': (.text+0x424f): warning: Using 'gethostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syx3_info': (.text+0x5318): warning: Using 'sethostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sxz5_info': (.text+0x12c6): warning: Using 'endhostent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syJY_info': (.text+0x605d): warning: Using 'getnetbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sycm_info': (.text+0x3e75): warning: Using 'getnetbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sybC_info': (.text+0x3de7): warning: Using 'getnetent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `syyg_info': (.text+0x5458): warning: Using 'setnetent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.3/libHSnetwork-2.3.a(BSD.o): In function `sxz5_info': (.text+0x1296): warning: Using 'endnetent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/network-2.3/ghc-6.12.
Re: [Haskell-cafe] unix-compat and GHC 7.0.2
Thanks Pieter and Paulo, that solved the problem perfectly. And I'm not surprised you stumbled upon this while installing Yesod, that's what I was doing too ;). Michael On Tue, Mar 15, 2011 at 8:41 PM, Paulo Tanimoto wrote: > On Tue, Mar 15, 2011 at 1:34 PM, Pieter Laeremans > wrote: >> I've got the same problem. >> I don't have acces to the computer where I've go the problem (my home mac). >> But if I remember correctly >> cabal install unix-compat -V3 yielded more output, the problem >> was due to lbutil.h, that was not present. I've experienced the same problem >> on an EC2, with a redhat fedora, by amazon. >> On ubuntu I got it working by installing libbsd-dev or something like that. >> kind regards, >> Pieter >> PS : funny thing is, I've stumbled upon the problem when trying to install >> yesod ;-). >> >> On Tue, Mar 15, 2011 at 7:13 PM, Michael Snoyman >> wrote: >>> >>> Hi all, >>> >>> I'm having trouble compiling unix-compat with GHC 7.0.2. I'm fairly >>> certain that other users are not running into this, but I'm not sure >>> what would be wrong on my system. Here's the error I'm getting: >>> >>> Resolving dependencies... >>> Configuring unix-compat-0.2.1.1... >>> cabal: Missing dependency on a foreign library: >>> * Missing header file: HsUnixCompat.h >>> This problem can usually be solved by installing the system package that >>> provides this library (you may need the "-dev" version). If the library is >>> already installed but in a non-standard location then you can use the >>> flags >>> --extra-include-dirs= and --extra-lib-dirs= to specify where it is. >>> cabal: Error: some packages failed to install: >>> unix-compat-0.2.1.1 failed during the configure step. The exception was: >>> ExitFailure 1 >>> >>> Any ideas? >>> >>> Thanks, >>> Michael >>> >>> > > I had the same problem and used the same solution. On Ubuntu, install > 'libbsd-dev'. This was the ticket opened by Bas: > > http://hackage.haskell.org/trac/ghc/ticket/4974 > > Perhaps we should add a note about this in the GHC download page? > > Paulo > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unix-compat and GHC 7.0.2
On Tue, Mar 15, 2011 at 1:34 PM, Pieter Laeremans wrote: > I've got the same problem. > I don't have acces to the computer where I've go the problem (my home mac). > But if I remember correctly > cabal install unix-compat -V3 yielded more output, the problem > was due to lbutil.h, that was not present. I've experienced the same problem > on an EC2, with a redhat fedora, by amazon. > On ubuntu I got it working by installing libbsd-dev or something like that. > kind regards, > Pieter > PS : funny thing is, I've stumbled upon the problem when trying to install > yesod ;-). > > On Tue, Mar 15, 2011 at 7:13 PM, Michael Snoyman > wrote: >> >> Hi all, >> >> I'm having trouble compiling unix-compat with GHC 7.0.2. I'm fairly >> certain that other users are not running into this, but I'm not sure >> what would be wrong on my system. Here's the error I'm getting: >> >> Resolving dependencies... >> Configuring unix-compat-0.2.1.1... >> cabal: Missing dependency on a foreign library: >> * Missing header file: HsUnixCompat.h >> This problem can usually be solved by installing the system package that >> provides this library (you may need the "-dev" version). If the library is >> already installed but in a non-standard location then you can use the >> flags >> --extra-include-dirs= and --extra-lib-dirs= to specify where it is. >> cabal: Error: some packages failed to install: >> unix-compat-0.2.1.1 failed during the configure step. The exception was: >> ExitFailure 1 >> >> Any ideas? >> >> Thanks, >> Michael >> >> I had the same problem and used the same solution. On Ubuntu, install 'libbsd-dev'. This was the ticket opened by Bas: http://hackage.haskell.org/trac/ghc/ticket/4974 Perhaps we should add a note about this in the GHC download page? Paulo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unix-compat and GHC 7.0.2
I've got the same problem. I don't have acces to the computer where I've go the problem (my home mac). But if I remember correctly cabal install unix-compat -V3 yielded more output, the problem was due to lbutil.h, that was not present. I've experienced the same problem on an EC2, with a redhat fedora, by amazon. On ubuntu I got it working by installing libbsd-dev or something like that. kind regards, Pieter PS : funny thing is, I've stumbled upon the problem when trying to install yesod ;-). On Tue, Mar 15, 2011 at 7:13 PM, Michael Snoyman wrote: > Hi all, > > I'm having trouble compiling unix-compat with GHC 7.0.2. I'm fairly > certain that other users are not running into this, but I'm not sure > what would be wrong on my system. Here's the error I'm getting: > > Resolving dependencies... > Configuring unix-compat-0.2.1.1... > cabal: Missing dependency on a foreign library: > * Missing header file: HsUnixCompat.h > This problem can usually be solved by installing the system package that > provides this library (you may need the "-dev" version). If the library is > already installed but in a non-standard location then you can use the flags > --extra-include-dirs= and --extra-lib-dirs= to specify where it is. > cabal: Error: some packages failed to install: > unix-compat-0.2.1.1 failed during the configure step. The exception was: > ExitFailure 1 > > Any ideas? > > Thanks, > Michael > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Pieter Laeremans "The future is here. It's just not evenly distributed yet." W. Gibson ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] unix-compat and GHC 7.0.2
Hi all, I'm having trouble compiling unix-compat with GHC 7.0.2. I'm fairly certain that other users are not running into this, but I'm not sure what would be wrong on my system. Here's the error I'm getting: Resolving dependencies... Configuring unix-compat-0.2.1.1... cabal: Missing dependency on a foreign library: * Missing header file: HsUnixCompat.h This problem can usually be solved by installing the system package that provides this library (you may need the "-dev" version). If the library is already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where it is. cabal: Error: some packages failed to install: unix-compat-0.2.1.1 failed during the configure step. The exception was: ExitFailure 1 Any ideas? Thanks, Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Question on a common pattern
Quoth Tillmann Rendel , ... > Where-clauses can only be used on equations, not on expressions or > statements, so you would need to float the where clause outwards: So ... not to put too fine a point on it, but ... as useful as function notation could be for the present purposes, you seem to agree that because of syntax limits, "where" isn't an answer to the problem. Recalling that we were talking about a common pattern v <- fx case v of ... ... (where v never appears again) Where a Haskell programmer's reflex seems to call for fx >>= case ..., or from the old thread mentioned earlier, a lambda with multiple definitions - fx >>= \ Opt1 -> ... Opt2 -> ... Donn Cave, d...@avvanta.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Question on a common pattern
Hi, Donn Cave wrote: someIO>>= f where f Opt1 = ... I like this ... or, I would like it, if I could make it work! I get "The last statement in a 'do' construct must be an expression", Where-clauses can only be used on equations, not on expressions or statements, so you would need to float the where clause outwards: foo = do someIO >>= f where f = ... Or you can use let-in-expressions or let-statements to bind local values (or functions) in do-notation: do let f = ... result <- someIO >>= f or do result <- let f = ... in someIO >>= Op1 = .. HTH, Tillmann ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Question on a common pattern
Hello tsuraan, Most often, when we multi-pattern-match on the return value of a monadic computation, we talk about Maybe or Either or [], and I often find myself doing this: someIO1 :: IO (Maybe A) someIO2 :: IO (Either A B) result1 <- someIO1 >>= maybe ... result2 <- someIO2 >>= either ... There are many ways of encoding this more nicely. My personal way is to use the proper monad transformers for the purpose. For many of these situations I have written convenient combinators in the 'contstuff' package. I found especially the 'liftF' function very useful in these cases: liftF :: (LiftFunctor t, Monad m) => m (InnerFunctor t a) -> t m a Example instances: liftF :: Monad m => m [a] -> ChoiceT r i m a liftF :: Monad m => m (Either e a) -> EitherT r e m a liftF :: Monad m => m (Maybe a) -> MaybeT r m a That way instead of checking each return value individually you would just write: result <- evalMaybeT $ do x <- liftF someMaybeIO y <- liftF (someOtherMaybeIO x x) return (Result x y) Greets, Ertugrul tsuraan wrote: > In my code, I'm doing this quite a lot: > > x <- someIO > case x of > Opt1 -> ... > > Having a line for extracting the value from the IO (or STM) and then > acting on the value seems unnatural. Is there a more concise way to > do this? This code: > > case someIO of > Opt1 -> ... > > Doesn't work, but is there something like that, that is valid? -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Question on a common pattern
Quoth Achim Schneider , ... > I use > > someIO >>= f where > f Opt1 = ... > > If it's a common pattern, you can even do > > opts f _ _ (Opt1 x) = f x > opts _ g _ (Opt2 x) = g x > opts _ _ h (Opt3 x) = h x > > . Functions are easier to mess around with than case expressions. I like this ... or, I would like it, if I could make it work! I get "The last statement in a 'do' construct must be an expression", if I don't drag the `where' clause down to the end of the `do' block around `someIO', which of course is what we're trying to avoid with the case expression. I must have missed a trick with the layout? Donn Cave, d...@avvanta.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Install GTK on Windows
Hi Pedro, Perhaps the libglib-2.0.0.dll that is getting loaded is not the one you want. You should be able to use a tool like process explorer [1] to see which specific dlls are getting loaded when you run. Ryan [1] http://technet.microsoft.com/en-us/sysinternals/bb896653 2011/3/15 José Pedro Magalhães > Hi all, > > I'd just like to add that I succeeded in building gtk2hs in Windows XP > 64bit with GHC 7.0.2, using the 2.16 bundle from [1] and following the > instructions in [2]. > > However, running the test program of [2] still fails at runtime with "The > procedure entry point g_assertion_message_expr could not be located in the > dynamic link library libglib-2.0.0.dll". Any idea what could cause this? Do > I need to add -l something when compiling the program? > > > Thanks, > Pedro > > [1] http://www.gtk.org/download-windows.html > > [2] http://markshroyer.com/2010/10/gtk2hs-on-windows/ > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Question on a common pattern
On Mon, 2011-03-14 at 17:56 +0100, Yves Parès wrote: > If you have only one alternative, then you can simply do: > > Opt1 <- someIO > > E.g., if you are _sure_ that foo returns always a 'Just' within a monad you > can perfectly do : > > Just x <- foo > Please beware - it is not exactly the same as with case if your assumption is wrong: > (do Just x <- return Nothing; [x]) [] > (do x <- return Nothing; case x of Just x -> [x]) *** Exception: :1:26-48: Non-exhaustive patterns in case For IO and many monads it is the same but it is not necessary for any monad. Regards ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Question on a common pattern
tsuraan wrote: > Is there a more concise way to do this? I use someIO >>= f where f Opt1 = ... If it's a common pattern, you can even do opts f _ _ (Opt1 x) = f x opts _ g _ (Opt2 x) = g x opts _ _ h (Opt3 x) = h x . Functions are easier to mess around with than case expressions. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wanted: composoable parsers from haskell-src-exts
Thanks for supporting the idea. > I already export a partial parser for top-of-file pragmas, I see. What I don't see is how such a parser would return the "rest of input". J.W. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Install GTK on Windows
Hi all, I'd just like to add that I succeeded in building gtk2hs in Windows XP 64bit with GHC 7.0.2, using the 2.16 bundle from [1] and following the instructions in [2]. However, running the test program of [2] still fails at runtime with "The procedure entry point g_assertion_message_expr could not be located in the dynamic link library libglib-2.0.0.dll". Any idea what could cause this? Do I need to add -l something when compiling the program? Thanks, Pedro [1] http://www.gtk.org/download-windows.html [2] http://markshroyer.com/2010/10/gtk2hs-on-windows/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wanted: composoable parsers from haskell-src-exts
Hi Johannes, The answer is: A) You can't, the way haskell-src-exts is built. You need to specify the %partial directives in the happy grammar, so without editing haskell-src-exts there's no way you could tack on partiality to the existing parsing primitives. B) It's a great feature request (to the point where I wonder why I haven't thought of it before), that should be quite easy to implement. I already export a partial parser for top-of-file pragmas, there's no reason why I couldn't export partial parsers for all the other entry points as well. I hope I can implement it shortly, but if you want it really fast and certain - patches are most welcome! Cheers, /Niklas On Mon, Mar 14, 2011 at 6:55 PM, J. Waldmann wrote: > Hi. > > I want to use parsers from haskell-src-exts as sub-parsers, > which does not seem to work since they insist on consuming the input > completely. > > I would need them to parse a maximal prefix, > and return the (unconsumed) rest of input as well > (cf. > > http://hackage.haskell.org/packages/archive/parsec/3.1.1/doc/html/Text-Parsec-Prim.html#v:getInput > ) > > I figure that happy has the %partial directive for that, but the > description > > http://www.haskell.org/happy/doc/html/sec-directives.html#sec-partial-parsers > does not really tell me how to obtain the rest of the input. > > Any hints (or code samples) appreciated. Thanks - J.W. > > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe