Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-25 Thread Michael Snoyman
I can point you to the line of code causing you trouble[1]. The problem is, as you already pointed out, that we don't have a PersistValue constructor that fits this case correctly. I think the right solution is to go ahead and add such a constructor for the next release. I've opened a ticket on

Re: [Haskell-cafe] Data.Sequence and replicateM

2013-01-25 Thread Thomas Horstmeyer
Hi, isn't the correct type context for f the following? f :: (Functor m, Monad m) = Int - m a - m (Seq a) So your f really is a kind of specialization of g. Could the reason for f performing better be list fusion? Anything happening inside Control.Monad.replicateM should be subject to it.

[Haskell-cafe] cabal install choosing an older version

2013-01-25 Thread Ozgur Akgun
Hi, I noticed a weird behaviour with cabal-install. When I run `cabal install hspec --dry-run -v` cabal-install correctly picks hspec-1.4.3 (the latest version). However, when I run `cabal install ansi-terminal hspec --dry-run -v`cabal-install tries to install hspec-0.3.0 for no apparent reason.

Re: [Haskell-cafe] Data.Sequence and replicateM

2013-01-25 Thread Daniel Díaz Casanueva
Yes, you're right about the type context. I always forget that Functor is not a superclass of Monad. Anyway, the `fmap` can be done only with `Monad` in the context. About the list fusion, I'm compiling with optimizations enabled (-O2), but I do not know how it works with fusions. Is it the

Re: [Haskell-cafe] cabal install choosing an older version

2013-01-25 Thread Ozgur Akgun
Aha! I think I know why this happens. The latest versions of ansi-terminal and hspec do not work together. Cabal picks the latest ansi-terminal (0.6) first, then the latest hspec that doesn't conflict with this choice is 0.3.0. I can confirm this by the following: $ cabal install hspec

Re: [Haskell-cafe] cabal install choosing an older version

2013-01-25 Thread Max Bolingbroke
On 25 January 2013 14:46, Ozgur Akgun ozgurak...@gmail.com wrote: The latest versions of ansi-terminal and hspec do not work together. Cabal picks the latest ansi-terminal (0.6) first, then the latest hspec that doesn't conflict with this choice is 0.3.0. If this happens because the dependency

[Haskell-cafe] ANN: gray-extended (tools for working with Gray codes)

2013-01-25 Thread Amy de Buitléir
I'm happy to announce a new package called gray-extended http://hackage.haskell.org/package/gray-extended-1.2 https://github.com/mhwombat/gray-extended (github) ABOUT GRAY-EXTENDED: Gray codes satisfy the property that two successive values differ in only one digit. Usually the term

[Haskell-cafe] ANNOUNCE: creatur (framework for artificial life)

2013-01-25 Thread Amy de Buitléir
I'm happy to announce a new package called Créatúr (creatur) http://hackage.haskell.org/package/creatur https://github.com/mhwombat/creatur-examples/raw/master/Tutorial.pdf (tutorial) https://github.com/mhwombat/creatur (github) ABOUT CRÉATÚR: Créatúr is a software framework for

[Haskell-cafe] ANNOUNCE: hslogstash (library for working with Logstash and related tools)

2013-01-25 Thread Simon Marechal
This is a library for sysadmins and/or tool writers. It provides proper types and correct serialization for Logstash messages, along with small utilities for working with ElasticSearch or Redis (using hedis). This library focus will be on safety (no messages lost). Right now, it can be used to: *

Re: [Haskell-cafe] ANNOUNCE: hslogstash (library for working with Logstash and related tools)

2013-01-25 Thread Felipe Almeida Lessa
For someone as lazy as myself: http://hackage.haskell.org/package/hslogstash https://github.com/bartavelle/hslogstash Cheers, On Fri, Jan 25, 2013 at 2:48 PM, Simon Marechal si...@banquise.net wrote: This is a library for sysadmins and/or tool writers. It provides proper types and correct

Re: [Haskell-cafe] cabal install choosing an older version

2013-01-25 Thread Ozgur Akgun
Hi Max, On 25 January 2013 15:58, Max Bolingbroke batterseapo...@hotmail.comwrote: If this happens because the dependency bounds of ansi-terminal are too tight then please send me a patch. No, actually it happens because hspec depends on ansi-terminal-0.5.*. I am cc'ing Simon Hengel, the

Re: [Haskell-cafe] Data.Sequence and replicateM

2013-01-25 Thread Petr P
2013/1/25 Daniel Díaz Casanueva dhelta.d...@gmail.com Yes, you're right about the type context. I always forget that Functor is not a superclass of Monad. Anyway, the `fmap` can be done only with `Monad` in the context. Instead of adding `Functor m` constraint you could write just f n

[Haskell-cafe] why no replace function in our regular expression libs ?

2013-01-25 Thread Simon Michael
People have put a lot of work into regular expression libraries on haskell. Yet it seems very few of them provide a replace/substitute function - just regex-compat and regepr as far as I know. Why is that ? #haskell says: sclv iirc its because that's a really mutatey operation in the underlying c

Re: [Haskell-cafe] why no replace function in our regular expression libs ?

2013-01-25 Thread Clark Gaebel
I've needed this recently, too. End result: I wrote an Attoparsec.Parser Text, and ran the text through that. A regex would have been much nicer... - Clark On Fri, Jan 25, 2013 at 2:06 PM, Simon Michael si...@joyful.com wrote: People have put a lot of work into regular expression

Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-25 Thread s9gf4ult
turning your Fixed values into Integers Thanks for that idea.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread s9gf4ult
Hello, haskellers. I am trying to write some generic subtyping issue. Here upcast is always safe operation because of subtype is always behaves like the parrent type. downcast is not the safe becase of not every parrent type value can be converted to children type. Rangeable here is the

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread Brandon Allbery
On Fri, Jan 25, 2013 at 3:18 PM, s9gf4...@gmail.com wrote: Duplicate instance declarations: instance [incoherent] (Num a, Ord a, Rangable range a, Packable range a) = SubtypeOf range a -- Defined at ...:22:10 instance [incoherent] (Integral a, Packable range a, MultipleTo range a) =

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread s9gf4ult
This has the code smell of trying to use typeclasses for OOP. That won't work. (Yes, really.) I am not trying to use OOP, I am just writing some typecasting at all. This would be correct. Constraints on an instance are applied *after* the instance is selected, so when Haskell is looking

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-25 Thread wren ng thornton
On 1/24/13 1:40 AM, Ertugrul Söylemez wrote: David Thomas davidleotho...@gmail.com wrote: We could even set up NotOnHackage: a package repository just like Hackage, except the packages are just documentation on why there is no such package. Implementation-wise it's just a wiki; but the idea is

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-25 Thread David Thomas
I think it needs to be both places. I know when I'm searching, I often just go to google with site:hackage.haskell.org inurl:latest I would be likely to miss it if it were just in the cabal file (although in the modules it could be as simple as a note saying this is defunct - view the main page

Re: [Haskell-cafe] why no replace function in our regular expression libs ?

2013-01-25 Thread Albert Y. C. Lai
On 13-01-25 02:06 PM, Simon Michael wrote: People have put a lot of work into regular expression libraries on haskell. Yet it seems very few of them provide a replace/substitute function - just regex-compat and regepr as far as I know. Why is that ? [...] Secondly, as of today what do y'all do

Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-25 Thread ok
By the way, not all databases supported by Persistent have the ability to represent NUMERIC with perfect precision. I'm fairly certain the SQLite will just cast to 8-byte reals, though it's possible that it will keep the data as strings in some circumstances. According to the documentation,

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-25 Thread Alvaro Gutierrez
A brief stylistic note: to me, defunct has a connotation similar to that of deprecated, just stronger; meaning, it implies something closer to NoLongerOnHackage rather than wren's more general NotOnHackage. In this case, the distinction is moot, because the code did happen to exist on Hackage, but

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread s9gf4ult
http://ideone.com/v2CrAm I has posted to ideone to show what is wrong.___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How to escape from typecheck error: Duplicate instance declarations ?

2013-01-25 Thread Alexander Solla
On Fri, Jan 25, 2013 at 12:39 PM, s9gf4...@gmail.com wrote: ** This has the code smell of trying to use typeclasses for OOP. That won't work. (Yes, really.) I am not trying to use OOP, I am just writing some typecasting at all. This would be correct. Constraints on an instance

Re: [Haskell-cafe] How to store Fixed data type in the database with persistent ?

2013-01-25 Thread s9gf4ult
According to the documentation, SQLite stores whatever you give it, paying very little heed to the declared type. If you get SQLite to *compare* two numbers, it will at that point *convert* them to doubles in order to carry out the comparison. This is quite separate from the question of