Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-18 Thread Andreas Abel
On 17.07.13 9:46 PM, Edward Kmett wrote: FWIW, I maintain, according to wc and sloccount, 220841 lines worth of Haskell code at present. Thanks, this is great service to our community. And you produce excellent quality! I have been bitten this error one time, so it affects me .45% of

[Haskell-cafe] Why are field selectors functions? [was: ghc-users A possible alternative to dot notation for record access]

2013-07-18 Thread AntC
No! This isn't more bikeshedding about notation. It's a bit of Haskell archaeology. On Sun, Jun 30, 2013 at 2:59 AM, Judah Jacobson wrote: [This isn't exactly what Judah wrote.] ... Instead of `x f` (to access field x of record f), maybe we could write `f{x}` as the record selection.

Re: [Haskell-cafe] Optimization flag changing result of code execution

2013-07-18 Thread Aleksey Khudyakov
On 17.07.2013 16:11, Brian Lewis wrote: On 2013.07.17, at 08:03, Jan-Willem Maessen wrote: This has all the marks of a 64-bit-only code running on a 32 bit machine. This discussion is interesting, but I'm not sure why so much of it is taking place here instead of on the mwc-random issue

[Haskell-cafe] what is wrong w my IORef Word32 ?

2013-07-18 Thread Joerg Fritsch
All, what is wrong w the below code? I get an type error related to the operation shiftL import Data.Bits import Data.Word import Data.IORef data Word32s = Word32s { x :: IORef Word32 } bitfield :: Word32 bitfield = 0 mkbitfield :: Word32 - IO Word32s mkbitfield i = do the_bf - newIORef i

Re: [Haskell-cafe] what is wrong w my IORef Word32 ?

2013-07-18 Thread Edward Z. Yang
shiftL has the wrong type: Bits a = a - Int - a so it is expecting the value in the IORef to be an Int. Edward Excerpts from Joerg Fritsch's message of Thu Jul 18 10:08:22 -0700 2013: All, what is wrong w the below code? I get an type error related to the operation shiftL import

Re: [Haskell-cafe] what is wrong w my IORef Word32 ?

2013-07-18 Thread Joerg Fritsch
Can I easily fix the modifyIORef statement by swapping something ? --Joerg On Jul 18, 2013, at 7:19 PM, Edward Z. Yang ezy...@mit.edu wrote: shiftL has the wrong type: Bits a = a - Int - a so it is expecting the value in the IORef to be an Int. Edward Excerpts from Joerg Fritsch's

Re: [Haskell-cafe] what is wrong w my IORef Word32 ?

2013-07-18 Thread Taylor Hedberg
Joerg Fritsch, Thu 2013-07-18 @ 19:22:46+0200: Can I easily fix the modifyIORef statement by swapping something ? --Joerg Replace `shiftL` with `flip shiftL` and change the type signature of `sLbitfield` to take an Int instead of an Integer. signature.asc Description: Digital signature

[Haskell-cafe] Haskell Programmers for Distributed Systems

2013-07-18 Thread Amanda Schwoegler
Parallel Scientific, Inc. is a Boulder, CO based, funded startup company with a presence around the globe, working in the cutting edge area of scalable parallelization. We seek experienced Haskell programmers to build a sophisticated, ultra-scalable high availability framework to be used in

[Haskell-cafe] Not working examples in GHC API documentation

2013-07-18 Thread John Blackbox
Hi! Please take a look here: http://www.haskell.org/haskellwiki/GHC/As_a_library The examples are not working. Even the simpelst one: import GHC import GHC.Paths ( libdir ) import DynFlags ( defaultLogAction ) main = defaultErrorHandler defaultLogAction $ do runGhc (Just libdir)

Re: [Haskell-cafe] Not working examples in GHC API documentation

2013-07-18 Thread Johan Tibell
I filed a bug a while back: http://ghc.haskell.org/trac/ghc/ticket/7752 Someone that understands the API needs to fix the doc. :) On Thu, Jul 18, 2013 at 7:58 PM, John Blackbox blackbox.dev...@gmail.com wrote: Hi! Please take a look here:

Re: [Haskell-cafe] Not working examples in GHC API documentation

2013-07-18 Thread John Blackbox
Great, but how can we learn the API, when examples are not working? -.- 2013/7/18 Johan Tibell johan.tib...@gmail.com I filed a bug a while back: http://ghc.haskell.org/trac/ghc/ticket/7752 Someone that understands the API needs to fix the doc. :) On Thu, Jul 18, 2013 at 7:58 PM,

[Haskell-cafe] Generating Haskell Code out of Haskell AST (GHC API)

2013-07-18 Thread John Blackbox
Hi! I dont know GHC API very well, but I want to generate AST of a program using GHC API. Is there any standard method to generate Haskell code out of it? (something like print_this_for_me_please function? :D ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Hoogle problems?

2013-07-18 Thread Neil Mitchell
Hoogle has returned to live, thanks to the efforts to the new haskell.org admins. Thanks, Neil On Tue, Jul 16, 2013 at 4:33 PM, Neil Mitchell ndmitch...@gmail.com wrote: No idea why it has gone down, my guess is that the Apache rule that says treat it as a CGI script got changed to serve it as

[Haskell-cafe] HaskellWiki images disappeared

2013-07-18 Thread Henk-Jan van Tuyl
L.S., It looks like the HaskellWiki images have disappeared; can anybody repair this? (See for example http://www.haskell.org/haskellwiki/Special:MostLinkedFiles ) Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In

[Haskell-cafe] ghc and jump table generation

2013-07-18 Thread Erik Rantapaa
I've been looking at the assembly code that ghc generates for simple pattern matching for situations like: foo :: Int - Int foo 1 = 3 foo 2 = 10 foo 3 = 2 foo 4 = 42 -- ... other random assignments and I noticed that it doesn't seem to generate a jump table (or even a table lookup)  like,

[Haskell-cafe] catching IO errors in a monad transformer stack

2013-07-18 Thread Eric Rasmussen
Hello, I am writing a small application that uses a monad transformer stack, and I'm looking for advice on the best way to handle IO errors. Ideally I'd like to be able to perform an action (such as readFile file_that_does_not_exist), catch the IOError, and then convert it to a string error in

Re: [Haskell-cafe] [web-devel] Automatic error traces

2013-07-18 Thread Alberto G. Corona
Hi Greeg, All I created a repository in gitHub with the necessary code for generating execution traces in case of error: https://github.com/agocorona/control-monad-supervisor/blob/master/Demos/TraceExample.hs the code is {-# OPTIONS -F -pgmF MonadLoc #-} module Demos.TraceExample ( ) where

Re: [Haskell-cafe] ghc and jump table generation

2013-07-18 Thread Niklas Larsson
Hi! 2013/7/18 Erik Rantapaa eranta...@yahoo.com I've been looking at the assembly code that ghc generates for simple pattern matching for situations like: foo :: Int - Int foo 1 = 3 foo 2 = 10 foo 3 = 2 foo 4 = 42 -- ... other random assignments and I noticed that it doesn't seem

Re: [Haskell-cafe] catching IO errors in a monad transformer stack

2013-07-18 Thread Alberto G. Corona
Hi Eric: The pattern may be the MonadCatchIO class: http://hackage.haskell.org/package/MonadCatchIO-transformers 2013/7/18 Eric Rasmussen ericrasmus...@gmail.com Hello, I am writing a small application that uses a monad transformer stack, and I'm looking for advice on the best way to

Re: [Haskell-cafe] Generating Haskell Code out of Haskell AST (GHC API)

2013-07-18 Thread Antoine Latter
The package haskell-src-exts is a lot less intimidating if all you are trying to do is programmatically generate Haskell source: http://hackage.haskell.org/package/haskell-src-exts The base types are here:

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Niklas Hambüchen
Did you file this as a bug? On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote: I'm on 7.6.2, and it does. Oh no. - Clark On Tuesday, April 23, 2013, Tom Ellis wrote: On Tue, Apr 23, 2013 at 09:36:04AM +0200, Petr Pudlák wrote: I tested it on GHC 6.12.1, which wasn't affected

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Clark Gaebel
No I haven't. - Clark On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen m...@nh2.me wrote: Did you file this as a bug? On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote: I'm on 7.6.2, and it does. Oh no. - Clark On Tuesday, April 23, 2013, Tom Ellis wrote: On Tue, Apr 23,

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Niklas Hambüchen
Sounds like a Real Good Thing to do :) On Fri 19 Jul 2013 11:10:25 JST, Clark Gaebel wrote: No I haven't. - Clark On Thu, Jul 18, 2013 at 10:07 PM, Niklas Hambüchen m...@nh2.me wrote: Did you file this as a bug? On Tue 23 Apr 2013 23:16:03 JST, Clark Gaebel wrote: I'm on 7.6.2, and it

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Clark Gaebel
Then I will. Going to double check on 7.6.3, first. Thanks for bringing this back to my attention. I forgot about it. :P Regards, - Clark On Thu, Jul 18, 2013 at 10:12 PM, Niklas Hambüchen m...@nh2.me wrote: Sounds like a Real Good Thing to do :) On Fri 19 Jul 2013 11:10:25 JST, Clark

Re: [Haskell-cafe] Monad Transformer Space Leak

2013-07-18 Thread Clark Gaebel
https://github.com/patperry/hs-monte-carlo/issues/9 On Thu, Jul 18, 2013 at 10:20 PM, Clark Gaebel cgae...@uwaterloo.ca wrote: Then I will. Going to double check on 7.6.3, first. Thanks for bringing this back to my attention. I forgot about it. :P Regards, - Clark On Thu, Jul 18, 2013

Re: [Haskell-cafe] catching IO errors in a monad transformer stack

2013-07-18 Thread David Sorokin
Hi! The exception handling is a difficult thing. It is usually simple enough but sometimes it can be very difficult, especially when using continuations within the monadic computation. To feel it, I often remember how the exceptions are handled in the F# async workflow (the sources are open),