Re: [Haskell-cafe] UTF-8 in Haskell.

2010-12-22 Thread Magicloud Magiclouds
On Thu, Dec 23, 2010 at 2:01 PM, Mark Lentczner wrote: > > On Dec 22, 2010, at 9:29 PM, Magicloud Magiclouds wrote: >> Thus under all situation (ascii, UTF-8, or even >> UTF-32), my program always send 4 bytes through the network. Is that >> OK? > > Generally, no. > > Haskell strings are sequences

Re: [Haskell-cafe] UTF-8 in Haskell.

2010-12-22 Thread Mark Lentczner
On Dec 22, 2010, at 9:29 PM, Magicloud Magiclouds wrote: > Thus under all situation (ascii, UTF-8, or even > UTF-32), my program always send 4 bytes through the network. Is that > OK? Generally, no. Haskell strings are sequences of Unicode characters. Each character has an integral code point v

[Haskell-cafe] ANN: cabal-dev 0.7.3.1 -- now with ghci!

2010-12-22 Thread Rogan Creswick
Cabal-dev is now capable of launching ghci with the project's package database and local modules (if the package under development exposes a library). For example: # First, invoke cabal-dev install the package to populate the # package database: $ cabal-dev install .

[Haskell-cafe] UTF-8 in Haskell.

2010-12-22 Thread Magicloud Magiclouds
Hi, Recently, I am reading ssh hackage (http://hackage.haskell.org/package/ssh). When at the part of deal with string, I got confused. I am not sure if this is a bug for the hackage, or I am just misunderstanding. An ascii char takes a Word8. So this works (LBS stands for Data.ByteString.Lazy):

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-22 Thread michael rice
Thanks for the tip, Ozgur. It worked for me. Is this what you had in mind, Ryan? Michael == import Control.Monad.State.Lazy import Control.Monad import System.Random type GeneratorState = State StdGen data Craps a = Roll a | Win a | Lose a deriving (Show) genRandomR :: Random a =>

[Haskell-cafe] parsec2 vs. parsec3... again

2010-12-22 Thread Evan Laforge
Yeah, I know this has been discussed a number of times, but I have some concrete questions I haven't seen asked before. And the "parsec 3 is now as fast as parsec 2" thing I've seen around doesn't seem to be true for me. I have an app that does a lot of parsing of small expressions. It's current

Re: [Haskell-cafe] Behaviour of System.Directory.getModificationTime

2010-12-22 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/17/10 06:22 , Arnaud Bailly wrote: > Thanks for your answers. I am a little bit surprised, I thought > timestamps were on the milliseconds scale. POSIX timestamps are seconds. - -- brandon s. allbery [linux,solaris,freebsd,perl] allb.

Re: [Haskell-cafe] $ do?

2010-12-22 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/15/10 02:36 , Roman Cheplyaka wrote: > Regarding the rationale, I'm not so sure and I'd like to hear an > explanation from someone competent. But I assume it has something > to do with the fact that if you supply a 'do' argument, you cannot > sup

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-22 Thread Ozgur Akgun
see also: http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-State-Lazy.html#v:state On 22 December 2010 20:02, Ryan Ingram wrote: > Interesting. In that case, > > state f = StateT $ \s -> Identity (f s) > > allows "state" to replace "State" in that code. > Ozgur ___

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-22 Thread Henning Thielemann
On Thu, 23 Dec 2010, Henning Thielemann wrote: On Wed, 22 Dec 2010, Eugene Kirpichov wrote: It defines types like {{Int,Word}{16,32,64},Double,Float}{LE,BE} (for example Int32BE) etc. with a corresponding Storable instance. How about type constructors LittleEndian and BigEndian? newtype Li

Re: [Haskell-cafe] Data.Typeable TypeRep Ord instance.

2010-12-22 Thread John Meacham
On Sat, Dec 4, 2010 at 2:08 PM, Serguey Zefirov wrote: > Why TypeRep does have equality and doesn't have ordering? > > It would be good to have that. Yes, I have wanted that too. It would make maps from types to values possible/efficient. There is a very critical path in jhc that use type-indexed

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-22 Thread Henning Thielemann
On Wed, 22 Dec 2010, Eugene Kirpichov wrote: Hi cafe, I've released "storable-endian" http://hackage.haskell.org/package/storable-endian It defines types like {{Int,Word}{16,32,64},Double,Float}{LE,BE} (for example Int32BE) etc. with a corresponding Storable instance. It is needed for binary

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V2>0) on Vectors and Matrices with HMatrix ??

2010-12-22 Thread Henning Thielemann
On Wed, 22 Dec 2010, gutti wrote: question 1. u see the two commented lines I tried to get ur original line running, but didn't know how to specify f What 'f' ? Do you mean matrixfunction f x y = liftMatrix2 (zipVectorWith f) x y ? ## Code import Numeric.LinearAlgebra import G

Re: [Haskell-cafe] Proof in Haskell

2010-12-22 Thread Patrick Browne
On 22/12/2010 14:48, Artyom Shalkhakov wrote: > ..Do you want to prove a property of > a function formally, using some kind of formal logic? I am aware that functional languages do not do proofs at term level, but the motivation for my question is to get a precise reason why this is so. The replie

Re: [Haskell-cafe] [darcs-users] Darcs failure

2010-12-22 Thread Ivan Lazar Miljenovic
On 23 December 2010 00:09, Andrew Coppin wrote: > > Presumably the only way to do that would be to build one. (?) As I > understand it, apt-get and similar tools are designed to 100% prevent you > having any choice whatsoever over the version numbers of stuff that gets > installed. On the other ha

Re: [Haskell-cafe] Identity type

2010-12-22 Thread John Meacham
On Tue, Dec 14, 2010 at 10:31 AM, Pierre-Etienne Meunier wrote: > Is there something like an identity type, transparent to the type-checker, in > haskell ? > For instance, I'm defining an interval arithmetic, with polynomials, > matrices, and all that... defined with intervals. The types are :

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V2>0) on Vectors and Matrices with HMatrix ??

2010-12-22 Thread gutti
Hi Henning, You definitly caught me on that little Germanism :-) About Your comments - a lot to learn and take in, but it really helps. - Thanks a lot. I just manged to get the Matrix masking running code looks like (code A see below). Two quick questions: question 1. u see the two commented

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-22 Thread Yves Parès
Patai, I read your paper on Elerea. It wasn't easy :), but I think I got the picture. So I would have 2 questions : I made a simple function which turns an infinite list into a signal : fromList :: [a] -> SignalGen (Signal a) fromList xs = stateful xs tail >>= memo . fmap head 1) It does what

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-22 Thread Ryan Ingram
Interesting. In that case, state f = StateT $ \s -> Identity (f s) allows "state" to replace "State" in that code. On Wed, Dec 22, 2010 at 4:56 AM, Daniel Fischer wrote: > On Wednesday 22 December 2010 12:03:01, Ryan Ingram wrote: >> Huh, that's weird, I just copy and pasted this into a new fi

Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:51, Daniel Fischer wrote: > On Wednesday 22 December 2010 16:54:04, Aaron Gray wrote: > > Missing Parsec library :- > > > > scheme.o(.text+0x4fa):fake: undefined reference to > > `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany > >1_closure' scheme.o(

Re: [Haskell-cafe] [darcs-users] Darcs failure

2010-12-22 Thread Jason Dagit
On Wed, Dec 22, 2010 at 5:09 AM, Andrew Coppin wrote: > On 22/12/2010 11:08 AM, Eric Kow wrote: > >> Andrew, >> >> Thanks for your report. Indeed, please direct future reports >> to darcs-users or b...@darcs.net >> > > That would require me to sign up to yet another mailing list just to report > o

Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:47, Antoine Latter wrote: > ghc doesn't, by default, go searching for packages to link in to the > resulatant executable.. > > If you try 'ghc --make scheme.hs' your example will work better. Are great, thanks a lot. > You can also specify what to link manually, but --m

Re: [Haskell-cafe] Functor => Applicative => Monad

2010-12-22 Thread Simon Marlow
On 14/12/2010 08:35, Isaac Dupree wrote: On 12/14/10 03:13, John Smith wrote: I would like to formally propose that Monad become a subclass of Applicative, with a call for consensus by 1 February. The change is described on the wiki at http://haskell.org/haskellwiki/Functor-Applicative-Monad_Pro

Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Daniel Fischer
On Wednesday 22 December 2010 16:54:04, Aaron Gray wrote: > Missing Parsec library :- > > scheme.o(.text+0x4fa):fake: undefined reference to > `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany >1_closure' scheme.o(.text+0x501):fake: undefined reference to > `parseczm2zi1zi0zi

Re: [Haskell-cafe] Rendering of in new wiki (MSIE6)

2010-12-22 Thread Henk-Jan van Tuyl
On Wed, 22 Dec 2010 13:22:07 +0100, David Virebayre wrote: Statistics from "A tour of the Haskell Monad functions" (on my site), after 15.351 pageviews: I find it surprising that nobody using google chrome ever browsed your site. That is indeed strange; below statistics for the same

Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Antoine Latter
ghc doesn't, by default, go searching for packages to link in to the resulatant executable.. If you try 'ghc --make scheme.hs' your example will work better. You can also specify what to link manually, but --make works pretty well most of the time. In ghc version 7 '--make' is the default, but u

Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:27, Antoine Latter wrote: > What commands did you enter to produce this error? > ghc scheme.hs I am still getting this on the 2010 2.0.0 release. Aaron > Ahanks, > Antoine > > On Wed, Dec 22, 2010 at 9:54 AM, Aaron Gray > wrote: > > Missing Parsec library :- > > sche

Re: [Haskell-cafe] Latest Haskell Platform for Windows

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:41, Don Stewart wrote: > aaronngray.lists: > >Could someone please point me at a copy of the latest Haskell platform > or > >a working GHC please. > >Many thanks in advance, > > The links on haskell.org/platform should work (there was a domain > change, so you'l

Re: [Haskell-cafe] Latest Haskell Platform for Windows

2010-12-22 Thread Don Stewart
aaronngray.lists: >Could someone please point me at a copy of the latest Haskell platform or >a working GHC please. >Many thanks in advance, The links on haskell.org/platform should work (there was a domain change, so you'll no longer see lambda.galois.com links). -- Don

Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Antoine Latter
What commands did you enter to produce this error? Ahanks, Antoine On Wed, Dec 22, 2010 at 9:54 AM, Aaron Gray wrote: > Missing Parsec library :- > scheme.o(.text+0x4fa):fake: undefined reference to > `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany1_closure' > scheme.o(.

Re: [Haskell-cafe] Latest Haskell Platform for Windows

2010-12-22 Thread Jonas Almström Duregård
Maybe this one: http://hackage.haskell.org/platform/2010.2.0.0/HaskellPlatform-2010.2.0.0-setup.exe /J On 22 December 2010 17:15, Aaron Gray wrote: > Could someone please point me at a copy of the latest Haskell platform or a > working GHC please. > Many thanks in advance, > Aaron > > __

[Haskell-cafe] Latest Haskell Platform for Windows

2010-12-22 Thread Aaron Gray
Could someone please point me at a copy of the latest Haskell platform or a working GHC please. Many thanks in advance, Aaron ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
Missing Parsec library :- scheme.o(.text+0x4fa):fake: undefined reference to `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany1_closure' scheme.o(.text+0x501):fake: undefined reference to `parseczm2zi1zi0zi0_TextziPaserCombinatorsziParsecziChar_space_closure' scheme.o(.text+

[Haskell-cafe] Windows Haskell Platform download link is broken

2010-12-22 Thread Aaron Gray
Windows Haskell Platform download link goes nowhere :- http://hackage.haskell.org/platform/windows.html The "Download Haskell for Windows" is broken :- http://lambda.galois.com/hp-tmp/2010.2.0.0/HaskellPlatform-2010.2.0.0-setup.exe Aaron ___ Hask

[Haskell-cafe] ANNOUNCE: storable-endian

2010-12-22 Thread Eugene Kirpichov
Hi cafe, I've released "storable-endian" http://hackage.haskell.org/package/storable-endian It defines types like {{Int,Word}{16,32,64},Double,Float}{LE,BE} (for example Int32BE) etc. with a corresponding Storable instance. It is needed for binary interoperability with libraries or network proto

[Haskell-cafe] implementing RealFloat decodeFloat

2010-12-22 Thread Claude Heiland-Allen
Hi everyone, I've been working on [0] Haskell bindings for [1] libqd for [2] double-double and quad-double arithmetic, and have been struggling to implement [3] RealFloat, in particular [4] decodeFloat, mostly because of its postcondition but also some issues relating to variable precision:

Re: [Haskell-cafe] [darcs-users] Darcs failure

2010-12-22 Thread Andrew Coppin
On 22/12/2010 11:08 AM, Eric Kow wrote: Andrew, Thanks for your report. Indeed, please direct future reports to darcs-users or b...@darcs.net That would require me to sign up to yet another mailing list just to report one bug. And given that we're talking about a prebuilt binary being trivia

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-22 Thread Daniel Fischer
On Wednesday 22 December 2010 12:03:01, Ryan Ingram wrote: > Huh, that's weird, I just copy and pasted this into a new file and it > worked for me. As a guess, you have mtl-1.*? In mtl-2.*, State s is made a type synonym for StateT s Identity, so there's no longer a data constructor State. _

Re: [Haskell-cafe] Rendering of in new wiki (MSIE6)

2010-12-22 Thread David Virebayre
> Statistics from "A tour of the Haskell Monad functions" (on my site), after > 15.351 pageviews: I find it surprising that nobody using google chrome ever browsed your site. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/

Re: [Haskell-cafe] [darcs-users] Darcs failure

2010-12-22 Thread Eric Kow
Andrew, Thanks for your report. Indeed, please direct future reports to darcs-users or b...@darcs.net > > darcs: bug at src/URL.hs:246 compiled Sep 12 2010 20:24:56 > > Another possible bug in URL.waitNextUrl: curl_multi_perform() - no running > > handles > > See http://wiki.darcs.net/BugTracker

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-22 Thread Ryan Ingram
Huh, that's weird, I just copy and pasted this into a new file and it worked for me. I did prepend the line module RandTest where -- ryan On Tue, Dec 21, 2010 at 6:43 PM, michael rice wrote: > I changed your die function to rollDie in function roll2Dice (I assume > that's what you meant) bu