Re: [Haskell-cafe] Interest in typed relational algebra library?
On Tue, 10 Jul 2012, o...@okmij.org wrote: And yes to first order predicate calculus too! Just two weeks ago Chung-chieh Shan and I were explaining at NASSLLI the embedding in Haskell of the higher-order predicate logic with two base types (so-called Ty2). The embedding supports type-safe simplification of formulas (which was really needed for our applications). The embedding is extensible: you can add models and more constants. http://okmij.org/ftp/gengo/NASSLLI10/course.html#semantics Oleg, thank you. Which article should I read first? oo--JS. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] stripSuffix
I can think of two cases where I'd want something like this. One is manipulating file extensions, where I'd want to use System.FilePath.splitExtension or something like that anyway. The other is suffix stripping for text processing, where I'd want to use a trie to match a whole lot of possible suffixes. For what it's worth, there are a lot of other cases (outside of file path handling) in which I've found it useful. I also have 'rdrop' and 'rdropWhile' and 'rstrip' in my stdlib, and use them regularly, if not frequently, along with List.isSuffixOf. Yes, they're inefficient for long lists and hang on infinite ones, but there are still lots of short lists out there. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
On Wed, Jul 18, 2012 at 06:50:31AM +0100, Andres Löh wrote: Using --avoid-reinstalls blindly or as a default flag is also unfortunately not a good idea in general. There are simply too many cases where installing older versions of packages (which is often the only thing that helps) is not really the solution you want. That's also the reason why it's not enabled by default. I need a combination of flags that I can use blindly with the greatest chance of success. The default doesn't work on packages like this one: % cabal --version cabal-install version 0.14.0 using version 1.14.0 of the Cabal library % cabal install sbv-2.2 Resolving dependencies... In order, the following would be installed: HUnit-1.2.4.3 (new package) containers-0.5.0.0 (new version) random-1.0.1.1 (new package) strict-concurrency-0.2.4.1 (new package) syb-0.3.7 (new package) template-haskell-2.7.0.0 (reinstall) changes: containers-0.4.2.1 - 0.5.0.0 QuickCheck-2.5 (new package) transformers-0.3.0.0 (new package) mtl-2.1.2 (new package) sbv-2.2 (new package) cabal: The following packages are likely to be broken by the reinstalls: ghc-7.4.1 Use --force-reinstalls if you want to install anyway. So should I be blindly using --force-reinstalls? Each build is in a clean environment, so breaking the installation isn't so serious. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
On Wed, Jul 18, 2012 at 10:19 AM, Ross Paterson r...@soi.city.ac.uk wrote: On Wed, Jul 18, 2012 at 06:50:31AM +0100, Andres Löh wrote: Using --avoid-reinstalls blindly or as a default flag is also unfortunately not a good idea in general. There are simply too many cases where installing older versions of packages (which is often the only thing that helps) is not really the solution you want. That's also the reason why it's not enabled by default. I need a combination of flags that I can use blindly with the greatest chance of success. The default doesn't work on packages like this one: % cabal --version cabal-install version 0.14.0 using version 1.14.0 of the Cabal library % cabal install sbv-2.2 Resolving dependencies... In order, the following would be installed: HUnit-1.2.4.3 (new package) containers-0.5.0.0 (new version) random-1.0.1.1 (new package) strict-concurrency-0.2.4.1 (new package) syb-0.3.7 (new package) template-haskell-2.7.0.0 (reinstall) changes: containers-0.4.2.1 - 0.5.0.0 QuickCheck-2.5 (new package) transformers-0.3.0.0 (new package) mtl-2.1.2 (new package) sbv-2.2 (new package) cabal: The following packages are likely to be broken by the reinstalls: ghc-7.4.1 Use --force-reinstalls if you want to install anyway. I don't think you can install this package on 7.4. As Andres said, it requires containers 0.5, but ghc 7.4's base libraries (in this case, template-haskell) use containers 0.4, and can't be reinstalled. I guess your best bet is to use sbv-2.1, which depends on containers = 0.3, or to unpack it and see if you can loosen the containers dependency and see if it still works with 0.4 So in short, no combination of flags will work in this case, I think. Failure is the best option. Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
On Wed, Jul 18, 2012 at 09:35:52AM +0100, Erik Hesselink wrote: I don't think you can install this package on 7.4. As Andres said, it requires containers 0.5, but ghc 7.4's base libraries (in this case, template-haskell) use containers 0.4, and can't be reinstalled. I guess your best bet is to use sbv-2.1, which depends on containers = 0.3, or to unpack it and see if you can loosen the containers dependency and see if it still works with 0.4 I'm talking about unattended automated builds, so tweaking isn't an option. On the other hand breaking the package environment isn't so bad, because I'm throwing it away after each build. So in short, no combination of flags will work in this case, I think. Failure is the best option. Actually --force-reinstalls does work in this case, and this thread began with Levent being unhappy with the failure option for his package, so I'm tempted to use that flag on all hackage builds. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
Is there any reason QuickCheck specifically requires containers = 0.5? Perhaps its lower bound could be relaxed. On Wed, Jul 18, 2012 at 11:29 AM, Ross Paterson r...@soi.city.ac.uk wrote: On Wed, Jul 18, 2012 at 09:35:52AM +0100, Erik Hesselink wrote: I don't think you can install this package on 7.4. As Andres said, it requires containers 0.5, but ghc 7.4's base libraries (in this case, template-haskell) use containers 0.4, and can't be reinstalled. I guess your best bet is to use sbv-2.1, which depends on containers = 0.3, or to unpack it and see if you can loosen the containers dependency and see if it still works with 0.4 I'm talking about unattended automated builds, so tweaking isn't an option. On the other hand breaking the package environment isn't so bad, because I'm throwing it away after each build. So in short, no combination of flags will work in this case, I think. Failure is the best option. Actually --force-reinstalls does work in this case, and this thread began with Levent being unhappy with the failure option for his package, so I'm tempted to use that flag on all hackage builds. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Gregory Collins g...@gregorycollins.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
I'm talking about unattended automated builds, so tweaking isn't an option. On the other hand breaking the package environment isn't so bad, because I'm throwing it away after each build. I'm not convinced that we should try to build packages at any price. If they're likely to cause problems in a standard environment on a user machine, then isn't it better to see this reflected on Hackage? So in short, no combination of flags will work in this case, I think. Failure is the best option. Actually --force-reinstalls does work in this case, and this thread began with Levent being unhappy with the failure option for his package, so I'm tempted to use that flag on all hackage builds. Does it produce a usable package and environment, or does it just work, but leave everything broken? I agree that using --force-reinstalls on Hackage might be an acceptable option, and it's probably better than using --avoid-reinstalls by default. However, it may still send the misleading message that a package builds just fine when it practice it doesn't. Cheers, Andres -- Andres Löh, Haskell Consultant Well-Typed LLP, http://www.well-typed.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
On Wed, Jul 18, 2012 at 10:37:31AM +0100, Gregory Collins wrote: Is there any reason QuickCheck specifically requires containers = 0.5? Perhaps its lower bound could be relaxed. It is sbv-2.2 that has that constraint. On Wed, Jul 18, 2012 at 11:29 AM, Ross Paterson r...@soi.city.ac.uk wrote: Actually --force-reinstalls does work in this case, and this thread began with Levent being unhappy with the failure option for his package, so I'm tempted to use that flag on all hackage builds. On the other hand, if installing a package is going to break people's package environments, maybe documenting the package on hackage isn't so important. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] A useful function for forking a thread, but letting the parent do setup first
Here's a useful little function: -- | Fork a thread, but wait for the main thread to perform a setup action -- using the child's 'ThreadID' before beginning work in the child thread. forkSetup :: (ThreadId - IO (Maybe a, r)) -- ^ Setup action to be called before the thread begins working - (a - IO b) -- ^ What to do in the worker thread - IO r forkSetup setup inner = mask $ \restore - do mv - newEmptyMVar tid - forkIO $ join $ takeMVar mv (ma, r) - setup tid `onException` putMVar mv (return ()) case ma of Nothing - putMVar mv $ return () Just a - putMVar mv $ restore $ inner a return () return r A question about 'mask': is it safe to use the 'restore' callback in a forked thread? Or might this be invalid in a future version of GHC? I'm aware that if forkSetup itself is called with exceptions masked, the child thread will also have exceptions masked. This seems reasonable, given that forkIO behaves the same way. Is a function like this available in some existing library? If not, where would be a good home for it? Thanks for the input! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] lambdabot-4.2.3.3
Hi. A few days ago I tried to install lambdabot package from hackage (4.2.3.2). Cabal install failed http://hackage.haskell.org/packages/archive/lambdabot/4.2.3.2/logs/failure/ghc-7.4. Then I found DanBurton's github repo https://github.com/DanBurton/lambdabot-remedies with some approaches to make lambdabot install fixed. All dependency packages (IOSpec, numbers) was already fixed. So I add FlexibleInstances extension to cabal file https://github.com/dmalikov/lambdabot/commit/db7a464948d65c11b3345db524cc8f9124301bbc and upload http://hackage.haskell.org/package/lambdabot-4.2.3.3 package to hackage. I hope that did everything right. -- Best regards, dmitry malikov ! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambdabot-4.2.3.3
At Wed, 18 Jul 2012 15:14:47 +0400, Dmitry Malikov wrote: A few days ago I tried to install lambdabot package from hackage (4.2.3.2). Cabal install failed. Then I found DanBurton's github repo with some approaches to make lambdabot install fixed. All dependency packages (IOSpec, numbers) was already fixed. So I add FlexibleInstances extension to cabal file and upload package to hackage. I hope that did everything right. Did you ask the maintainer first? You should never just upload a package that you are not maintaining before asking first the maintainer and then haskell-cafe if you receive no response. If you did not ask, please do not do that again and tell the maintainer - which in this case you should have no problem contacting, since Cale is often online on IRC. -- Francesco * Often in error, never in doubt ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5
On Wed, Jul 18, 2012 at 11:29 AM, Ross Paterson r...@soi.city.ac.uk wrote: On Wed, Jul 18, 2012 at 09:35:52AM +0100, Erik Hesselink wrote: I don't think you can install this package on 7.4. As Andres said, it requires containers 0.5, but ghc 7.4's base libraries (in this case, template-haskell) use containers 0.4, and can't be reinstalled. I guess your best bet is to use sbv-2.1, which depends on containers = 0.3, or to unpack it and see if you can loosen the containers dependency and see if it still works with 0.4 I'm talking about unattended automated builds, so tweaking isn't an option. On the other hand breaking the package environment isn't so bad, because I'm throwing it away after each build. We use --force-reinstalls for automated builds as well, inside a cabal-dev sandbox. I think that flag is a fine default for such situations. So in short, no combination of flags will work in this case, I think. Failure is the best option. Actually --force-reinstalls does work in this case, and this thread began with Levent being unhappy with the failure option for his package, so I'm tempted to use that flag on all hackage builds. Does that mean that you *can* reinstall template-haskell? I didn't know that... Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Cabal install fails due to recent HUnit
Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage. The ouput I'm getting from cabal is just: Reading available packages... Resolving dependencies... cabal: Couldn't read cabal file HUnit/1.2.5.0/HUnit.cabal If I unpack HUnit-1.2.5.0 and call 'cabal configure', I get: cabal: HUnit.cabal:57: The 'type' field is required for test suites. The available test types are: exitcode-stdio-1.0 The relevant lines from the cabal file are: Test-Suite hunit-tests-optimize-0 Type: exitcode-stdio-1.0 These look fine to me. Does anyone have any idea how to go about fixing this (on hackage at least)? Could this package temporarily be removed, to avoid breaking everyone's cabal? Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Monads with The contexts?
Done with some exercises on Gaussian distribution as a monad! http://en.pk.paraiso-lang.org/Haskell/Monad-Gaussian What do you think? Will this be a good approach or bad? Also this is the first page in my attempt to create runnable, and even testable wiki pages. To run the tests, please use hackage.haskell.org/package/doctest . 2012/7/18 Takayuki Muranushi muranu...@gmail.com: Thank you Oleg, for your detailed instructions! First, let me clarify my problem here (in sacrifice of physical accuracy.) c.f. Wrong.hs . earthMass, sunMass, marsMass :: [Double] earthMass = [1,10,100] sunMass = (*) $ [9,10,11] * earthMass marsMass = (*) $ [0.09,0.1,0.11] * earthMass sunPerMars = (/) $ sunMass * marsMass sunPerMars_range = (minimum sunPerMars, maximum sunPerMars) sunPerMars_range gives (0.8181818181818182,1.2223) These extreme answers close to 1 or 1 are inconsistent in sense that they used different Earth mass value for calculating Sun and Mars mass. Factoring out Earth mass is perfect and efficient solution in this case, but is not always viable when more complicated functions are involved. We want to remove such inconsistency. -- Exercise: why do we need the seemingly redundant EarthMass -- and deriving Typeable? -- Could we use TemplateHaskell instead? Aha! you use the Types as unique keys that resides in The context. Smart! To understand this, I have made MassStr.hs, which essentially does the same thing with more familiar type Strings. Of course using Strings are naive and collision-prone approach. Printing `stateAfter` shows pretty much what have happened. I'll remember that we can use Types as global identifiers. -- The following is essentially Control.Monad.Sharing.Memoization -- with one important addition -- Can you spot the important addition? type NonDet a = StateT FirstClassStore [] a data Key = KeyDyn Int | KeySta TypeRep deriving (Show, Ord, Eq) Hmm, I don't see what Control.Monad.Sharing.Memoization is; googling https://www.google.co.jp/search?q=Control.Monad.Sharing.Memoization gives our conversation at the top. If it's Memo in chapter 4.2 of your JFP paper, the difference I see is that you used Data.Set here instead of list of pairs for better efficiency. Exercise: how does the approach in the code relate to the approaches to sharing explained in http://okmij.org/ftp/tagless-final/sharing/sharing.html Chapter 3 introduces an implicit impure counter, and Chapter 4 uses a database that is passed around. let_ in Chapter 5 of sharing.pdf realizes the sharing with sort of continuation-passing style.The unsafe counter works across the module (c.f. counter.zip) but is generally unpredictable... Now I'm on to the next task; how we represent continuous probability distributions? The existing libraries: http://hackage.haskell.org/package/probability-0.2.4 http://hackage.haskell.org/package/ProbabilityMonads-0.1.0 Seemingly have restricted themselves to discrete distributions, or at least providing Random support for Monte-Carlo simulations. There's some hope; I guess Gaussian distributions form a Monad provided that 1. the standard deviations you are dealing with are small compared to the scale you deal with, and 2. the monadic functions are differentiable. Maybe I can use non-standard analysis and automatic differentiation; maybe I can resort to numerical differentiation; maybe I just give up and be satisfied with random sampling. I have to try first; then finally we can abstract upon different approaches. Also, I can start writing my Knowledge libraries from the part our knowledge is so accurate enough that the deviations are negligible (such as Earth mass!) P.S. extra spaces may have annoyed you. I'm sorry for that. My keyboard is chattering badly now; I have to update him soon. Best wishes, ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambdabot-4.2.3.3
On 07/18/2012 04:33 PM, Francesco Mazzoli wrote: At Wed, 18 Jul 2012 15:14:47 +0400, Dmitry Malikov wrote: A few days ago I tried to install lambdabot package from hackage (4.2.3.2). Cabal install failed. Then I found DanBurton's github repo with some approaches to make lambdabot install fixed. All dependency packages (IOSpec, numbers) was already fixed. So I add FlexibleInstances extension to cabal file and upload package to hackage. I hope that did everything right. Did you ask the maintainer first? You should never just upload a package that you are not maintaining before asking first the maintainer and then haskell-cafe if you receive no response. If you did not ask, please do not do that again and tell the maintainer - which in this case you should have no problem contacting, since Cale is often online on IRC. -- Francesco * Often in error, never in doubt ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Did you ask the maintainer first? Yes, I did. -- Best regards, dmitry malikov ! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambdabot-4.2.3.3
Lambdabot doesn't have a maintainer. On 18 July 2012 08:33, Francesco Mazzoli f...@mazzo.li wrote: At Wed, 18 Jul 2012 15:14:47 +0400, Dmitry Malikov wrote: A few days ago I tried to install lambdabot package from hackage (4.2.3.2). Cabal install failed. Then I found DanBurton's github repo with some approaches to make lambdabot install fixed. All dependency packages (IOSpec, numbers) was already fixed. So I add FlexibleInstances extension to cabal file and upload package to hackage. I hope that did everything right. Did you ask the maintainer first? You should never just upload a package that you are not maintaining before asking first the maintainer and then haskell-cafe if you receive no response. If you did not ask, please do not do that again and tell the maintainer - which in this case you should have no problem contacting, since Cale is often online on IRC. -- Francesco * Often in error, never in doubt ___ 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
Re: [Haskell-cafe] lambdabot-4.2.3.3
For what it's worth, I've been maintaining a fork for personal use for quite a while[1]. It diverged from the official version quite a while ago, but it builds on the latest GHC and uses Safe Haskell for the @eval module. If someone happens to want to use it they are free to do so, and I'll even fix problems they find if it's not too much work for me, but I can't really commit to officially maintaining it. Note also that one of its dependencies is not on Hackage (it's on the same GitHub account though). -- James [1] https://github.com/mokus0/lambdabot On Jul 18, 2012, at 11:04 AM, Cale Gibbard wrote: Lambdabot doesn't have a maintainer. On 18 July 2012 08:33, Francesco Mazzoli f...@mazzo.li wrote: At Wed, 18 Jul 2012 15:14:47 +0400, Dmitry Malikov wrote: A few days ago I tried to install lambdabot package from hackage (4.2.3.2). Cabal install failed. Then I found DanBurton's github repo with some approaches to make lambdabot install fixed. All dependency packages (IOSpec, numbers) was already fixed. So I add FlexibleInstances extension to cabal file and upload package to hackage. I hope that did everything right. Did you ask the maintainer first? You should never just upload a package that you are not maintaining before asking first the maintainer and then haskell-cafe if you receive no response. If you did not ask, please do not do that again and tell the maintainer - which in this case you should have no problem contacting, since Cale is often online on IRC. -- Francesco * Often in error, never in doubt ___ 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambdabot-4.2.3.3
On Wed, Jul 18, 2012 at 11:12 AM, James Cook mo...@deepbondi.net wrote: It diverged from the official version quite a while ago, but it builds on the latest GHC and uses Safe Haskell for the @eval module. That doesn't sound very safe. How does it handle all the DoS attacks etc in the mueval test suite? -- gwern http://www.gwern.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal install fails due to recent HUnit
Hi Erik, A similar thing happened to me with the GraphViz package. As Duncan explained to me, the problem is that Cabal-1.10.0.0 (and I believe also 1.10.1.0) incorrectly reports an error when conditionals are used in test suites. Upgrading to Cabal-1.10.2.0 (or cabal-install-0.14.0 with Cabal-1.14.0) should fix the problem. Unfortunately, this means your build will not work on a fresh Haskell Platform v2012.2.0.0, until HUnit is patched in the hackage index. Cheers, Martijn Schrage -- Oblomov Systems (http://www.oblomov.com) On 18-07-12 16:26, Erik Hesselink wrote: Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage. The ouput I'm getting from cabal is just: Reading available packages... Resolving dependencies... cabal: Couldn't read cabal file HUnit/1.2.5.0/HUnit.cabal If I unpack HUnit-1.2.5.0 and call 'cabal configure', I get: cabal: HUnit.cabal:57: The 'type' field is required for test suites. The available test types are: exitcode-stdio-1.0 The relevant lines from the cabal file are: Test-Suite hunit-tests-optimize-0 Type: exitcode-stdio-1.0 These look fine to me. Does anyone have any idea how to go about fixing this (on hackage at least)? Could this package temporarily be removed, to avoid breaking everyone's cabal? Erik ___ 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
Re: [Haskell-cafe] lambdabot-4.2.3.3
At Wed, 18 Jul 2012 11:04:17 -0400, Cale Gibbard wrote: Lambdabot doesn't have a maintainer. So is it just orphaned and anyone can upload? That does not sound right, also considering that lambdabot is used on the IRC channel, it'd be nice to have a more structured way to push fixes and improvements... Otherwise it'll eventually just bitrot and die. -- Francesco * Often in error, never in doubt ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] lambdabot-4.2.3.3
The irc server it runs on has about 10 users, all of whom I know and trust, so I have not tested it extensively but it should be as safe as anything else running Safe Haskell. Mueval uses the ghc API and with a minor modification can do so in safe mode. As long as you don't trust any packages you shouldn't, it should be fine. This sort of thing is why safe Haskell exists. On Jul 18, 2012, at 11:17 AM, Gwern Branwen gwe...@gmail.com wrote: On Wed, Jul 18, 2012 at 11:12 AM, James Cook mo...@deepbondi.net wrote: It diverged from the official version quite a while ago, but it builds on the latest GHC and uses Safe Haskell for the @eval module. That doesn't sound very safe. How does it handle all the DoS attacks etc in the mueval test suite? -- gwern http://www.gwern.net ___ 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
Re: [Haskell-cafe] Cabal install fails due to recent HUnit
Hi Martijn, Yes, upgrading will obviously fix things (we do use 0.14 on our development machines), but we have not set up any infrastructure for building a custom cabal on production servers. We just use the one from the Ubuntu repositories, which uses Cabal 1.10.1.0 on oneiric. So until we upgrade to precise I guess we have a problem. Erik On Wed, Jul 18, 2012 at 5:24 PM, Martijn Schrage mart...@oblomov.com wrote: Hi Erik, A similar thing happened to me with the GraphViz package. As Duncan explained to me, the problem is that Cabal-1.10.0.0 (and I believe also 1.10.1.0) incorrectly reports an error when conditionals are used in test suites. Upgrading to Cabal-1.10.2.0 (or cabal-install-0.14.0 with Cabal-1.14.0) should fix the problem. Unfortunately, this means your build will not work on a fresh Haskell Platform v2012.2.0.0, until HUnit is patched in the hackage index. Cheers, Martijn Schrage -- Oblomov Systems (http://www.oblomov.com) On 18-07-12 16:26, Erik Hesselink wrote: Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage. The ouput I'm getting from cabal is just: Reading available packages... Resolving dependencies... cabal: Couldn't read cabal file HUnit/1.2.5.0/HUnit.cabal If I unpack HUnit-1.2.5.0 and call 'cabal configure', I get: cabal: HUnit.cabal:57: The 'type' field is required for test suites. The available test types are: exitcode-stdio-1.0 The relevant lines from the cabal file are: Test-Suite hunit-tests-optimize-0 Type: exitcode-stdio-1.0 These look fine to me. Does anyone have any idea how to go about fixing this (on hackage at least)? Could this package temporarily be removed, to avoid breaking everyone's cabal? Erik ___ 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
Re: [Haskell-cafe] Cabal install fails due to recent HUnit
On 18-07-12 17:37, Erik Hesselink wrote: Hi Martijn, Yes, upgrading will obviously fix things (we do use 0.14 on our development machines) Well, to me it wasn't entirely obvious that upgrading to Cabal-1.10.2.0 fixes the problem for cabal-install-0.12, and I still think this is a good solution for most people that use version 2012.2.0.0 of the platform. I'd suggest you ask Duncan to patch the hackage repository, and maybe contact the maintainer of HUnit to prevent future problems. -- Martijn , but we have not set up any infrastructure for building a custom cabal on production servers. We just use the one from the Ubuntu repositories, which uses Cabal 1.10.1.0 on oneiric. So until we upgrade to precise I guess we have a problem. Erik On Wed, Jul 18, 2012 at 5:24 PM, Martijn Schrage mart...@oblomov.com wrote: Hi Erik, A similar thing happened to me with the GraphViz package. As Duncan explained to me, the problem is that Cabal-1.10.0.0 (and I believe also 1.10.1.0) incorrectly reports an error when conditionals are used in test suites. Upgrading to Cabal-1.10.2.0 (or cabal-install-0.14.0 with Cabal-1.14.0) should fix the problem. Unfortunately, this means your build will not work on a fresh Haskell Platform v2012.2.0.0, until HUnit is patched in the hackage index. Cheers, Martijn Schrage -- Oblomov Systems (http://www.oblomov.com) On 18-07-12 16:26, Erik Hesselink wrote: Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage. The ouput I'm getting from cabal is just: Reading available packages... Resolving dependencies... cabal: Couldn't read cabal file HUnit/1.2.5.0/HUnit.cabal If I unpack HUnit-1.2.5.0 and call 'cabal configure', I get: cabal: HUnit.cabal:57: The 'type' field is required for test suites. The available test types are: exitcode-stdio-1.0 The relevant lines from the cabal file are: Test-Suite hunit-tests-optimize-0 Type: exitcode-stdio-1.0 These look fine to me. Does anyone have any idea how to go about fixing this (on hackage at least)? Could this package temporarily be removed, to avoid breaking everyone's cabal? Erik ___ 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
Re: [Haskell-cafe] lambdabot-4.2.3.3
I should probably be more clear - it supports all the same resource limiting mechanisms as Mueval because it uses Mueval (modified to support Safe Haskell). On Jul 18, 2012, at 11:37 AM, James Cook mo...@deepbondi.net wrote: The irc server it runs on has about 10 users, all of whom I know and trust, so I have not tested it extensively but it should be as safe as anything else running Safe Haskell. Mueval uses the ghc API and with a minor modification can do so in safe mode. As long as you don't trust any packages you shouldn't, it should be fine. This sort of thing is why safe Haskell exists. On Jul 18, 2012, at 11:17 AM, Gwern Branwen gwe...@gmail.com wrote: On Wed, Jul 18, 2012 at 11:12 AM, James Cook mo...@deepbondi.net wrote: It diverged from the official version quite a while ago, but it builds on the latest GHC and uses Safe Haskell for the @eval module. That doesn't sound very safe. How does it handle all the DoS attacks etc in the mueval test suite? -- gwern http://www.gwern.net ___ 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal install fails due to recent HUnit
CCing: Ross Paterson and Richard G. On Wed, Jul 18, 2012 at 05:54:44PM +0200, Martijn Schrage wrote: On 18-07-12 17:37, Erik Hesselink wrote: Hi Martijn, Yes, upgrading will obviously fix things (we do use 0.14 on our development machines) Well, to me it wasn't entirely obvious that upgrading to Cabal-1.10.2.0 fixes the problem for cabal-install-0.12, and I still think this is a good solution for most people that use version 2012.2.0.0 of the platform. I'd suggest you ask Duncan to patch the hackage repository, and maybe contact the maintainer of HUnit to prevent future problems. This also breaks all travis-ci builds. I think it is critical to refrain from using conditionals in test-suite stanzas for some time + fix the broken release on Hackage. Is there a way to make this issue more well-know. Would a warning on the upload page help? @Richard FYI: Just uploading a new package won't solve this issue. Cheers, Simon -- Martijn , but we have not set up any infrastructure for building a custom cabal on production servers. We just use the one from the Ubuntu repositories, which uses Cabal 1.10.1.0 on oneiric. So until we upgrade to precise I guess we have a problem. Erik On Wed, Jul 18, 2012 at 5:24 PM, Martijn Schrage mart...@oblomov.com wrote: Hi Erik, A similar thing happened to me with the GraphViz package. As Duncan explained to me, the problem is that Cabal-1.10.0.0 (and I believe also 1.10.1.0) incorrectly reports an error when conditionals are used in test suites. Upgrading to Cabal-1.10.2.0 (or cabal-install-0.14.0 with Cabal-1.14.0) should fix the problem. Unfortunately, this means your build will not work on a fresh Haskell Platform v2012.2.0.0, until HUnit is patched in the hackage index. Cheers, Martijn Schrage -- Oblomov Systems (http://www.oblomov.com) On 18-07-12 16:26, Erik Hesselink wrote: Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage. The ouput I'm getting from cabal is just: Reading available packages... Resolving dependencies... cabal: Couldn't read cabal file HUnit/1.2.5.0/HUnit.cabal If I unpack HUnit-1.2.5.0 and call 'cabal configure', I get: cabal: HUnit.cabal:57: The 'type' field is required for test suites. The available test types are: exitcode-stdio-1.0 The relevant lines from the cabal file are: Test-Suite hunit-tests-optimize-0 Type: exitcode-stdio-1.0 These look fine to me. Does anyone have any idea how to go about fixing this (on hackage at least)? Could this package temporarily be removed, to avoid breaking everyone's cabal? Erik ___ 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] How do I marshall a pointer over SendMessage LPARAM or WPARAM?
Cross-posted from Haskell-beginners. Apologies for not posting in the right place (though I am a beginner and have probably made a simpleton error). I'm new to Haskell, and have had some good success with FFI so far, but using Win32's sendMessage to send a pointer in LPARAM or WPARAM is resulting in access violations at the other end. Is there some issue with my pointer conversions? Am I hitting some restriction, or missing some compiler options? It's driving me pretty crazy, after a very nice start to using Haskell. Some sending code: Foreign.C.String.withCWString frustrator $ \s - do let wParam = System.Win32.Types.castPtrToUINT s :: System.Win32.Types.WPARAM Graphics.Win32.sendMessage wnd Graphics.Win32.wM_APP wParam 0 wndProc receiving code: | wmsg == Graphics.Win32.wM_APP = do s - peekCWString $ System.Win32.Types.castUINTToPtr wParam putStrLn s return 0 The string will not be seen. Some extra notes: I can get wndProc messages and integral data generally. The pointer values match textually at both ends when shown to stdout. At the sending side I can pass the CWString to a regular FFI function call just fine, and castUINTToPtr will give me back a functioning Ptr for that call. I have also tried sending to receiving from a working C++ program, without success. Access violations are reported when receiving, though again the address matches up. Silence from Haskell as before, when C++ is sending. I found someone else having an issue here: http://osdir.com/ml/haskell-cafe@haskell.org/2009-11/msg00731.html but no solution unfortunately. UPDATE since prior posting: Seems if I call out via FFI on the sending side, and set the WPARAM to Lhardcoding FTW in a wrapper C function, the SendMessage I then invoke will work. The C code sees both the original string and the new one, but only the second works when used. I must be missing something obvious, but have toasted my grey cells at this point! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cabal install fails due to recent HUnit
On Wed, Jul 18, 2012 at 05:16:19PM +0100, Simon Hengel wrote: CCing: Ross Paterson and Richard G. On Wed, Jul 18, 2012 at 05:54:44PM +0200, Martijn Schrage wrote: On 18-07-12 17:37, Erik Hesselink wrote: Hi Martijn, Yes, upgrading will obviously fix things (we do use 0.14 on our development machines) Well, to me it wasn't entirely obvious that upgrading to Cabal-1.10.2.0 fixes the problem for cabal-install-0.12, and I still think this is a good solution for most people that use version 2012.2.0.0 of the platform. I'd suggest you ask Duncan to patch the hackage repository, and maybe contact the maintainer of HUnit to prevent future problems. This also breaks all travis-ci builds. I think it is critical to refrain from using conditionals in test-suite stanzas for some time + fix the broken release on Hackage. Is there a way to make this issue more well-know. Would a warning on the upload page help? Other packages in hackage with conditionals in test-suites: fixhs-0.1.4 bloomfilter-1.2.6.10 pqc-0.5 pqc-0.5.1 leksah-server-0.12.0.3 leksah-server-0.12.0.4 leksah-server-0.12.0.5 codemonitor-0.1 codemonitor-0.2 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How do I marshall a pointer over SendMessage LPARAM or WPARAM?
On Wed, 2012-07-18 at 18:22 +0200, Simon Peter Nicholls wrote: Some sending code: Foreign.C.String.withCWString frustrator $ \s - do let wParam = System.Win32.Types.castPtrToUINT s :: System.Win32.Types.WPARAM Graphics.Win32.sendMessage wnd Graphics.Win32.wM_APP wParam 0 wndProc receiving code: | wmsg == Graphics.Win32.wM_APP = do s - peekCWString $ System.Win32.Types.castUINTToPtr wParam putStrLn s return 0 From the docs ( http://hackage.haskell.org/packages/archive/base/4.5.1.0/doc/html/Foreign-C-String.html#v:withCWString ): the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this I'm noy a windows guru, but I assume that `sendMessage` just puts the message into a queue and exits. So, you receive a pointer to already deallocated memory. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Interest in typed relational algebra library?
On Wed, 18 Jul 2012, Jay Sulzberger wrote: On Tue, 10 Jul 2012, o...@okmij.org wrote: And yes to first order predicate calculus too! Just two weeks ago Chung-chieh Shan and I were explaining at NASSLLI the embedding in Haskell of the higher-order predicate logic with two base types (so-called Ty2). The embedding supports type-safe simplification of formulas (which was really needed for our applications). The embedding is extensible: you can add models and more constants. http://okmij.org/ftp/gengo/NASSLLI10/course.html#semantics Oleg, thank you. Which article should I read first? oo--JS. Ah, I see that the files are Haskell source files, and not Postscript files. The order is clear. oo--JS. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell Symposium 2012 - Call for Participation (early registration closes 9th August)
CALL FOR PARTICIPATION ACM SIGPLAN Haskell Symposium 2012 Copenhagen, Denmark 13th September, 2012 (directly after ICFP) http://www.haskell.org/haskell-symposium/2012/ The purpose of the Haskell Symposium is to discuss experiences with Haskell and future developments for the language. The scope of the symposium includes all aspects of the design, semantics, theory, application, implementation, and teaching of Haskell. Accepted papers and programme: == * http://haskell.org/haskell-symposium/2012/#schedule REGISTRATION IS NOW OPEN: = * http://www.icfpconference.org/icfp2012/registration.html * Early registration deadline: 9th August, 2012 Local arrangements (including travel and accommodation): * http://www.icfpconference.org/icfp2012/local.html See you in Copenhagen, Janis Voigtlaender Haskell 2012 Programme Chair ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] strange hangs with -threaded runtime (now with test case)
Just following up to my problem, I was seeing lots of hangs in various places in my program when it was built with the threaded runtime. I eventually tracked every single hang back to calls to MissingH's System.Cmd.Utils, including pipeFrom, pipeTo, pipeBoth, and pOpen. I was at this point running my program in a loop 1000 times, and it'd hang between 1 and 10 times on average, since these hangs seem to be timing-related. In all cases, when it hung, it had forked a child, and the child was blocked in a futex() call. Each of these functions calls forkProcess, and then does some very simple setup before it calls executeFile -- but as far as I could see, the forked process never ran a single thing before hanging. The solution, for me, was to convert all my code to use System.Process instead of System.Cmd.Utils. It seems that System.Process does all its setup between fork and exec using C code, and so avoids this problem. I think it'd make sense to either add deprecation warnings to System.Cmd.Utils, or to rewrite it to be a wrapper around System.Process. -- see shy jo signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] HDBC nested withTransaction
Hi, are there any plans of implementing nested transactions using withTransaction in HDBC? In mysql exists checkpoints and in postgres explicit subtransactions, Andras Gyomrey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] How to add constraint to .cabal?
Hi, Say I have a package that only appends --constraint=template-haskell==2.7.0.0 --constraint=warp-tls==1.2.1 could I install it. Now I want to release the package, then how could I have these constraint into the .cabal so the user would not get troubled? -- 竹密岂妨流水过 山高哪阻野云飞 And for G+, please use magiclouds#gmail.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell Weekly News: Issue 236
Welcome to issue 236 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of July 8 to 14, 2012. Quotes of the Week * RichardBuckminsterFuller: When I am working on a problem, I never think about beauty. But when I have finished, if the solution is not beautiful, I know that it is wrong. * Taneb: I'm doing the thing that every bored haskeller does one day and rewriting Prelude Top Reddit Stories * Haskell Performance Patterns Domain: johantibell.com, Score: 71, Comments: 34 On Reddit: [1] http://goo.gl/gZkMB Original: [2] http://goo.gl/2rj4t * Code Us Some Roguelike in Haskell! Domain: jamiltron.com, Score: 55, Comments: 19 On Reddit: [3] http://goo.gl/VYOx1 Original: [4] http://goo.gl/OOiSG * I never tested this code before releasing it Confession of a Haskell Hacker Domain: r6.ca, Score: 51, Comments: 48 On Reddit: [5] http://goo.gl/EBfT7 Original: [6] http://goo.gl/9zA0u * Breaking from a loop Domain: haskellforall.com, Score: 37, Comments: 19 On Reddit: [7] http://goo.gl/yqxqg Original: [8] http://goo.gl/NtI8j * The Classy Prelude, an alternate prelude which makes it easier to use conflicting names via typeclasses, and thereby encourages usage of more powerful libraries like text and unordered-containers. Domain: yesodweb.com, Score: 35, Comments: 46 On Reddit: [9] http://goo.gl/cZKM5 Original: [10] http://goo.gl/70d6R * The Long and Epic Journey of LambdaCase Domain: unknownparallel.wordpress.com, Score: 33, Comments: 52 On Reddit: [11] http://goo.gl/EAVXs Original: [12] http://goo.gl/ymkGy * How is this fibonacci-function memoized? Domain: stackoverflow.com, Score: 33, Comments: 1 On Reddit: [13] http://goo.gl/lo3LD Original: [14] http://goo.gl/wwHQb * errors-1.0: Simplified error handling Domain: haskellforall.com, Score: 30, Comments: 31 On Reddit: [15] http://goo.gl/tKzP1 Original: [16] http://goo.gl/O10hN * Influenced by Haskell Domain: griffsgraphs.com, Score: 30, Comments: 29 On Reddit: [17] http://goo.gl/6ptoi Original: [18] http://goo.gl/Nrz7K * Experience Report: Haskell in Computational Biology (Daniels, Gallant, Ramsey)[pdf 7 pp] Domain: eecs.tufts.edu, Score: 30, Comments: 11 On Reddit: [19] http://goo.gl/XsvMK Original: [20] http://goo.gl/TUdnL * == for Float not referentially transparent Domain: haskell.org, Score: 23, Comments: 51 On Reddit: [21] http://goo.gl/6qZ1J Original: [22] http://goo.gl/DR9TE * My second attempt at writing Haskell Domain: self.haskell, Score: 21, Comments: 27 On Reddit: [23] http://goo.gl/i7u3p Original: [24] http://goo.gl/i7u3p * Announcing split-channel « Melding Monads Domain: blog.melding-monads.com, Score: 20, Comments: 16 On Reddit: [25] http://goo.gl/XwHdl Original: [26] http://goo.gl/oh5Ce * Deriving the Y combinator from first principles Domain: wellnowwhat.net, Score: 18, Comments: 12 On Reddit: [27] http://goo.gl/5uxYN Original: [28] http://goo.gl/Q76lk * Announcing WAI 1.3! Domain: yesodweb.com, Score: 18, Comments: 11 On Reddit: [29] http://goo.gl/QD769 Original: [30] http://goo.gl/mQFBK Top StackOverflow Questions * How is this fibonacci-function memoized? votes: 43, answers: 3 Read on SO: [31] http://goo.gl/MGjr3 * What is the combinatory logic equivalent of intuitionistic type theory? votes: 39, answers: 0 Read on SO: [32] http://goo.gl/ki9nT * Does Haskell have return type overloading? votes: 15, answers: 5 Read on SO: [33] http://goo.gl/sBGWj * Is there a way to avoid unnecessary recursion? votes: 12, answers: 2 Read on SO: [34] http://goo.gl/Gk39e * Using vectors for performance improvement in Haskell votes: 12, answers: 2 Read on SO: [35] http://goo.gl/74KOH * Eliminate Haskell array bounds check for Bounded type? votes: 11, answers: 1 Read on SO: [36] http://goo.gl/CHDtJ * Having my cereal and parsing it too votes: 8, answers: 2 Read on SO: [37] http://goo.gl/1SG24 * How does HOpenGL behave with regards to other threads and TChans in Haskell? votes: 8, answers: 2 Read on SO: [38] http://goo.gl/dmoqc * Number of arguments and point-free in Haskell votes: 8, answers: 2 Read on SO: [39] http://goo.gl/8Z0B2 * Haskell: Design pattern: classes or pass functions votes: 7, answers: 3 Read on SO: [40] http://goo.gl/EO7tr * Haskell — sort list with impure function votes: 7, answers: 4 Read on SO: [41] http://goo.gl/o9kbc Until next time, Daniel Santa Cruz References 1. http://johantibell.com/files/haskell-performance-patterns.html#%281%29 2.