Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Neil Mitchell
Hi Erik, I'll release Hoogle 4.1.3 with a fix later today. Thanks, Neil On Sun, Jan 9, 2011 at 5:07 AM, Erik de Castro Lopo mle...@mega-nerd.com wrote: Hi all, I'm testing out hoogle 4.1.2 on Debian Linux and getting the following when trying to update the local hoogle databases:    erik

Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Neil Mitchell
Hi Erik, Hoogle 4.1.3 is now released, which reads and writes Hoogle input files in UTF8 throughout. Please let me know if this doesn't fix your problem. Thanks, Neil On Sun, Jan 9, 2011 at 11:22 AM, Neil Mitchell ndmitch...@gmail.com wrote: Hi Erik, I'll release Hoogle 4.1.3 with a fix

Re: [Haskell-cafe] Set monad

2011-01-09 Thread Andrea Vezzosi
On Sun, Jan 9, 2011 at 7:45 AM, Sebastian Fischer fisc...@nii.ac.jp wrote: [...] Only conversion to the underlying Set type requires an Ord constraint.     getSet :: Ord a = Set a - S.Set a     getSet a = a - S.singleton this unfortunately also means that duplicated elements only get filtered

Re: [Haskell-cafe] Set monad

2011-01-09 Thread Lennart Augustsson
That looks like it looses the efficiency of the underlying representation. On Sun, Jan 9, 2011 at 6:45 AM, Sebastian Fischer fisc...@nii.ac.jp wrote: On Sun, Jan 9, 2011 at 6:53 AM, Lennart Augustsson lenn...@augustsson.net wrote: It so happens that you can make a set data type that is a

[Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
Hi, I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am looking for good examples of usage. Many thanks in advance, Aaron ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] ANNOUNCE: Monad.Reader Issue 17

2011-01-09 Thread Brent Yorgey
I am pleased to announce that Issue 17 of The Monad.Reader is now available [1]. Issue 17 consists of the following three articles: * List Leads Off with the Letter Lambda by Douglas M. Auclair * The InterleaveT Abstraction: Alternative with Flexible Ordering by Neil Brown * The Reader

Re: [Haskell-cafe] [Haskell-beginners] theStdGen unsafePerformIO

2011-01-09 Thread Antoine Latter
You might get more answers to this sort of question on the haskell-cafe list. Even there, I think you might need to ask whoever the authors were for a question like this :-) On Sun, Jan 9, 2011 at 9:55 AM, John Smith volderm...@hotmail.com wrote: Why does theStdGen require unsafePerformIO? I

Re: [Haskell-cafe] ANN: nanoparsec 0.1

2011-01-09 Thread Magnus Therning
On 09/01/11 00:46, Maciej Piechotka wrote: Nanoparsec is currently simply a port of attoparsec on the ListLike (the abstraction of lists used by iteratee). It allows to achive in parsing a near-attoparsec levels of speed (benchmarks from attoparsec library shown a 0.450 ± 0.028 for

Re: [Haskell-cafe] web-routes and forms

2011-01-09 Thread Jeremy Shaw
Hello, newRule also needs to have the type, RoutedNomicServer. The transformation of RoutedNomicServer into NomicServer is done in the handleSite function. Something like this: nomicSpec :: ServerHandle - Site Route (ServerPartT IO Response) nomicSpec sh = Site { handleSite = \f

Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Erik de Castro Lopo
Neil Mitchell wrote: Hoogle 4.1.3 is now released, which reads and writes Hoogle input files in UTF8 throughout. Please let me know if this doesn't fix your problem. Thanks Neil for the quick response. That definitely has fixed thet problem. The next problem is that hoogle installed as a

Re: [Haskell-cafe] web-routes and forms

2011-01-09 Thread Corentin Dupont
Hello, after installing digestive-functors-blaze with: cabal install digestive-functors-blaze My prog doesn't compiles anymore: Warning: This package indirectly depends on multiple versions of the same package. This is highly likely to cause a compile failure. Followed by an error on

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Henning Thielemann
On Sun, 9 Jan 2011, Aaron Gray wrote: I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am looking for good examples of usage. What do you intend to do with them? The package storablevector uses a lot of Ptr, peek, and poke. Maybe this is of some

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Henk-Jan van Tuyl
On Sun, 09 Jan 2011 14:48:09 +0100, Aaron Gray aaronngray.li...@gmail.com wrote: Hi, I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am looking for good examples of usage. Many thanks in advance, Aaron You can lookup, which packages use these, by

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
On 9 January 2011 22:34, Henk-Jan van Tuyl hjgt...@chello.nl wrote: On Sun, 09 Jan 2011 14:48:09 +0100, Aaron Gray aaronngray.li...@gmail.com wrote: Hi, I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am looking for good examples of usage. Many

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
On 9 January 2011 21:30, Henning Thielemann lemm...@henning-thielemann.dewrote: On Sun, 9 Jan 2011, Aaron Gray wrote: I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am looking for good examples of usage. What do you intend to do with them? An

[Haskell-cafe] How to write such a code elegantly ?

2011-01-09 Thread z_axis
betterStdGen :: IO StdGen betterStdGen = alloca $ \p - do h - openBinaryFile /dev/urandom ReadMode hGetBuf h p $ sizeOf (undefined :: Int) hClose h mkStdGen $ peek p picoSec :: IO Integer picoSec = do t - ctPicosec `liftM` (getClockTime = toCalendarTime) return t The

Re: [Haskell-cafe] How to write such a code elegantly ?

2011-01-09 Thread Ivan Lazar Miljenovic
On 10 January 2011 10:44, z_axis z_a...@163.com wrote: betterStdGen :: IO StdGen betterStdGen = alloca $ \p - do   h - openBinaryFile /dev/urandom ReadMode   hGetBuf h p $ sizeOf (undefined :: Int)   hClose h   mkStdGen $ peek p Maybe use a catch or something here and have it return IO

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Antoine Latter
On Sun, Jan 9, 2011 at 6:05 PM, Aaron Gray aaronngray.li...@gmail.com wrote: On 9 January 2011 21:30, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sun, 9 Jan 2011, Aaron Gray wrote: I am trying to work out how to use GHC.Ptr, Foreign.Storable, Data.Storable.Endian, and am

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
On 10 January 2011 01:08, Antoine Latter aslat...@gmail.com wrote: On Sun, Jan 9, 2011 at 6:05 PM, Aaron Gray aaronngray.li...@gmail.com wrote: On 9 January 2011 21:30, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sun, 9 Jan 2011, Aaron Gray wrote: I am trying to

Re: [Haskell-cafe] How to write such a code elegantly ?

2011-01-09 Thread Ertugrul Soeylemez
z_axis z_a...@163.com wrote: betterStdGen :: IO StdGen betterStdGen = alloca $ \p - do h - openBinaryFile /dev/urandom ReadMode hGetBuf h p $ sizeOf (undefined :: Int) hClose h mkStdGen $ peek p picoSec :: IO Integer picoSec = do t - ctPicosec `liftM` (getClockTime =

Re: [Haskell-cafe] How to write such a code elegantly ?

2011-01-09 Thread z_axis
thanks for all of your replies. I will test your code later. Another newbie question is why has the following code indentation problem ? rollDice n = do let myGen = if doesFileExist /dev/urandom then betterStdGen else (mkStdGen . fromInteger) $ picoSec

Re: [Haskell-cafe] How to write such a code elegantly ?

2011-01-09 Thread Ivan Lazar Miljenovic
On 10 January 2011 12:25, z_axis z_a...@163.com wrote: thanks for all of your replies.  I will test your code later. Another newbie question is why has the following code indentation problem ? rollDice n = do    let myGen =        if doesFileExist /dev/urandom            then betterStdGen

Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Antoine Latter
On Sun, Jan 9, 2011 at 8:11 PM, Aaron Gray aaronngray.li...@gmail.com wrote: On 10 January 2011 01:08, Antoine Latter aslat...@gmail.com wrote: Although the 24-bit access might be difficult - how are they aligned? They are non aligned, they are actually used as jump offsets in the byte

Re: [Haskell-cafe] How to write such a code elegantly ?

2011-01-09 Thread z_axis
rollDice n = do tmp - doesFileExist /dev/urandom myGen - if tmp then betterStdGen else (mkStdGen . fromInteger) $ picoSec return $ (take 1 $ randomRs (1,n) myGen) !! 0 works but not so elegant? - e^(π.i) + 1 = 0 -- View this message in context:

[Haskell-cafe] Draw K-ary forest in dot script

2011-01-09 Thread larry.liuxinyu
Hi, I wrote a Haskell program to parse K-ary forest and convert it to dot script (Graphviz). Here is the literate program. -- First is some stuff imported: module Main where import System.Environment (getArgs) import Text.ParserCombinators.Parsec import Control.Monad (mapM_) import Data.List

Re: [Haskell-cafe] hoogle command line program on Linux

2011-01-09 Thread Neil Mitchell
Hi Erik, The next problem is that hoogle installed as a Debian package would install as root as /usr/bin/hoogle. Then, when I run hoogle data it wants to install the database at /usr/share/hoogle/hoogle-4.1.3/databases which fails because I'm not running as root. So, to install the databases