Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation
В сообщении от Суббота 12 сентября 2009 18:46:28 автор Xiao-Yong Jin написал: I believe most of the linux distributions do not have `lapack.pc', if you install certain implementation of lapack like the one provided by netlib.org, or the one with `ATLAS', or the one provided by intel mkl. So, using such pkgconfig file is rather useless. A configure system like the one used in `hmatrix' should be used to actually adapt various kinds of systems. It fails to build on Fedora too. I think bindings-levmar package is unbuildable on most linux distributions. If pkgconfig-depends lines is removed from cabal file it builds fine. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation
В сообщении от Понедельник 14 сентября 2009 12:41:29 вы написали: If pkgconfig-depends lines is removed from cabal file it builds fine. But any program which uses levmar fails to link ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation
On Mon, Sep 14, 2009 at 10:50 AM, Khudyakov Alexey alexey.sklad...@gmail.com wrote: В сообщении от Понедельник 14 сентября 2009 12:41:29 вы написали: If pkgconfig-depends lines is removed from cabal file it builds fine. But any program which uses levmar fails to link Would adding extra-libraries: lapack to the cabal file instead of pkgconfig-depends: lapack be a better solution? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Community.haskell.org is down
I assume this is the same as code.haskell.org, which is also down? Yes, code.h.o and community.h.o run on the same virtual machine. a WHOIS gives the Yale University Comp. Sci. Dept. Haskell Group as the registrant, maybe someone over there needs to take a look? Yale looks after the DNS records for the entire haskell.org domain, but currently actively hosts only the www server. For general information, current machines and hosts are: www.h.o hosted by Yale, paid for by GSoC darcs.h.o hosted by Galois, donated by Galois hackage.h.o hosted by Galois, donated by Galois code.h.o virtual hosting,paid for by GSoC community.h.o virtual hosting,paid for by GSoC sparky.h.ohosted by Chalmers, donated by Sun http://community.haskell.org/ seems to be down for me. In general, who should this be reported to? Reporting it to this list is as good a place as any. Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: A Levenberg-Marquardt implementation
2009/9/14 Khudyakov Alexey alexey.sklad...@gmail.com: В сообщении от Понедельник 14 сентября 2009 12:59:24 автор Roel van Dijk написал: Would adding extra-libraries: lapack to the cabal file instead of pkgconfig-depends: lapack be a better solution? Yes. It works this way. Tested in debian and old fedora Thank you for testing. I have just released bindings-levmar-0.1.0.1 on hackage. It simply replaces pkgconfig-depends with extra-libraries. I hope this solves the installation problems. http://hackage.haskell.org/package/bindings-levmar-0.1.0.1 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Plotting parametric functions in Haskell
I did that once a long time ago using GTK2HS; but I don't have that code anymore I think, it was a quick hack anyway. Doing a search for plot on Hackage revealed http://hackage.haskell.org/package/Chart http://hackage.haskell.org/package/gnuplot Maybe that helps. On Mon, Sep 14, 2009 at 4:42 AM, Rafael Cunha de Almeida almeida...@gmail.com wrote: Hello, I think it would be interesting to plot and visualize parametric (and other kind of functions) using the haskell language to define them [functions]. Does anyone know about some software or API that does just that? I started writing a plotter to do that using hopengl. But my computer graphics skills are rather bad and I couldn't produce anything really useful. []'s Rafael ___ 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] ANNOUNCE: A Levenberg-Marquardt implementation
В сообщении от 14 сентября 2009 13:28:33 автор Roel van Dijk написал: Thank you for testing. I have just released bindings-levmar-0.1.0.1 on hackage. It simply replaces pkgconfig-depends with extra-libraries. I hope this solves the installation problems. Yes. Now it installs fine. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Plotting parametric functions in Haskell
On Sun, 13 Sep 2009, Rafael Cunha de Almeida wrote: Hello, I think it would be interesting to plot and visualize parametric (and other kind of functions) using the haskell language to define them [functions]. Does anyone know about some software or API that does just that? I started writing a plotter to do that using hopengl. But my computer graphics skills are rather bad and I couldn't produce anything really useful. Do you mean something like the gnuplot wrapper? http://hackage.haskell.org/package/gnuplot ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: LambdaINet-0.1.0, Graphical Interaction Net Evaluator for Optimal Evaluation
On Mon, Sep 14, 2009 at 7:36 AM, Paul L nine...@gmail.com wrote: It's available on Hackage DB at http://hackage.haskell.org/package/LambdaINet Nice! Screenshots anywhere? Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Plotting parametric functions in Haskell
On Mon, Sep 14, 2009 at 6:37 AM, Peter Verswyvelen bugf...@gmail.com wrote: I did that once a long time ago using GTK2HS; but I don't have that code anymore I think, it was a quick hack anyway. Doing a search for plot on Hackage revealed http://hackage.haskell.org/package/Chart http://hackage.haskell.org/package/gnuplot Maybe that helps. I probably should have mentioned that I really want to plot a 3D function. I've seen those packages before, but I didn't even tried them out. Chart seems to be only for 2D stuff and the reason why I was looking for haskell solutions is because I don't really like gnuplot for 3D plotting. Maybe I'm the one who doesn't get gnuplot's interface, but I find it awful to navigate through a 3D graph using gnuplot. Thanks for the answer, though. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Program with ByteStrings leads to memory exhaust.
I have a simple program that first generates a large (~ 500 mb) file of random numbers and then reads the numbers back to find their sum. It uses Data.Binary and Data.ByteString.Lazy. The problem is when the program tries to read the data back it quickly (really quickly) consumes all memory. The source: http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=3607#a3607 or: module Main where import Data.Binary import Data.Int import System.Random import qualified Data.ByteString.Lazy as BL encodeFileAp f = BL.appendFile f . encode path = Results.data n = 20*1024*1024 :: Int getBlockSize :: BL.ByteString - Int64 getBlockSize bs = round $ (fromIntegral $ BL.length bs) / (fromIntegral n) fillFile :: StdGen - Int - IO () fillFile _ 0 =return () fillFile gen i = do let (x, gen') = random gen :: (Double, StdGen) encodeFileAp path x fillFile gen' (i-1) processFile :: BL.ByteString - Int64 - Int - Double - Double processFile bs blockSize 0 sum = sum processFile bs blockSize i sum = let tmpTuple = BL.splitAt blockSize bs x = decode $ fst $! tmpTuple in processFile (snd tmpTuple) blockSize (i-1) $! sum + x main = do fillFile (mkStdGen 42) n results - BL.readFile path putStrLn $ show $ processFile results (getBlockSize results) n 0 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Program with ByteStrings leads to memory exhaust.
Excerpts from Grigory Sarnitskiy's message of Mon Sep 14 16:05:41 +0200 2009: I have a simple program that first generates a large (~ 500 mb) file of random numbers and then reads the numbers back to find their sum. It uses Data.Binary and Data.ByteString.Lazy. I do think that this is due to splitAt but I didn't made a deep investigation. -- Nicolas Pouillard http://nicolaspouillard.fr ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation
Unless you think that extra-libraries is a good long term solution, I'll still investigate on how to add pkg-config generation to configuration scripts and try to send a sugestion with a patch to maintainers of libraries wrapped in bindings-*. It is not practical to use pkg-config for such libraries. After you persuade the reference code[1] of lapack to use pkg-config, are you going to make ATLAS[2] do it also? And what about Intel's mkl[3]? Or even lapack bindings provided by Nvidia's CUDA[4]? Sure. But only for packages we have direct Haskell bindings to. You only need pkg-config available for the libraries you directly need for a cabal package. For complicated dependencies, just rely on your OS distribution (or Haskell Platform etc.). I know it's hard to include every possibilities. But I prefer some configuration switch that I can tune when building the library. The idea is just to provide a default, working configuration. Anyway, I imagine this tunning should be done in a way that is transparent to a cabal package. That's been said, it is still your package. And people can always change the build scripts for their own needs. Not actually! I didn't work on bindings-levmar. I'm just the guy who started the idea of having low level bindings packages as basis for higher level bindings (so that this kind of problem can be solved at the same time for many, say, levmar high level bindings). That's why I would like to help acchieving good general guides for easy building. Wrapping of levmar is entirely van Dijk brothers' work. http://hackage.haskell.org/package/bindings-common Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation
Maurício CA mauricio.antu...@gmail.com writes: Yes. It works this way. Tested in debian and old fedora Thank you for testing. I have just released bindings-levmar-0.1.0.1 on hackage. It simply replaces pkgconfig-depends with extra-libraries. I hope this solves the installation problems. Debian maintainer was willing to add pkg-config to lapack package: http://lists.alioth.debian.org/pipermail/pkg-scicomp-devel/2009-September/004508.html However, he and also Tollef (pkg-config maintainer) believe it's a better idea to add it to upstream package: http://article.gmane.org/gmane.comp.package-management.pkg-config/346 Unless you think that extra-libraries is a good long term solution, I'll still investigate on how to add pkg-config generation to configuration scripts and try to send a sugestion with a patch to maintainers of libraries wrapped in bindings-*. Although I don't know exactly how that patch should exactly be... It is not practical to use pkg-config for such libraries. After you persuade the reference code[1] of lapack to use pkg-config, are you going to make ATLAS[2] do it also? And what about Intel's mkl[3]? Or even lapack bindings provided by Nvidia's CUDA[4]? [1] http://www.netlib.org/lapack/ [2] http://math-atlas.sourceforge.net/ [3] http://software.intel.com/en-us/intel-mkl/ [4] http://www.nvidia.com/object/cuda_home.html One can install them side by side, but for performance's sake, one really wants to link a particular library/binary to the most useful one. I know it's hard to include every possibilities. But I prefer some configuration switch that I can tune when building the library. That's been said, it is still your package. And people can always change the build scripts for their own needs. Best, Xiao-Yong -- c/*__o/* \ * (__ */\ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation
Yes. It works this way. Tested in debian and old fedora Thank you for testing. I have just released bindings-levmar-0.1.0.1 on hackage. It simply replaces pkgconfig-depends with extra-libraries. I hope this solves the installation problems. Debian maintainer was willing to add pkg-config to lapack package: http://lists.alioth.debian.org/pipermail/pkg-scicomp-devel/2009-September/004508.html However, he and also Tollef (pkg-config maintainer) believe it's a better idea to add it to upstream package: http://article.gmane.org/gmane.comp.package-management.pkg-config/346 Unless you think that extra-libraries is a good long term solution, I'll still investigate on how to add pkg-config generation to configuration scripts and try to send a sugestion with a patch to maintainers of libraries wrapped in bindings-*. Although I don't know exactly how that patch should exactly be... Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Building a monoid, continuation-passing style
Hello cafe, Inspired by Sean Leather's xformat package [1] I built a datatype with which you can build a monoid with holes, yielding a function type to fill in these holes, continuation-passing style. Here are some primitives and their types: now :: m - ContSt m r r later :: (a - m) - ContSt m r (a - r) run :: ContSt m m r - r instance Monoid m = Category (ContSt m) Here's an example of how to use it: run (now hello . now world) helloworld run (later id . now world) hello helloworld run (later id . later show) hello 567 hello567 The source code is available at [2]. I have a couple of questions: * ContSt is a Category. Is it also an Arrow? Why (not)? * Did I miss any other obvious classes this type is an instance of? * What is its relation with the Cont and Reader monads? * Are there any other useful applications other than printf-like functionality? * ContSt is a horrible name. What is a better one? For those who have a bit more time: I appreciate any comments and suggestions on the code. :-) Many thanks in advance, Martijn. [1] http://hackage.haskell.org/package/xformat [2] http://code.google.com/p/monoid-cont/source/browse/trunk/ContSt.hs ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Solved: [Was: Re: [Haskell-cafe] Program with ByteStrings leads to memory exhaust]
sargrigory: I have a simple program that first generates a large (~ 500 mb) file of random numbers and then reads the numbers back to find their sum. It uses Data.Binary and Data.ByteString.Lazy. The problem is when the program tries to read the data back it quickly (really quickly) consumes all memory. The source: http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=3607#a3607 I have tweaked this program a few ways for you. The big mistake (and why it runs out of space) is that you take ByteString.Lazy.length to compute the block size. This forces the entire file into memory -- so no benefits of lazy IO. As a separate matter, calling 'appendFile . encode' incrementally for each element will be very slow. Much faster to encode an entire list in one go. Finally, using System.Random.Mersenne is significantly faster at Double generation that System.Random. With these changes (below), your program runs in constant space (both writing out and reading in the 0.5Gb file), and is much faster: {-# LANGUAGE BangPatterns #-} import Data.Binary.Put import Data.Binary import System.IO import Data.Int import qualified Data.ByteString.Lazy as BL import System.Random.Mersenne path = Results.data n= 20*1024*1024 :: Int -- getBlockSize :: BL.ByteString - Int64 -- getBlockSize bs = round $ (fromIntegral $ BL.length bs) / (fromIntegral n) -- -- ^ why do you take the length!? -- -- there's no point doing lazy IO then. -- Custom serialization (no length prefix) fillFile n = do g - newMTGen (Just 42) rs - randoms g :: IO [Double] BL.writeFile path $ runPut $ mapM_ put (take n rs) -- fillFile :: MTGen - Int - IO () -- fillFile _ 0 = return () -- fillFile g i = do -- x - random g :: IO Double -- encodeFileAp path x -- fillFile g (i-1) processFile :: BL.ByteString - Int64 - Int - Double - Double processFile !bs !blockSize 0 !sum = sum processFile bs blockSize i sum = processFile y blockSize (i-1) (sum + decode x) where (x,y) = BL.splitAt blockSize bs main = do fillFile n -- compute the size without loading the file into memory h - openFile path ReadMode sz - hFileSize h hClose h results - BL.readFile path let blockSize = round $ fromIntegral sz / fromIntegral n print $ processFile results blockSize n 0 Running this : $ ./A +RTS -sstderr 1.0483476019172292e7 226,256,100,448 bytes allocated in the heap 220,413,096 bytes copied during GC 65,416 bytes maximum residency (1186 sample(s)) 136,376 bytes maximum slop 2 MB total memory in use (0 MB lost due to fragmentation) ^ It now runs in constant space. Generation 0: 428701 collections, 0 parallel, 3.17s, 3.49s elapsed Generation 1: 1186 collections, 0 parallel, 0.13s, 0.16s elapsed INIT time0.00s ( 0.00s elapsed) MUT time 118.26s (129.19s elapsed) GCtime3.30s ( 3.64s elapsed) EXIT time0.00s ( 0.00s elapsed) Total time 121.57s (132.83s elapsed) %GC time 2.7% (2.7% elapsed) Does very little GC. Alloc rate1,913,172,101 bytes per MUT second Productivity 97.3% of total user, 89.0% of total elapsed -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Solved: [Was: Re: [Haskell-cafe] Program with ByteStrings leads to memory exhaust]
I have tweaked this program a few ways for you. The big mistake (and why it runs out of space) is that you take ByteString.Lazy.length to compute the block size. This forces the entire file into memory -- so no benefits of lazy IO. As a separate matter, calling 'appendFile . encode' incrementally for each element will be very slow. Much faster to encode an entire list in one go. Finally, using System.Random.Mersenne is significantly faster at Double generation that System.Random. Thank you! Just excellent! // I'm so happy :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] why these two are not equivalent?
On Sun, Sep 13, 2009 at 09:57:50PM -0700, Iavor Diatchki wrote: (argh, sorry about that, I pressed something and gmail sent my unfinished email!) On Sun, Sep 13, 2009 at 9:54 PM, Iavor Diatchki iavor.diatc...@gmail.com wrote: Hi, It seems that the problem is the site is using GHC 6.6.1, and something was broken at the time (I have not looked into what that is). Here are the outputs that I get for the little example on the site that you posted: GHC 6.10.3 and C++: 03 10103538 1233 6160 0141 1 03 10103538 1233 6160 0142 1 30 10103538 1233 6160 0141 2 30 10103538 1233 6160 0142 2 30 10103538 1233 6160 0142 1 30 10103538 1233 6160 0143 1 30 10103538 1233 6160 0144 1 30 10103538 1233 6160 0145 1 30 10103538 1233 6160 0146 1 With GHC 6.6.1: 03 10103538 1233 6160 0141 1 03 10103538 1233 6160 0142 1 30 10103538 1233 6160 0141 2 30 10103538 1233 6160 0142 2 30 10103538 1233 6160 0142 1 30 10103538 1233 6160 0143 1 30 10103538 1233 6160 0145 1 30 10103538 1233 6160 0146 1 Note that in the second test case one line is missing, the one ending in 44. -Iavor Hi Iavor, Sweet, it makes a lot of sense. I haven't tried to run this with ghc-6.6.1, though. Thank you for doing this. Just for curiosity I'll try to find out what exactly fails under 6.6.1, just in case anyone else run into the problem in future (as I don't think they will upgrade the ghc any time soon). I'll eventually ask them to upgrade the ghc version. Any recommendation about which version should I ask for? Thanks, -- ~dsouza yahoo!im: paravinicius gpg key fingerprint: 71B8 CE21 3A6E F894 5B1B 9ECE F88E 067F E891 651E ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: hssqlppp, sql parser and type checker, pre-alpha
Hello all, I've started on a SQL parser and type checker, which I'm currently planning on evolving into a lint-type program for PL/pgSQL, called HsSqlPpp. It currently parses a subset of PostGreSQL SQL and PL/pgSQL, can type check some select, insert, update, delete and create statements, and is pretty rough all round at the moment. It uses Parsec and UUAGC, comes with a small HUnit test suite, and has a Cabal file. The code is on Launchpad here: https://launchpad.net/hssqlppp You can get a snapshot here: http://launchpad.net/hssqlppp/prealpha/secondtypechecking/+download/hssqlppp-140909-rev276.zip More information in the readme: http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/README and brief the usage guide gives you an idea of what you can do with it right now: http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/usage I'm pretty new to Haskell, parsing, attribute grammars and type checking - any comments, advice, criticism welcome. Thanks, Jake Wheat ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hssqlppp, sql parser and type checker, pre-alpha
jakewheatmail: Hello all, I've started on a SQL parser and type checker, which I'm currently planning on evolving into a lint-type program for PL/pgSQL, called HsSqlPpp. It currently parses a subset of PostGreSQL SQL and PL/pgSQL, can type check some select, insert, update, delete and create statements, and is pretty rough all round at the moment. It uses Parsec and UUAGC, comes with a small HUnit test suite, and has a Cabal file. The code is on Launchpad here: https://launchpad.net/hssqlppp You can get a snapshot here: http://launchpad.net/hssqlppp/prealpha/secondtypechecking/+download/hssqlppp-140909-rev276.zip More information in the readme: http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/README and brief the usage guide gives you an idea of what you can do with it right now: http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/usage I'm pretty new to Haskell, parsing, attribute grammars and type checking - any comments, advice, criticism welcome. Will you be releasing it on Hackage? Bonus: if you do, it can be cabal-installed :) -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hssqlppp, sql parser and type checker, pre-alpha
Second the hackage suggestion. `cabal unpack [package name]` is a really nice way to grab sources. On Mon, Sep 14, 2009 at 1:59 PM, Don Stewart d...@galois.com wrote: jakewheatmail: Hello all, I've started on a SQL parser and type checker, which I'm currently planning on evolving into a lint-type program for PL/pgSQL, called HsSqlPpp. It currently parses a subset of PostGreSQL SQL and PL/pgSQL, can type check some select, insert, update, delete and create statements, and is pretty rough all round at the moment. It uses Parsec and UUAGC, comes with a small HUnit test suite, and has a Cabal file. The code is on Launchpad here: https://launchpad.net/hssqlppp You can get a snapshot here: http://launchpad.net/hssqlppp/prealpha/secondtypechecking/+download/hssqlppp-140909-rev276.zip More information in the readme: http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/READMEhttp://bazaar.launchpad.net/%7Ejakewheat/hssqlppp/trunk/annotate/head%3A/README and brief the usage guide gives you an idea of what you can do with it right now: http://bazaar.launchpad.net/~jakewheat/hssqlppp/trunk/annotate/head%3A/usagehttp://bazaar.launchpad.net/%7Ejakewheat/hssqlppp/trunk/annotate/head%3A/usage I'm pretty new to Haskell, parsing, attribute grammars and type checking - any comments, advice, criticism welcome. Will you be releasing it on Hackage? Bonus: if you do, it can be cabal-installed :) -- Don ___ 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 on Windows 7
On Thu, 2009-09-10 at 15:18 +0200, Regis Saint-Paul wrote: One way in which cabal can be made UAC aware (and therefore request for elevation privileges instead of just failing) would be to embed a manifest in the cabal.exe. This can be done by changing the default manifest (an XML file) that is embedded at link time by GHC. However, a problem with this approach is that cabal.exe as a whole would be seen as needing administrator privilege, regardless of whether the setting is global or user. If we want to request admin privileges only when actually needed (i.e., when writing in a protected folder). To address this, there are several options: - have two distinct executables for cabal, cabal-global and cabal-user with different manifest - use windows API for requesting elevation during the process (ugly) If it really has to be done, then this seems like the best approach. In principle there's no problem with calling funky win32 functions in Cabal, it's mostly a matter of working out what bahaviour we want and what UAC lets us do. Also, the AppData folder is for application data, not for the application itself. I'm not sure how far one needs to go in terms of well-behaving for windows when it comes to multi-platform applications. I'd like to point out the Application Compatibility Toolkit which allows testing if an application is well behaved for vista and 7 and provides guidelines for that (it's a free download): You can use also on XP to test for vista and 7. I tried running it with cabal install somepackage and it points out a number of privilege errors. Thanks for that. Note that if cabal was writing packages in AppData instead of program files, then the problem would only surface when cabal install moves executable in the bin directory. It seems to me that the cygwin/mingw and, more generally, the GNU way of dealing with windows is to mainly ignore the directory structure of windows and install things in a separate directory chosen by the user (possibly in program files or elsewhere), requesting the user to manually change the path accordingly. That could be a solution to consider too. Our aim is really to do things the proper way on each platform. We follow FSH/autoconf conventions on Unix and we aim to do the right thing on Windows and OSX. The main issue is that there's not many of us who are familiar with what the right thing is on the other platforms. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Can't install chp (confused by cabal yet again)
You got the original error because cabal chose to use base-3 when compiling chp, and then identifiers found only in base-4 were referenced. Download the cabal package, and edit chp.cabal so that it depends on base = 4. On Sat, Jun 6, 2009 at 7:00 AM, Colin Paul Adams co...@colina.demon.co.ukwrote: I tried a cabal install chp: It complained that base was hidden. So I unpacked the archive, and tried installing using runhaskell Setup configure/build/install. Now I get (from install): Setup: You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.6.0.3, now Cabal-1.6.0.2). So I repeated the process and get the same message again. ghc version is 6.10.3 Also: cabal --version cabal-install version 0.6.2 using version 1.6.0.2 of the Cabal library Where does this 1-6.0.3 come from (Ghc HEAD perhaps?)? What can I do about it? -- Colin Adams Preston Lancashire ___ 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] Coercion from a Word32/64 to a Float/Double
Hi, I'd like to know if this should work: -- GHC coercion getFloat :: BHeader - Get Float getFloat h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord32le BigEndian - fmap (coerce . fromIntegral) getWord32be where coerce (I32# x) = F# (unsafeCoerce# x) -- GHC coercion getDouble :: BHeader - Get Double getDouble h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord64le BigEndian - fmap (coerce . fromIntegral) getWord64be where coerce (I64# x) = D# (unsafeCoerce# x) Loading this into ghci compiles fine (but I haven't try to parse data), but compiling with ghc (6.10.1 or 6.10.4) reports: /tmp/ghc1967_0/ghc1967_0.s: Assembler messages: /tmp/ghc1967_0/ghc1967_0.s:287:0: Error: bad register name `%fake0' /tmp/ghc1967_0/ghc1967_0.s:349:0: Error: bad register name `%fake0' Thanks for any help, Thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: ANNOUNCE: A Levenberg-Marquardt implementation
Maurício CA mauricio.antu...@gmail.com writes: That's been said, it is still your package. And people can always change the build scripts for their own needs. Not actually! I didn't work on bindings-levmar. I'm just the guy who started the idea of having low level bindings packages as basis for higher level bindings (so that this kind of problem can be solved at the same time for many, say, levmar high level bindings). That's why I would like to help acchieving good general guides for easy building. Wrapping of levmar is entirely van Dijk brothers' work. Sorry, I didn't mean that. I was just trying to say that it might be wiser to put in a configure script like most of the open source software do. It does not need to be very complicated, because usually people know what they are doing when they want to link against different optimized libraries. The one[1] provided by hmatrix[2] is sufficient and easy to use for most of the purposes. [1] http://perception.inf.um.es/cgi-bin/darcsweb.cgi?r=hmatrix;a=headblob;f=/configure.hs [2] http://www.hmatrix.googlepages.com/ In the case of hmatrix, it is good that you only need to run $ cabal install hmatrix -fmkl to build it against Intel mkl instead of the default BLAS/LAPACK. And you can also add other shared libraries to link against as a command line switch when you run `cabal install'. I just don't see the problem with bindings-levmar. Because compared with bindings-levmar, hmatrix actually needs GSL, BLAS and LAPACK, but it builds fine on hackage and the documents[3] are very well built. [3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hmatrix Just my 2 cents. Xiao-Yong -- c/*__o/* \ * (__ */\ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Coercion from a Word32/64 to a Float/Double
If you don't mind a small performance penalty, have you considered using my library data-binary-ieee754? It contains functions for parsing floats and doubles within the Get monad. On Mon, Sep 14, 2009 at 12:24, minh thu not...@gmail.com wrote: Hi, I'd like to know if this should work: -- GHC coercion getFloat :: BHeader - Get Float getFloat h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord32le BigEndian - fmap (coerce . fromIntegral) getWord32be where coerce (I32# x) = F# (unsafeCoerce# x) -- GHC coercion getDouble :: BHeader - Get Double getDouble h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord64le BigEndian - fmap (coerce . fromIntegral) getWord64be where coerce (I64# x) = D# (unsafeCoerce# x) Loading this into ghci compiles fine (but I haven't try to parse data), but compiling with ghc (6.10.1 or 6.10.4) reports: /tmp/ghc1967_0/ghc1967_0.s: Assembler messages: /tmp/ghc1967_0/ghc1967_0.s:287:0: Error: bad register name `%fake0' /tmp/ghc1967_0/ghc1967_0.s:349:0: Error: bad register name `%fake0' Thanks for any help, Thu ___ 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] Haskell#? F#?
caseyh: The other morning, someone was telling me they had converted most of their VB financial/stock market code to F#. Whereas VB only used one core, the F# code used all four cores. In one software developers meeting, someone was saying that since database work is mostly all state, he didn't see the advantage of a functional programming language. State /= Imperative Programming :-) -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Coercion from a Word32/64 to a Float/Double
Hi, Yes I did but since I saw that 'solution', I wanted to try it. There is something that bothers me with your library: its licence. Reading a float shouldn't force me to go GPL (I makes an utility to read Blender files and like to make it BSD3). Thanks for pointing it though. Cheers, Thu 2009/9/14 John Millikin jmilli...@gmail.com: If you don't mind a small performance penalty, have you considered using my library data-binary-ieee754? It contains functions for parsing floats and doubles within the Get monad. On Mon, Sep 14, 2009 at 12:24, minh thu not...@gmail.com wrote: Hi, I'd like to know if this should work: -- GHC coercion getFloat :: BHeader - Get Float getFloat h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord32le BigEndian - fmap (coerce . fromIntegral) getWord32be where coerce (I32# x) = F# (unsafeCoerce# x) -- GHC coercion getDouble :: BHeader - Get Double getDouble h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord64le BigEndian - fmap (coerce . fromIntegral) getWord64be where coerce (I64# x) = D# (unsafeCoerce# x) Loading this into ghci compiles fine (but I haven't try to parse data), but compiling with ghc (6.10.1 or 6.10.4) reports: /tmp/ghc1967_0/ghc1967_0.s: Assembler messages: /tmp/ghc1967_0/ghc1967_0.s:287:0: Error: bad register name `%fake0' /tmp/ghc1967_0/ghc1967_0.s:349:0: Error: bad register name `%fake0' Thanks for any help, Thu ___ 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] Native windowing for glut applications on OS X.
I just upgraded ghc to 6.10.4 and the problem seems to have fixed itself :) On Tue, Sep 8, 2009 at 11:34 AM, Lyndon Maydwell maydw...@gmail.com wrote: I just realized that I only replied to Brandon. Sorry about that :) -- Forwarded message -- From: Lyndon Maydwell maydw...@gmail.com Date: Sat, Sep 5, 2009 at 4:22 PM Subject: Re: [Haskell-cafe] Native windowing for glut applications on OS X. To: Brandon S. Allbery KF8NH allb...@ece.cmu.edu I installed opengl via macports. Can I adjust my path somehow so that it prefers the native libraries? On Sat, Sep 5, 2009 at 8:57 AM, Brandon S. Allbery KF8NHallb...@ece.cmu.edu wrote: On Sep 4, 2009, at 03:13 , Lyndon Maydwell wrote: I recently updated glut through cabal to version GLUT-2.2.1.0, and where once I had native windowing, now I can only seem to use X11. Does anyone know how to use native windowing? Do you use Fink or MacPorts? Check for OpenGL libraries installed via those; they're probably shadowing the native libraries. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Coercion from a Word32/64 to a Float/Double
On Mon, Sep 14, 2009 at 12:24 PM, minh thu not...@gmail.com wrote: Hi, I'd like to know if this should work: -- GHC coercion getFloat :: BHeader - Get Float getFloat h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord32le BigEndian - fmap (coerce . fromIntegral) getWord32be where coerce (I32# x) = F# (unsafeCoerce# x) -- GHC coercion getDouble :: BHeader - Get Double getDouble h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord64le BigEndian - fmap (coerce . fromIntegral) getWord64be where coerce (I64# x) = D# (unsafeCoerce# x) Loading this into ghci compiles fine (but I haven't try to parse data), but compiling with ghc (6.10.1 or 6.10.4) reports: /tmp/ghc1967_0/ghc1967_0.s: Assembler messages: /tmp/ghc1967_0/ghc1967_0.s:287:0: Error: bad register name `%fake0' /tmp/ghc1967_0/ghc1967_0.s:349:0: Error: bad register name `%fake0' I think that a more reliable (though not very pretty) way to do the casts is via pointer manipulation. Code like the following has worked for me in the past: getDouble :: Get Double getDouble = fmap word2Double getWord64le where word2Double w = unsafePerformIO $ with w $ \p - do d :: CDouble - peek (castPr p) return (realToFrac d :: Double) Best, -Judah ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Coercion from a Word32/64 to a Float/Double
2009/9/14 Judah Jacobson judah.jacob...@gmail.com: On Mon, Sep 14, 2009 at 12:24 PM, minh thu not...@gmail.com wrote: Hi, I'd like to know if this should work: -- GHC coercion getFloat :: BHeader - Get Float getFloat h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord32le BigEndian - fmap (coerce . fromIntegral) getWord32be where coerce (I32# x) = F# (unsafeCoerce# x) -- GHC coercion getDouble :: BHeader - Get Double getDouble h = case endianness h of LittleEndian - fmap (coerce . fromIntegral) getWord64le BigEndian - fmap (coerce . fromIntegral) getWord64be where coerce (I64# x) = D# (unsafeCoerce# x) Loading this into ghci compiles fine (but I haven't try to parse data), but compiling with ghc (6.10.1 or 6.10.4) reports: /tmp/ghc1967_0/ghc1967_0.s: Assembler messages: /tmp/ghc1967_0/ghc1967_0.s:287:0: Error: bad register name `%fake0' /tmp/ghc1967_0/ghc1967_0.s:349:0: Error: bad register name `%fake0' I think that a more reliable (though not very pretty) way to do the casts is via pointer manipulation. Code like the following has worked for me in the past: getDouble :: Get Double getDouble = fmap word2Double getWord64le where word2Double w = unsafePerformIO $ with w $ \p - do d :: CDouble - peek (castPr p) return (realToFrac d :: Double) Best, -Judah Thank you, it compiles fine. Thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: hssqlppp, sql parser and type checker, pre-alpha
I've uploaded the code to Hackage, you can install it with: cabal install hssqlppp or you can get the source using cabal unpack hssqlppp 2009/9/14 John Van Enk vane...@gmail.com: Second the hackage suggestion. `cabal unpack [package name]` is a really nice way to grab sources. On Mon, Sep 14, 2009 at 1:59 PM, Don Stewart d...@galois.com wrote: Will you be releasing it on Hackage? Bonus: if you do, it can be cabal-installed :) -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell#? F#?
В сообщении от Вторник 15 сентября 2009 00:15:10 автор Don Stewart написал: State /= Imperative Programming Yup, it's anarchy at times... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] algebra/grammar/language for expressing time intervals
Hello, I need some cron-like functionality for long running daemon written in Haskell. I want to be able to schedule an event to be run: 1. once, at a specific time 2. some regularly scheduled time I don't see an existing library to do this, so I am starting work on my own. The first issue I am looking at is how to specify time intervals. The primary example I have looked at is cron. Cron is pretty good, but I don't see a way to do something like, run a job every other Wednesday. I also want to be able to display the interval schedule to the user, allow them to modify it, and also save the schedule to disk and reload it. So this essentially means that the type for describing the intervals can not contain any functions. Does anyone know of a good language for describing intervals? I want to be able to express things like: - run every other wednesday - run at 15 minutes past the hour - run at 15 minutes past the hour every wednesday - run at 15 and 25 minutes past the hour between the hours of 2 and 6 AM. - run every weekday at 8AM unless it is a holiday (the list of holidays would be supplied). Basically, everything you can express with cron, and a bit more. Is there any existing languages/grammars/algebras for this that I should look at? thanks! - jeremy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Can't install chp (confused by cabal yet again)
On Mon, 2009-09-14 at 12:05 -0700, Michael Steele wrote: You got the original error because cabal chose to use base-3 when compiling chp, and then identifiers found only in base-4 were referenced. Download the cabal package, and edit chp.cabal so that it depends on base = 4. Or as another workaround use: $ cabal install chp --preference=base = 4 Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] trouble compiling Crypto-4.2.0 / trouble with cabal
On Sun, 2009-09-13 at 19:54 +0200, mf-hcafe-15c311...@etc-network.de wrote: Hi, Cabal is still fighting me all the time. Its latest move is to be oblivious of some of the installed packages: For future reference: http://haskell.org/cabal/FAQ.html#runghc-setup-complains-of-missing-packages The simple solution is don't mix cabal and runghc Setup.hs, stick to cabal. Remember that cabal subsumes the command line interface provided by runghc Setup.hs. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Announce: EnumMap-0.0.1
On Wed, Aug 12, 2009 at 01:03:55PM -0400, John Van Enk wrote: EnumMap silently passes this responsibility to the user, without even a note in the documentation. Like I've said, I made no modifications to the documentation other than replacing IntMap with EnumMap. Should the community show more interest in the EnumMap, such a change will show up in the docs. I'm showing interest in EnumMap :). I have some IntMap's that provide no type safety about what is inserted and EnumMap solves that problem as nicely as possible. Right now I don't really care about the doumentation problems, but I would like to see the SPECIALIZE and INLINE improvements, when will there be a new version? Thanks a lot! -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: LambdaINet-0.1.0, Graphical Interaction Net Evaluator for Optimal Evaluation
I just bumped the version to 0.1.1 that fixes an embarrassing bug, i.e., the first example shown on the screen was actually wrong. I took a screenshot of the interaction net showing (church 2) f x, i.e., (\f x - f (f x)) f x together with on-screen help messages. It is the first example right after you start the LambdaINet application, and erase redundant nodes, relayout, and auto zoom (key sequence E, L, Space). It will reduce to f (f x) if you hit R key, or if you want to see the step by step outermost reduction, just keep hitting O key. The picture is here http://www.thev.net/download/church_2_f_x-with-helpmsg.jpg Pressing 1 to 9 will show a more complicated example that actually demonstrates the power of optimal evaluation: opt n = (church n) (church 2) i i. Standard call-by-need takes 37 beta reductions to evaluate opt 4, but optimal only needs 15. On 9/14/09, Bas van Dijk v.dijk@gmail.com wrote: On Mon, Sep 14, 2009 at 7:36 AM, Paul L nine...@gmail.com wrote: It's available on Hackage DB at http://hackage.haskell.org/package/LambdaINet Nice! Screenshots anywhere? Bas -- Regards, Paul Liu Yale Haskell Group http://www.haskell.org/yale ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Announce: EnumMap-0.0.1
I'll hunt down those changes and push something new to hackage. :) On Mon, Sep 14, 2009 at 12:27 PM, Felipe Lessa felipe.le...@gmail.comwrote: On Wed, Aug 12, 2009 at 01:03:55PM -0400, John Van Enk wrote: EnumMap silently passes this responsibility to the user, without even a note in the documentation. Like I've said, I made no modifications to the documentation other than replacing IntMap with EnumMap. Should the community show more interest in the EnumMap, such a change will show up in the docs. I'm showing interest in EnumMap :). I have some IntMap's that provide no type safety about what is inserted and EnumMap solves that problem as nicely as possible. Right now I don't really care about the doumentation problems, but I would like to see the SPECIALIZE and INLINE improvements, when will there be a new version? Thanks a lot! -- Felipe. ___ 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] Announce: EnumMap-0.0.1
http://hackage.haskell.org/package/EnumMap Changes pushed. Job Vranish added the SPECIALIZE pragmas, and I believe he has more data concerning how much this helps. Note, the git repo is here: http://github.com/sw17ch/EnumMap /jve On Mon, Sep 14, 2009 at 12:27 PM, Felipe Lessa felipe.le...@gmail.comwrote: On Wed, Aug 12, 2009 at 01:03:55PM -0400, John Van Enk wrote: EnumMap silently passes this responsibility to the user, without even a note in the documentation. Like I've said, I made no modifications to the documentation other than replacing IntMap with EnumMap. Should the community show more interest in the EnumMap, such a change will show up in the docs. I'm showing interest in EnumMap :). I have some IntMap's that provide no type safety about what is inserted and EnumMap solves that problem as nicely as possible. Right now I don't really care about the doumentation problems, but I would like to see the SPECIALIZE and INLINE improvements, when will there be a new version? Thanks a lot! -- Felipe. ___ 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