Re: [Haskell-cafe] Same compiled program behaving differently when called from ghci and shell

2010-11-21 Thread Manlio Perillo
Il 21/11/2010 21:51, Manlio Perillo ha scritto: > [...] > There are 3 solutions: > 1) open the file in binary mode > 2) set the console codepage to 1252. > >I do this by changing the "Command Prompt" shortcut destination to: > `%SystemRoot%\system32\cmd.ex

Re: [Haskell-cafe] Same compiled program behaving differently when called from ghci and shell

2010-11-21 Thread Manlio Perillo
Il 21/11/2010 19:28, Bruno Damour ha scritto: > [...] > Of course you're right but that was a surprise to me... > > G:\CODE\rlib>chcp 1252 > > Page de codes active: 1252 > > G:\CODE\rlib>ftest3.exe > > è > > Just '1' > > G:\CODE\rlib>chcp 850 > > Page de codes active : 850 > > G:\CODE\rlib>ftest3.e

Re: [Haskell-cafe] Same compiled program behaving differently when called from ghci and shell

2010-11-21 Thread Manlio Perillo
Il 21/11/2010 19:06, Bruno Damour ha scritto: > Le 21/11/10 17:21, Manlio Perillo a écrit : >> Il 21/11/2010 06:49, Bruno Damour ha scritto: >>> Hello, >>> I have a very strange (for me) problem that I manage to reduce to this : >>> I have a small program that r

Re: [Haskell-cafe] Same compiled program behaving differently when called from ghci and shell

2010-11-21 Thread Manlio Perillo
Il 21/11/2010 06:49, Bruno Damour ha scritto: > Hello, > I have a very strange (for me) problem that I manage to reduce to this : > I have a small program that reads a file with 1 only character (è = e8) > The program is ftest2.hs : > > [...] The only difference I can see is the codepage used.

Re: [Haskell-cafe] Re: dynamic loading of code on windows

2010-11-12 Thread Manlio Perillo
Il 12/11/2010 19:01, Kevin Jardine ha scritto: > This isn't about the plugin functionality, it's about compiling code. > > As the message says : > > This requires a Unix compatibility toolchain such as MinGW+MSYS or > Cygwin. > Is it really necessary to use autoconf? I have read the autoconf.ac f

[Haskell-cafe] "back doors" into the IO monad

2010-10-23 Thread Manlio Perillo
Hi. What are the available methods to execute IO actions from pure code? I know only unsafePerformIO and foreign import (to call a non pure foreign function). Assuming I want to execute external untrusted code using plugins (via the `plugins` package), is it possible to completely forbid execut

[Haskell-cafe] surrogate code points in a Char

2009-11-18 Thread Manlio Perillo
Hi. The Unicode Standard (version 4.0, section 3.9, D31 - pag 76) says: """Because surrogate code points are not included in the set of Unicode scalar values, UTF-32 code units in the range D800 .. DFFF are ill-formed""" However GHC does not reject this code units: Prelude> print '\x000

Re: [Haskell-cafe] attoparsec and parsec

2009-11-15 Thread Manlio Perillo
Jason Dusek ha scritto: > To add to the confusion, I forked `bytestringparser` when I > wrote the `json-b` package. The fork is here: > > http://hackage.haskell.org/package/bytestringparser-temporary/ > > I have added a number of things to original as well as fixing > some problems wi

[Haskell-cafe] attoparsec and parsec

2009-11-14 Thread Manlio Perillo
kage: http://hackage.haskell.org/package/bytestringparser what is the status of this package? It has the same API of attoparsec, but its older. However there is no indication that this package is deprecated in favor of attoparsec. Thanks Manlio Perillo _

[Haskell-cafe] Lexical Syntax and Unicode

2009-11-14 Thread Manlio Perillo
PARATOR uniPara -> PARAGRAPH SEPARATOR Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-21 Thread Manlio Perillo
Luke Palmer ha scritto: > [...] > Note that it is not always possible to separate IO from pure code. > As an example, consider an HTTP 1.1 server that read a request body > containing a number for each line, and return a response body containing > the sum of the numbers. > > > Wha

Re: [Haskell-cafe] Converting IO [XmlTree] to [XmlTree]

2009-04-19 Thread Manlio Perillo
of the numbers. Here, you can not really separate IO from pure computation. And you can not use lazy IO, if you want your server to support HTTP 1.1 pipelining. Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] binary package: memory problem decoding an IntMap

2009-04-13 Thread Manlio Perillo
Nicolas Pouillard ha scritto: Excerpts from Manlio Perillo's message of Sun Apr 05 22:41:57 +0200 2009: Manlio Perillo ha scritto: Hi. [...] I have a: [(Word16, UArr (Word32 :*:* Word8))] This eats more memory than it should, since tuples are decoded lazily. Why not swit

[Haskell-cafe] GHC RTS bug: segmentation fault

2009-04-12 Thread Manlio Perillo
occurs, the program requires about 1 GB of memory - there is no real parallelization, only 1 CPU is used - the mapReduce implementation is taken from Real World Haskell - the code is adapted from the code I'm using in a project Thanks Manlio Perillo ___

Re: [Haskell-cafe] How to install HOpenGL to Windows?

2009-04-08 Thread Manlio Perillo
Peter Verswyvelen ha scritto: 1) install "cabal-install". download this file and put it in a directory in your %PATH% 2) to compile most libraries on Hackage that link to C libraries via the FFI, you need to install MinGW an

Re: [Haskell-cafe] Maybe off-topic -- Writing contracts or software specifications

2009-04-08 Thread Manlio Perillo
Maurí­cio ha scritto: Hi, [...] I need, for instance, to write a contract with a programmer we are hiring for a task. > [...] The question is: how much do you trust the programmer? And how much do the programmer trust you? Much of the complications of the contracts arise from the need to de

Re: [Haskell-cafe] advice on space efficient data structure with efficient snoc operation

2009-04-07 Thread Manlio Perillo
Edward Kmett ha scritto: I'm in the process of adding a Data.Sequence.Unboxed to unboxed-containers. I hope to have it in hackage today or tomorrow, should its performance work out as well as Data.Set.Unboxed. Looking at the data definition of Data.Sequence I suspect that it is not really s

[Haskell-cafe] advice on space efficient data structure with efficient snoc operation

2009-04-07 Thread Manlio Perillo
, a snoc operation avoid copying if there is space in the current array. I don't know if this is easy/efficient to implement in Haskell. Any other suggestions? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] binary package: memory problem decoding an IntMap

2009-04-05 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] It seems there is a problem with tuples, too. I have a: [(Word16, UArr (Word32 :*:* Word8))] This eats more memory than it should, since tuples are decoded lazily. My bad, sorry. I simply solved by using a strict consumer (foldl' instead of

Re: [Haskell-cafe] binary package: memory problem decoding an IntMap

2009-04-05 Thread Manlio Perillo
Manlio Perillo ha scritto: Hi. I'm having memory problems decoding a big IntMap. The data structure is: IntMap (UArr (Word16 :*: Word8)) There are 480189 keys, and a total of 100480507 elements (Netflix Prize). The size of the encoded (and compressed) data is 184 MB. When I load data

[Haskell-cafe] about import alias

2009-04-04 Thread Manlio Perillo
Hi. Haskell 98 allows import alias: import qualified VeryLongModuleName as C however it does not allow aliasing for imported names import NormalModule (veryLongFunctionName as C) what is the rational? IMHO this can be very useful in some cases. Thanks Manlio ___

[Haskell-cafe] binary package: memory problem decoding an IntMap

2009-04-02 Thread Manlio Perillo
`[(Int, a)]` compatible? Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-04-01 Thread Manlio Perillo
wren ng thornton ha scritto: Manlio Perillo wrote: Since ratings for each customers are parsed "at the same time", using a plain list would consume a lot of memory, since stream fusion can only be executed at the end of the parsing. On the other hand, when I want to group ratings

Re: [Haskell-cafe] Haddock: inserting interactive sessions in the documentation

2009-03-31 Thread Manlio Perillo
Wouter Swierstra ha scritto: What is the suggested (if any) convention for inserting an interactive session in the documentation? You may want to look at: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/DocTest Ah, ok, thanks. So convention is to just use `-- >`. Manlio ___

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-31 Thread Manlio Perillo
implementation of the the Netflix Prize in D language, I used a similar implementation, base on: http://mdounin.ru/hg/nginx-vendor-current/file/tip/src/core/ngx_list.h Unfortunately, D garbage collector is really bad when there are a lot of allocations, so I gave up. Manlio Perillo

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-31 Thread Manlio Perillo
Claus Reinke ha scritto: appendU is strict, insertWith just doesn't force it (follow the source link in the haddocks to see why). Ok, I see. But, IMHO, this should be clearly documented. There seems to be some agreement that strict variant operations should also be provided, but it needs som

[Haskell-cafe] Haddock: inserting interactive sessions in the documentation

2009-03-30 Thread Manlio Perillo
Hi. What is the suggested (if any) convention for inserting an interactive session in the documentation? Right know I'm doing (in random-shuffle package): -- |Convert a sequence @(e1...en)@ to a complete binary tree. -- -- @ -- System.Random.Shuffle> buildTree ['a','b','c','d','e'] -- Node

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-30 Thread Manlio Perillo
Don Stewart ha scritto: Can I close this ticket as not being to do with uvector? Yes, thanks; and sorry for the noise. But it may be interesting to study this the example I have pasted: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3103 I find it a bit surprising that using appendU is actual

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-30 Thread Manlio Perillo
Claus Reinke ha scritto: But Claus was right, appendU is lazy; this seems to be the cause of the problem. appendU is strict, insertWith just doesn't force it (follow the source link in the haddocks to see why). Ok, I see. But, IMHO, this should be clearly documented. I have updated my test

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Manlio Perillo
Don Stewart ha scritto: manlio_perillo: Don Stewart ha scritto: [...] So the question is: why appending an array of only one element to an existing array causes memory problems? It must copy the entire array. Isn't it the same with snocU? And, since the final result is the same, what hap

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Manlio Perillo
Claus Reinke ha scritto: IntMap (UArr (Word16 :*: Word8)) I was adding elements to the map using something like: v = map singletonU (a :*: b) insertWith appendU k v m However doing this eats a *lot* of memory. Since 'insertWith' doesn't actually do the 'appendU', the appends wil

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Manlio Perillo
Manlio Perillo ha scritto: Hi. As with a previous post, I think I have found a possible memory problem with the uvector package. I have this data structure (for, again, my Netflix Prize project): IntMap (UArr (Word16 :*: Word8)) [...] Today I have rewritten my program to use `alter

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Manlio Perillo
Don Stewart ha scritto: [...] So the question is: why appending an array of only one element to an existing array causes memory problems? It must copy the entire array. Isn't it the same with snocU? And, since the final result is the same, what happens to the temporary memory used for a

[Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Manlio Perillo
Hi. As with a previous post, I think I have found a possible memory problem with the uvector package. I have this data structure (for, again, my Netflix Prize project): IntMap (UArr (Word16 :*: Word8)) I was adding elements to the map using something like: v = map singletonU (a :*:

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Thursday, March 26, 2009, 6:39:12 PM, you wrote: The test consists in adding 1000 elements to an empty map. +RTS -c -F1.1 then read about garbage collection It now requires 386 MB of memory, but is 4.7 times slower. So, now memory required

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Manlio Perillo
Brandon S. Allbery KF8NH ha scritto: On 2009 Mar 26, at 11:39, Manlio Perillo wrote: The execution time and CPU usage is almost the same. However the C++ version requires 305 MB, the GHC version 617 MB. I wonder how much of that is due to lifting (i.e. laziness). http://hpaste.org/fastcgi

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-26 Thread Manlio Perillo
Claus Reinke ha scritto: Continuing our adventures into stylistic and semantic differences:-) Can you write this analysis on the wiki? Thanks! Manlio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/has

[Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Manlio Perillo
stcgi/hpaste.fcgi/view?id=2902 but memory usage is 703 MB, and execution time is about 4.5 times slower! Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] a cabal package with both a library and executable programs

2009-03-25 Thread Manlio Perillo
Hi. This example is taken from the Cabal documentation: Name:TestPackage ... Library Build-Depends: HUnit Exposed-Modules: A, B, C Executable program1 Main-Is: Main.hs Hs-Source-Dirs: prog1 Other-Modules: A, B Executable program2 Main-Is: Main.hs

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-25 Thread Manlio Perillo
wren ng thornton ha scritto: Manlio Perillo wrote: [...] Following directly from the Rule of Least Power, if you can get away with foreach then that's what you should use. Why? Because the less power the construct has, the fewer corner cases and generalizations a reader of the code nee

Re: [Haskell-cafe] Re: about Haskell code written to be "too smart"

2009-03-25 Thread Manlio Perillo
Heinrich Apfelmus ha scritto: Manlio Perillo wrote: Conal Elliott ha scritto: Manlio, We live in the age of participation -- of co-education. Don't worry about text-books. Contribute to some wiki pages & blogs today that share these smart techniques with others. When I started

[Haskell-cafe] Re: generalized shuffle

2009-03-25 Thread Manlio Perillo
o...@okmij.org ha scritto: Hello! The reason is that in a project I need to extract random elements from a list (and I need to extract a lot of them), and using "normal" methods [1] seems to be rather inefficient. Note that I have used an incorrect term, sorry. What I need, in det

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Conal Elliott ha scritto: And advices to experienced Haskell programmers about how to document their code so that it may help less experienced programmers. Manlio -- You may be missing the point of my suggestion, Ah, sorry. which is to help people *find* code that suits them, rathe

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Conal Elliott ha scritto: Manlio, We live in the age of participation -- of co-education. Don't worry about text-books. Contribute to some wiki pages & blogs today that share these smart techniques with others. When I started learning Haskell (by my initiative), what I did was: 1) Quick

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Dan Piponi ha scritto: Miguel Mitrofanov wrote: takeList = evalState . mapM (State . splitAt) However, ironically, I stopped using them for pretty much the same reason that Manlio is saying. Are you saying there's a problem with this implementation? It's the only one I could just read immed

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Conal Elliott ha scritto: I'd love to help newbies get the hang of Haskell without having to jump in the deep (and smart-infested) end first. And I'd love for people to keep writing smart code for non-newbies to enjoy. Perhaps a practical suggestion would be some wiki pages devoted to pointi

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Erik de Castro Lopo ha scritto: Manlio Perillo wrote: I was speaking about the best way to write a function, so that it may help someone who is learning Haskell. I've been learning Haskell for about 3 months. I think its a mistake to write code so that its easy for someone learning Ha

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Zachary Turner ha scritto: [...] > but I do understand that one of the primary uses cases and/or motivating factors for using Haskell is when you really just NEED that extra abstraction and power you get from being able to do these types of things. Someone once said that "simple problems shou

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Jonathan Cast ha scritto: [...] I think, in general, the best way to document the purpose of the function is -- | Split a function into a sequence of partitions of specified lenth takeList :: [Int] -> [a] -> [[a]] Note that I was not speaking about the best way to document a function

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Conal Elliott ha scritto: Another helpful strategy for the reader is to get smarter, i.e. to invest effort in rising to the level of the writer. Or just choose a different book if s/he prefers. - Conal This strategy is doomed to failure, unfortunately. We live in the real world, compromis

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Jake McArthur ha scritto: [...] | With my function, instead, you only have to "follow" 1 operation: | | Prelude> (head, tail) = splitAt n xs I think you are way oversimplifying your own code. ~takeList :: [Int] -> [a] -> [[a]] ~takeList [] _ = [] ~takeList _ [] = [

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Yitzchak Gale ha scritto: [...] So the bottom line is that Manlio is right, really. It's just that Haskell is still very different than what most programmers are used to. So it does take a while to get a feeling for what is "too smart". Right, you centered the problem! The problem is where to

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Jake McArthur ha scritto: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | This is right. | The problem is that often (IMHO) a function definition can be rewritten | so that it is much more readable. | | As an example, with the takeList function I posted. I looked at it

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Jake McArthur ha scritto: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Manlio Perillo wrote: | These friends are very interested in Haskell, but it seems that the main | reason why they don't start to seriously learning it, is that when they | start reading some code, they feel the

Re: [Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Tim Newsham ha scritto: These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is that when they start reading some code, they feel the "Perl syndrome". That is, code written to be "too smart", and that end up being totall

Re: [Haskell-cafe] Equations for `foo' have different numbers of arguments

2009-03-24 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Tuesday, March 24, 2009, 5:44:14 PM, you wrote: divide _ 0 = error "division by 0" divide = (/) Equations for `divide' have different numbers of arguments you should write divide a b = a/b Right. But my question was: why can't I write the func

[Haskell-cafe] about Haskell code written to be "too smart"

2009-03-24 Thread Manlio Perillo
Hi. In these days I'm discussing with some friends, that mainly use Python as programming language, but know well other languages like Scheme, Prolog, C, and so. These friends are very interested in Haskell, but it seems that the main reason why they don't start to seriously learning it, is

[Haskell-cafe] Equations for `foo' have different numbers of arguments

2009-03-24 Thread Manlio Perillo
Equations for `divide' have different numbers of arguments With HUGS: Equations give different arities for "divide" However the two equations really have the same number of arguments. What's the problem? Thanks Manlio Perillo _

[Haskell-cafe] generalized shuffle

2009-03-23 Thread Manlio Perillo
ment indexed by that number. Indexing for a list if very expensive. And it is not very fast, even using arrays (unless you use non portable unsafeRead). Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] System.Random.Shuffle fix

2009-03-23 Thread Manlio Perillo
friggin friggin ha scritto: I was looking for a shuffling algorithm to shuffle mp3-playlists so was very happy to see System.Random.Shuffle: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/random-shuffle-0.0.2 However I get errors,non-exhaustive patterns in function shufleTree or e

Re: [Haskell-cafe] Haskell syntax highlighting support for Trac

2009-03-22 Thread Manlio Perillo
Patai Gergely ha scritto: I'm not sure what your problem is. Yes, haskell support is available in recent versions of Trac. I was trying with the Trac instance for Hackage/Cabal. > [...] Manlio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Haskell syntax highlighting support for Trac

2009-03-22 Thread Manlio Perillo
Hi. I have noted that with Haskell projects that make use of Trac for issue tracking, it is not possible to have syntax highlighting for Haskell code. http://hackage.haskell.org/trac/hackage/wiki/WikiProcessors Is someone working on this? I can try to write a Trac plugin or patch to solve th

Re: [Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Manlio Perillo
Duncan Coutts ha scritto: On Sat, 2009-03-21 at 23:05 +0100, Manlio Perillo wrote: P.S: I tried to send an email to cabal-devel some days ago, with a feature I would like to see in Cabal. But the mail was never posted to the mailing list. Is that list moderated? It's subscriber only,

Re: [Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Manlio Perillo
Duncan Coutts ha scritto: On Sat, 2009-03-21 at 14:26 +0100, Manlio Perillo wrote: Hi. Assuming this configuration fragment: library xxx cc-options: -Wall if flag(HAVE_URANDOM) cc-options:-DHAVE_URANDOM In case the HAVE_URANDOM flag is defined, what will be

Re: [Haskell-cafe] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Manlio Perillo
Max Bolingbroke ha scritto: 2009/3/21 Manlio Perillo : Max Bolingbroke ha scritto: These two packages allow Haskell programs to produce much richer console output by allowing colorisation, emboldening and so on. Do you plan to extend the package to any terminal, using terminfo database

Re: [Haskell-cafe] Re: [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Manlio Perillo
Achim Schneider ha scritto: Manlio Perillo wrote: Do you plan to extend the package to any terminal, using terminfo database? Are there any non-ansi terminals left? I assumed they were extinct... it'd come close to using EBCDIC. http://groups.google.com/group/comp.unix.

[Haskell-cafe] [ANN] random-stream 0.1.1

2009-03-21 Thread Manlio Perillo
738 [1] It is possible to use OpenSSL, as a fallback. Just set the HAVE_SSL flag, during package configuration. The OpenSSL DLL should be placed where the linker can find it. I tried to test this, but without success (but I did not put much effort in it). Regards Manlio

Re: [Haskell-cafe] [ANN] ansi-terminal, ansi-wl-pprint - ANSI terminal support for Haskell

2009-03-21 Thread Manlio Perillo
Max Bolingbroke ha scritto: These two packages allow Haskell programs to produce much richer console output by allowing colorisation, emboldening and so on. Do you plan to extend the package to any terminal, using terminfo database? Regards Manlio ___

[Haskell-cafe] Cabal properties with conditionals

2009-03-21 Thread Manlio Perillo
Hi. Assuming this configuration fragment: library xxx cc-options: -Wall if flag(HAVE_URANDOM) cc-options:-DHAVE_URANDOM In case the HAVE_URANDOM flag is defined, what will be the value of the used cc-options? 1) -DHAHE_URANDOM 2) -Wall -DHAHE_URANDOM Thanks Man

Re: [Haskell-cafe] random shuffle and random list partition

2009-03-20 Thread Manlio Perillo
Yitzchak Gale ha scritto: Hi Manlio, Manlio Perillo wrote: For my Netflix Prize project I have implemented two reusable modules. The first module implements a random shuffle on immutable lists... The second module implements a function used to partition a list into n sublists of random length

Re: [Haskell-cafe] [ANN] random-shuffle package

2009-03-19 Thread Manlio Perillo
Max Rabkin ha scritto: On Thu, Mar 19, 2009 at 4:41 PM, Manlio Perillo wrote: However, in this case, the package name should be changed. I'm not sure it is a good idea to release a package that implements only one function (but I may be wrong). Personally, I think that there is little

Re: [Haskell-cafe] [ANN] random-stream package

2009-03-19 Thread Manlio Perillo
Andrew Wagner ha scritto: Maybe the feature has been added, but not released, because somebody is strict about their code... We should first agree on the meaning of "release some code"... Manlio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.o

Re: [Haskell-cafe] [ANN] random-stream package

2009-03-19 Thread Manlio Perillo
Gökhan San ha scritto: Manlio Perillo writes: The stream generator implements tha RandomGen interface. This is really cool, though I think 'split' is a must. Maybe all instances could share the same stream in the background, then it wouldn't cause resource issues. I hav

Re: [Haskell-cafe] [ANN] random-stream package

2009-03-19 Thread Manlio Perillo
Brent Yorgey ha scritto: On Thu, Mar 19, 2009 at 11:55:16AM +0100, Manlio Perillo wrote: Note that I have not uploaded it on Hackage, and I do not plan to upload it in the near future, at least until I will repute the package mature enough. I would encourage you to upload it to Hackage

[Haskell-cafe] [ANN] random-shuffle package

2009-03-19 Thread Manlio Perillo
ong). Feedbacks (on current random-shuffle and future additions) are welcomed. Regards Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: doubts about runGetState in the binary package

2009-03-19 Thread Manlio Perillo
ChrisK ha scritto: Manlio Perillo wrote: Hi. I have some doubts about the runGetState function in the binary package. The signature is: runGetState :: Get a -> LBS -> Int64 -> (a, LBS, Int64) however the Int64 "input parameter" is not documented. What value should I pas

[Haskell-cafe] doubts about runGetState in the binary package

2009-03-19 Thread Manlio Perillo
Hi. I have some doubts about the runGetState function in the binary package. The signature is: runGetState :: Get a -> LBS -> Int64 -> (a, LBS, Int64) however the Int64 "input parameter" is not documented. What value should I pass? How will be used? Tha

[Haskell-cafe] [ANN] random-stream package

2009-03-19 Thread Manlio Perillo
Stream gen = mkStream l :: [Int] l = randoms gen :: [Int] main = do print l Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Announce: language-python

2009-03-19 Thread Manlio Perillo
I would like to do some AST processing, and Haskell is IMHO a better choice. > [...] Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Manlio Perillo
Joe Fredette ha scritto: You know, I hear theres this brilliant program for compiling C code -- gcd? ccg? gcc, yah gcc... Anyone tried it? In all seriousness though, why do you need to compile c with ghc? I'm curious, it seems a bit pointless... It's for a possible extension I'm planning f

Re: [Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Manlio Perillo
Anton Tayanovskyy ha scritto: Works for me without the --make, as `ghc foo.c` For me, too, thanks. Manlio ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] can GHC build an executable from a C source file?

2009-03-17 Thread Manlio Perillo
Hi. I'm checking if it possible to build an executable from C source files only. As an example: #include int main () { printf("hello world\n"); return 0; } $ghc --make foo.c However this only produces the object file, foo.o; it does not build the executable file. What is the r

Re: [Haskell-cafe] random shuffle and random list partition

2009-03-17 Thread Manlio Perillo
Yitzchak Gale ha scritto: [...] While I think Oleg's tree method is beautiful, in practice it may be re-inventing the wheel. I haven't tested it, but I doubt that this implementation is much better than using the classical shuffle algorithm on an IntMap. Do you have a working implementation?

[Haskell-cafe] random shuffle and random list partition

2009-03-16 Thread Manlio Perillo
Hi. For my Netflix Prize project I have implemented two reusable modules. The first module implements a random shuffle on immutable lists. It uses http://okmij.org/ftp/Haskell/perfect-shuffle.txt, with an additional "wrapper" function, having a more friendly interface. The second module implem

Re: [Haskell-cafe] Visualising the Hierarchical Namespace

2009-03-16 Thread Manlio Perillo
Don Stewart ha scritto: manlio_perillo: Don Stewart ha scritto: I've just finished a post (and quick tool) for graphing the complete module namespace of Haskell, taken from the core libraries and all of Hackage. It's quite large: http://donsbot.wordpress.com/2009/03/16/visualising-the-h

Re: [Haskell-cafe] Visualising the Hierarchical Namespace

2009-03-16 Thread Manlio Perillo
Don Stewart ha scritto: I've just finished a post (and quick tool) for graphing the complete module namespace of Haskell, taken from the core libraries and all of Hackage. It's quite large: http://donsbot.wordpress.com/2009/03/16/visualising-the-haskell-universe/ Just a note: isn't it t

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Manlio Perillo
Don Stewart ha scritto: grzegorz.chrupala: Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its very common that decoding a map or list of non-trivi

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Manlio Perillo
written a script in Python that parse the data, and it only takes 491 MB (using a list of a tuple with two compact arrays from numpy). So, GHC has memory problems here. Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Alternative to Data.Binary

2009-03-14 Thread Manlio Perillo
Svein Ove Aas ha scritto: On Sat, Mar 14, 2009 at 1:37 PM, Grzegorz Chrupala wrote: Hi all, Is there a serialization library other than the Data.Binary from hackage? I am using Data.Binary in a couple of projects, but I have found its stack and memory usage very hard to control. Its very commo

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-14 Thread Manlio Perillo
Daniel Peebles ha scritto: I have added UAProd-based Binary instances to my copy of the uvector repo at http://patch-tag.com/publicrepos/pumpkin-uvector . I have some extensive tests (added to the existing tests directory) of things in there and they seem to be mostly sane. Thanks for the work

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-13 Thread Manlio Perillo
Don Stewart ha scritto: [...] So, the patch is: "just revert this change". Or... use your own UIO instance. That's why it's a type class! Why should I rewrite the UIO instance, if one already exists? Anyway, for the background on this: Tue Nov 18 08:44:46 PST 2008 Malcolm Wallace

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-13 Thread Manlio Perillo
Daniel Fischer ha scritto: [...] Worked with uvector-0.1.0.1: [...] But not with uvector-0.2 > [...] The main difference is that in uvector 0.2, hPutBU does not write in the file the length of the array; hGetBU simply use the file size. let elemSize = sizeBU 1 (undefined :: e) n <- f

Re: [Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-13 Thread Manlio Perillo
Daniel Peebles ha scritto: As far as I know, the reason for this is that the UIO instance for productions writes the two "rows" out sequentially to file, but doesn't include any means to determine the length of the two halves when it's loading up again. When you try to read the production back in

[Haskell-cafe] broken IO support in uvector package, when using non primitive types

2009-03-13 Thread Manlio Perillo
://code.haskell.org/~dons/code/uvector/ Thanks Manlio Perillo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-13 Thread Manlio Perillo
Bryan O'Sullivan ha scritto: [...] text is not mature, and is based on the same modern fusion framework as uvector and vector. It uses unpinned arrays, but provides functions for dealing with foreign code. What is the reason why you have decided to use unpinned arrays (ByteArray#) instead o

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-13 Thread Manlio Perillo
Don Stewart ha scritto: [...] You also have to add instance for UIO: instance (RealFloat a, UIO a) => UIO (Complex a) where hPutU h (UAComplex arr) = hPutU h arr hGetU h = do arr <- hGetU h return (UAComplex arr) With St

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-13 Thread Manlio Perillo
Manlio Perillo ha scritto: [...] uvector package also suppors Complex and Rational, however the support for these type is "hard written", using a UAProd class, and requires some boiler plate code (IMHO). Correction: UAProd is not a class, sorry. It is the UA constructor overlo

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-13 Thread Manlio Perillo
Don Stewart ha scritto: bulat.ziganshin: Hello Don, Wednesday, March 11, 2009, 12:12:07 AM, you wrote: Right, so my point stands: there's no difference now. If you can write a Storable instance, you can write a UA et al instance. yes, if there is some class provided for this and not just har

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-13 Thread Manlio Perillo
doc/html/Data-Strict-Tuple.html In the description, there is: "Same as regular Haskell pairs, but (x :*: _|_) = (_|_ :*: y) = _|_" but in the synopsis, the data constructor is :!:, not :*:. Regards Manlio Perillo ___ Haskell-Cafe mailing

Re: [Haskell-cafe] generic sum for an UArr

2009-03-11 Thread Manlio Perillo
Daniel Fischer ha scritto: [...] genericSumU :: (UA e, Integral e) => UArr e -> Int genericSumU = foldU add 0 That would have to be foldlU, the type of foldU is foldU :: UA a => (a -> a -> a) -> a -> UArr a -> a while foldlU :: UA a => (b -> a -> b) -> b -> UArr a -> b Damn... I w

  1   2   3   >