[Haskell-cafe] ANNOUNCE: dbus 0.10

2012-06-23 Thread John Millikin
This is completing the merger of the dbus-core and dbus-client packages. The new package does everything they can do, but better. Hackage: http://hackage.haskell.org/package/dbus Homepage: https://john-millikin.com/software/haskell-dbus/ API reference:

[Haskell-cafe] Towards a single, unified API for incremental data processing

2012-04-01 Thread John Millikin
There are currently several APIs for processing strict monoidal values as if they were pieces of a larger, lazy value. Some of the most popular are based on Oleg's left-fold enumerators, including the iteratee, enumerator, iterIO. Other choices include comonads, conduits, and pipes. Despite

[Haskell-cafe] ANNOUNCE: options, an easy-to-use command-line option parser

2012-03-24 Thread John Millikin
Hackage: http://hackage.haskell.org/package/options Home page: https://john-millikin.com/software/haskell-options/ API reference: https://john-millikin.com/software/haskell-options/reference/haskell-options/latest/ The options package lets library and application developers easily work with

Re: [Haskell-cafe] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4

2012-02-06 Thread John Millikin
On Mon, Feb 6, 2012 at 10:05, Joey Hess j...@kitenet.net wrote: John Millikin wrote: That was my understanding also, then QuickCheck found a counter-example. It turns out that there are cases where a valid path cannot be roundtripped in the GHC 7.2 encoding. The issue is that  [238,189,178

[Haskell-cafe] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4

2012-02-05 Thread John Millikin
Both packages now have much-improved support for non-UTF8 paths on POSIX systems. There are no significant changes to Windows support in this release. system-filepath 0.4.5: Hackage: http://hackage.haskell.org/package/system-filepath-0.4.5 API reference:

Re: [Haskell-cafe] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4

2012-02-05 Thread John Millikin
On Sun, Feb 5, 2012 at 18:49, Joey Hess j...@kitenet.net wrote: John Millikin wrote: In GHC  7.2 and later, file path handling in the platform libraries was changed to treat all paths as text (encoded according to locale). This does not work well on POSIX systems, because POSIX paths are byte

Re: [Haskell-cafe] ANNOUNCE: system-filepath 0.4.5 and system-fileio 0.3.4

2012-02-05 Thread John Millikin
On Sun, Feb 5, 2012 at 19:17, John Millikin jmilli...@gmail.com wrote: -- $ ~/ghc-7.0.4/bin/ghci Prelude writeFile .txt test Prelude readFile .txt test Prelude Sorry, that got a bit mangled in the email. Corrected

[Haskell-cafe] Something's weird about System.Directory.removeDirectoryRecursive

2012-01-27 Thread John Millikin
http://hackage.haskell.org/packages/archive/directory/1.1.0.1/doc/html/System-Directory.html#v:removeDirectoryRecursive The documentation says that removeDirectoryRecursive follows symlinks. However, the implementation doesn't (in most cases, see below).

Re: [Haskell-cafe] mapping an Enumerator

2011-12-21 Thread John Millikin
The presence of (Step b m r) is an artifact of Haskell's type system. It can be removed through use of language extensions and 'forall' to give a more aesthetically pleasing signature, but there should be no behavioral difference. On Wed, Dec 21, 2011 at 03:26, Michael Snoyman mich...@snoyman.com

Re: [Haskell-cafe] ANNOUNCE: Anansi 0.4.2 (literate programming pre-processor)

2011-12-13 Thread John Millikin
On Tue, Dec 13, 2011 at 03:39, Magnus Therning mag...@therning.org wrote: 1. What to call files?  I understand (C)WEB suggests using .w, and that noweb uses .nw, what should I call anansi files? I usually use .anansi, but it doesn't matter. You can use whatever extensions you like, or even none

[Haskell-cafe] ANNOUNCE: Anansi 0.4.2 (literate programming pre-processor)

2011-12-10 Thread John Millikin
Anansi is a preprocessor for literate programs, in the model of NoWeb or nuweb. Literate programming allows both computer code and documentation to be generated from a single unified source. Home page: https://john-millikin.com/software/anansi/ Hackage:

Re: [Haskell-cafe] Will changing associativity of enumerator's ($=) affect anyone? (also: enumerator mailing list)

2011-10-23 Thread John Millikin
enumerator 0.4.15, which includes this change, is now published. Hackage: http://hackage.haskell.org/package/enumerator-0.4.15 Home page: https://john-millikin.com/software/enumerator/ Important changes since 0.4.14: * Fix an error in UTF-16 decoding, which could cause truncated output if the

[Haskell-cafe] Will changing associativity of enumerator's ($=) affect anyone? (also: enumerator mailing list)

2011-10-15 Thread John Millikin
A user recently suggested changing the associativity of ($=) from [[ infixr 0 ]] to [[ infixl 1 ]]. This allows the following expressions to be equivalent: run $ enumerator $$ enumeratee =$ enumeratee =$ iteratee run $ enumerator $= enumeratee $$ enumeratee =$ iteratee run $ enumerator

Re: [Haskell-cafe] Package documentation complaints -- and a suggestion

2011-10-09 Thread John Millikin
The package summary is Type-safe ADT-database mapping library., which gives some idea about what it does. In my experience, any package that starts its source files with {-# LANGUAGE GADTs, TypeFamilies, ExistentialQuantification, StandaloneDeriving, TypeSynonymInstances,

[Haskell-cafe] ANNOUNCE: knob, a library for memory-backed handles

2011-10-08 Thread John Millikin
http://hackage.haskell.org/package/knob This is a small package which allows you to create memory-backed handles. I found it as a pattern in a few of my test suites, so I spent a day or so polishing it up before posting it to the internet. Feel free to play around with it and tell me about any

Re: [Haskell-cafe] Ambiguous module name `System.Directory'

2011-08-30 Thread John Millikin
Note that once you upgrade it (to =0.4), you'll still need to remove the older version to fix the error. I wish cabal-install defaulted to hiding every package it installs. The current behavior of exposing every installed module is unreasonable and confusing. Packages should be namespaces, not

Re: [Haskell-cafe] Lifting an enumerator

2011-08-24 Thread John Millikin
The type signature liftEnum :: (Monad m, MonadTrans t) = Enumerator a m b - Enumerator a (t m) b expands to: liftEnum :: (Monad m, MonadTrans t) = (Step a m b - Iteratee a m b) - Step a (t m) b - Iteratee a (t m) b So you could implement it iff you can define: lower :: (Monad m,

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread John Millikin
I have, but it's not quite what I'm looking for: - I don't want to silence HUnit's output, I just don't want anything to show on the console when a test *passes*. Showing output on a failure is good. - I'm not interested in BDD. Not to say it's not useful, but it doesn't match my style of

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread John Millikin
prefer to do the second. There's usually a reason a library behaves as it does, and this way both behaviors are available to users (even if I find one frustrating). On Wed, Aug 10, 2011 at 23:51, Max Bolingbroke batterseapo...@hotmail.com wrote: On 11 August 2011 05:17, John Millikin jmilli

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread John Millikin
On Thu, Aug 11, 2011 at 07:52, Greg Weber g...@gregweber.info wrote: It silences HUnit's output, but will tell you what happens when there is a failure- which I think is what you want. There are a few available output formatters if you don't like the default output, or you can write your own

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread John Millikin
On Thu, Aug 11, 2011 at 08:17, Greg Weber g...@gregweber.info wrote: I am confused also, as to both what output you don't like that motivated chell and what exactly hspec silences :) Suffice to say I am able to get a small relevant error message on failure with hspec. I am adding the hspec

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread John Millikin
Possible -- I ran into dependency conflicts between t-f/t-f-q/quickcheck when trying to migrate to test-framework 0.4, so I clamped all my test subprojects to 0.3. On Thu, Aug 11, 2011 at 09:09, Nathan Howell nathan.d.how...@gmail.com wrote: Is this different than the --hide-successes flag for

[Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-10 Thread John Millikin
Homepage: https://john-millikin.com/software/chell/ Hackage: http://hackage.haskell.org/package/chell This is just a quick package I whipped up out of frustration with test-framework scrolling an error message out of sight, for the millionth time. Chell has the same general purpose

[Haskell-cafe] ANNOUNCE: dbus-core 0.9

2011-07-23 Thread John Millikin
D-Bus implementation for Haskell (dbus-core_0.9) This is the first significant release to dbus-core in a while, and it contains some significant improvements to both the API and implementation. Users

[Haskell-cafe] Request for comments: dbus-core 0.9

2011-07-15 Thread John Millikin
I think I'm pretty close to releasing the next version of my D-Bus library, dbus-core. This is a big release that changes a lot of the API, so I'd like to see if anybody 1) has any problems with the new APIs or 2) has any suggested improvements. haddock:

[Haskell-cafe] Imports in complex Setup.hs -- should we encourage/require PackageImports?

2011-05-23 Thread John Millikin
Several libraries (notably Pandoc and Gtk2hs) have very complex Setup.hs scripts, which import several external libraries. In my experience, these imports are very fragile, because Cabal does not enforce package visibility in Setup.hs. For example, a Setup.hs that imports Control.Monad.Trans

Re: [Haskell-cafe] No fish, please

2011-05-17 Thread John Millikin
Is there any way to indicate to Hackage that it should not try to generate Haddock documentation? I'm concerned for two use cases for packages using a different docs system: 1) A user might see the commentless auto-generated haddock and believe the package is undocumented. 2) A user might find

Re: [Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-26 Thread John Millikin
On Tuesday, April 26, 2011 7:19:25 AM UTC-7, John Lato wrote: I'd be interested to see the results of a shootout between iteratee and enumerator. I would expect them to be basically equivalent most of the time, with maybe two or three operations with a small (but consistent) difference

Re: [Haskell-cafe] Data.Enumerator.Text.utf8 not constant memory?

2011-04-25 Thread John Millikin
*sigh* Another fine entry for john-millikin-is-an-idiot.txt Thank you for the patch Felipe, and for the bug report Skirmantas. I have uploaded 0.4.10 to Hackage. My sincere apologies for the inconvenience. On Mon, Apr 25, 2011 at 19:03, Felipe Almeida Lessa felipe.le...@gmail.com wrote

Re: [Haskell-cafe] Why not Darcs?

2011-04-21 Thread John Millikin
My chief complaint is that it's built on patch theory, which is ill-defined and doesn't seem particularly useful. The Bazaar/Git/Mercurial DAG model is much easier to understand and work with. Possibly as a consequence of its shaky foundation, Darcs is much slower than the competition -- this

Re: [Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-21 Thread John Millikin
John Lato's iteratee package is based on IterateeMCPS.hs[1]. I used IterateeM.hs for enumerator, because when I benchmarked them the non-CPS version was something like 10% faster on most operations. The new IterateeM.hs solves some problems with the old encoding, but I haven't switched

Re: [Haskell-cafe] Why not Darcs?

2011-04-21 Thread John Millikin
On Thursday, April 21, 2011 4:16:07 PM UTC-7, John Meacham wrote: Um, the patch theory is what makes darcs just work. There is no need to understand it any more than you have to know VLSI design to understand how your computer works. The end result is that darcs repositories don't get

Re: [Haskell-cafe] Question about the Monad instance for Iteratee (from the enumerator package)

2011-04-20 Thread John Millikin
It's forbidden for an iteratee to yield extra input that it hasn't consumed; however, this is unfortunately not enforced by the type system. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] HXT and xhtml page encoded in cp1251

2011-04-18 Thread John Millikin
Since the document claims it is HTML, you should be parsing it with an HTML parser. Try hxt-tagsoup -- specifically, the parseHtmlTagSoup arrow. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] using IO monad in Iteratee

2011-04-02 Thread John Millikin
Use enumHandle. enumFile deals with the common case of read from the filesystem in IO. It can't deal with general MonadIO monads because there'd be no guarantee that the handle would actually be closed (eg, an ErrorT IO might never run the cleanup). If you need a special monad, do something

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-30 Thread John Millikin
On Wednesday, March 30, 2011 12:18:48 PM UTC-7, Bas van Dijk wrote: It would also be great to have a package which combines the proper encoding/decoding of filepaths of the system-filepath package with the type-safety of the pathtype package: http://hackage.haskell.org/package/pathtype Does

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-30 Thread John Millikin
On Wednesday, March 30, 2011 9:07:45 AM UTC-7, Michael Snoyman wrote: Thanks to you (and everyone else) for the informative responses. For now, I've simply hard-coded in UTF-8 encoding for all non-Windows systems. I'm not sure how this will play with OSes besides Windows and Linux (especially

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-30 Thread John Millikin
On Wed, Mar 30, 2011 at 21:07, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 31 March 2011 14:51, John Millikin jmilli...@gmail.com wrote: Linux, OSX, and (probably?) FreeBSD use UTF8. For Linux, doesn't it depend upon the locale rather than forcing UTF-8? In theory, yes

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-29 Thread John Millikin
UTC-7, John Millikin wrote: Since the release, a couple people have sent in feature requests, so I'm going to put out 0.4.9 in a day or so. New features will be: - tryIO: runs an IO computation, and converts any exceptions into ``throwError`` calls (requested by Kazu Yamamoto

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-28 Thread John Millikin
On Sunday, March 27, 2011 9:45:23 PM UTC-7, Ertugrul Soeylemez wrote: For setting a global timeout on an entire session, it's better to wrap the ``run_`` call with ``System.Timeout.timeout`` -- this is more efficient than testing the time on every chunk, and does not require a specialised

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-28 Thread John Millikin
Since the release, a couple people have sent in feature requests, so I'm going to put out 0.4.9 in a day or so. New features will be: - tryIO: runs an IO computation, and converts any exceptions into ``throwError`` calls (requested by Kazu Yamamoto) - checkContinue: encapsulates a common

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-27 Thread John Millikin
On Sunday, March 27, 2011 8:38:38 AM UTC-7, John A. De Goes wrote: Enumeratees solve some use cases but not others. Let's say you want to incrementally compress a 2 GB file. If you use an enumeratee to do this, your transformer iteratee has to do IO. I'd prefer an abstraction to

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-27 Thread John Millikin
If the receiver can only accept very small chunks, you can put a rechunking stage in between the compression and iteratee: --- verySmallChunks :: Monad m = Enumeratee ByteString ByteString m b verySmallSchunks = sequence (take 10)

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-26 Thread John Millikin
On Mar 26, 10:46 am, Michael Snoyman mich...@snoyman.com wrote: As far as the left-over data in a yield issue: does that require a breaking API change, or a change to the definition of = which would change semantics?? It requires a pretty serious API change, as the definition of 'Iteratee'

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-26 Thread John Millikin
On 2011-03-26, Gregory Collins g...@gregorycollins.net wrote: Since the API is being broken anyway, I'm also going to take the opportunity to change the Stream type so it can represent EOF + some data. That should allow lots of interesting behaviors, such as arbitrary lookahead. The thing

Re: [Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-26 Thread John Millikin
Hello Ertugrul Söylemez, Good idea -- I've added an ``enumSocketTimed`` and ``iterSocketTimed`` to the network-enumerator package at http://hackage.haskell.org/package/network-enumerator . ``enumSocketTimed`` is equivalent to your ``enumHandleTimeout``, but instead of Handle uses the more

[Haskell-cafe] ANNOUNCE: enumerator 0.4.8

2011-03-25 Thread John Millikin
- Enumerators are an efficient, predictable, and safe alternative to lazy I/O. Discovered by Oleg Kiselyov, they allow large datasets to be processed

Re: [Haskell-cafe] best way to deal with #defines when developing ffi's

2011-02-25 Thread John Millikin
When using c2hs, you can use the inline header commands to define global variables: -- #c const int HSMYLIBRARY_SOME_VAR = C_MY_VAR; const char *HSMYLIBRARY_OTHER_VAR = C_OTHER_VAR; #endc

[Haskell-cafe] Instancing Typeable for monad transformers?

2011-02-01 Thread John Millikin
Is there any reasonable way to do this if I want to cast a monadic value? For example: castState :: (Typeable a, Typeable s, Typeable1 m, Typeable b) = a - Maybe (StateT s m b) castState = Data.Typeable.cast None of the common monad transformers declare instances of Typeable, so I don't know

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 18:55, Chris Smith cdsm...@gmail.com wrote: Licensing with the GPL has definite consequences; for example, that the great majority of Haskell libraries, which are BSD3 licensed, may not legitimately declare dependencies on it. What are you talking about? Of course BSD3

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 21:11, David Leimbach leim...@gmail.com wrote: I am not an IP lawyer, but this is my understanding of the GPL and it's transitive relationship with bodies of work that aren't GPL'd. BSD3 doesn't really state anything about what it links with, but the GPL injects itself

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 21:51, Chris Smith cdsm...@gmail.com wrote: On Tue, 2011-01-25 at 21:41 -0800, John Millikin wrote: Licensing is a property of the code, not the package; Cabal's licensing field is only a useful shorthand for most of the code here is covered by That would

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 22:07, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Voila: http://www.gnu.org/licenses/gpl-faq.html#IfLibraryIsGPL (Note: in the past they said otherwise.) Important: or a GPL-compatible license BSD3, MIT, PublicDomain, Apache, etc, are all GPL-compatible.

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 22:14, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: However, my understanding that this property is then transitive: if Foo is GPL, Bar depends on Foo and Baz depends on Bar, then Baz must also be released under a GPL-compatible license. It's not really a

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 22:20, Chris Smith cdsm...@gmail.com wrote: On Tue, 2011-01-25 at 21:48 -0800, John Millikin wrote: Please cite where the FSF claims the GPL applies to unrelated works just because they can compile against GPL'd code. Keep in mind that if your claim is correct

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-25 Thread John Millikin
On Tue, Jan 25, 2011 at 22:52, Chris Smith cdsm...@gmail.com wrote: On Tue, 2011-01-25 at 22:34 -0800, John Millikin wrote: The specific claim I'm refuting is that if some library or application depends on GPL'd code, that library/application must itself be GPL-licensed. This claim is simply

Re: [Haskell-cafe] Adding a builder to the bytestring package?

2011-01-23 Thread John Millikin
Patch done and sent to the bytestring maintainers. For the interested, here's the benchmark chart for binary, cereal, and blaze-builder/bytestring: http://i.imgur.com/xw3TL.png On Wed, Jan 19, 2011 at 15:30, Johan Tibell johan.tib...@gmail.com wrote: On Thu, Jan 20, 2011 at 12:16 AM, John

Re: [Haskell-cafe] Adding a builder to the bytestring package?

2011-01-23 Thread John Millikin
by library: http://i.imgur.com/PXW97.png Benchmark source files attached, if you'd like to poke at them. On Sun, Jan 23, 2011 at 17:21, Conrad Parker con...@metadecks.org wrote: On 24 January 2011 07:29, John Millikin jmilli...@gmail.com wrote: Patch done and sent to the bytestring maintainers

[Haskell-cafe] Adding a builder to the bytestring package?

2011-01-19 Thread John Millikin
Most people who work with binary data have had to construct bytestrings at some point. The most common solution is to use a Builder, a monoid representing how to construct a bytestring. There are currently three packages (that I know of) which include builder implementations: binary, cereal, and

Re: [Haskell-cafe] Adding a builder to the bytestring package?

2011-01-19 Thread John Millikin
On Wed, Jan 19, 2011 at 12:04, Johan Tibell johan.tib...@gmail.com wrote: On Wed, Jan 19, 2011 at 8:37 PM, Michael Snoyman mich...@snoyman.com wrote: Isn't Simon Meier working on migrating his code from blaze-builder into binary? So I heard (although not directly from Simon). I think it would

Re: [Haskell-cafe] Adding a builder to the bytestring package?

2011-01-19 Thread John Millikin
On Wed, Jan 19, 2011 at 14:06, Johan Tibell johan.tib...@gmail.com wrote: On Wed, Jan 19, 2011 at 10:30 PM, Michael Snoyman mich...@snoyman.com wrote: What's the advantage to moving in into binary as opposed to bytestring? To test that the implementation can indeed be ported to that

Re: [Haskell-cafe] Monad transformer: apply StateT to List monad

2011-01-13 Thread John Millikin
Lifting 'f' into StateT -- you get a list of (result, state) pairs. Since the state is never modified, the second half of each pair is identical: -- import Control.Monad.State f :: Int - [Int] f n = [0..n] -- lifting 'f'

Re: [Haskell-cafe] haskell-2010 binary IO

2010-12-10 Thread John Millikin
Haskell supports binary IO via openBinaryFile, hGetBuf, and hPutBuf . Advanced types like ByteString or Binary are not part of Haskell 2010, I assume because they're too complex to be part of the language standard. On Thu, Dec 9, 2010 at 23:14, Permjacov Evgeniy permea...@gmail.com wrote: Does

Re: [Haskell-cafe] A home-brew iteration-alike library: some extension quiestions

2010-12-09 Thread John Millikin
On Thu, Dec 9, 2010 at 12:43, Michael Snoyman mich...@snoyman.com wrote: For the record, enumerator (and I believe iteratee as well) uses transformers, not mtl. transformers itself is Haskell98; all FunDep code is separated out to monads-fd. Michael iteratee also uses 'transformers', but

Re: [Haskell-cafe] Strange error when using Attoparsec and Enumerator

2010-12-05 Thread John Millikin
I swear attoparsec-enumerator is going to give me grey hair; the error you're receiving is because iterParser itself is divergent. Fixed in 0.2.0.3, with my sincere apologies. On Sun, Dec 5, 2010 at 09:14, Crutcher Dunnavant crutc...@gmail.com wrote: I have spent a good chunk of the past week

Re: [Haskell-cafe] How to put a string into Data.Binary.Put

2010-11-06 Thread John Millikin
Use one of the Char8 modules, depending on whether you want a strict or lazy bytestring: --- import qualified Data.ByteString.Lazy.Char8 as BS message :: BS.ByteString message = BS.pack SOME STRING

Re: [Haskell-cafe] Edit Hackage

2010-10-28 Thread John Millikin
On Thu, Oct 28, 2010 at 12:34, Andrew Coppin andrewcop...@btinternet.com wrote: Today I uploaded a package to Hackage, and rediscovered something that you already know: I'm an idiot. More specifically, I copied the Cabal description from another package and then updated all the fields. Except

Re: Re[2]: [Haskell-cafe] Big Arrays

2010-10-04 Thread John Millikin
On Mon, Oct 4, 2010 at 01:51, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello John, Monday, October 4, 2010, 7:57:13 AM, you wrote: Sure it does; a 32-bit system can address much more than 2**30 elements. Artificially limiting how much memory can be allocated by depending on a

Re: [Haskell-cafe] Big Arrays

2010-10-03 Thread John Millikin
On Sun, Oct 3, 2010 at 19:09, Bryan O'Sullivan b...@serpentine.com wrote: On Sun, Oct 3, 2010 at 11:54 AM, Henry Laxen nadine.and.he...@pobox.com wrote: I am trying to create a (relatively) big array, but it seems I cannot make anything larger than 2^30 or so.  Here is the code: Use a

Re: [Haskell-cafe] Why can't libraries/frameworks like wxHaskell/gtk2hs/... be used with newer versions of ghc/wxWidgets/GTK+/... ?

2010-09-27 Thread John Millikin
On Mon, Sep 27, 2010 at 10:55, cas...@istar.ca wrote: Why can't libraries/frameworks like wxHaskell/gtk2hs/... be used with newer versions of ghc/wxWidgets/GTK+/... ? Haskell libraries statically link many parts of the Haskell runtime; you can't combine two libraries compiled with different

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread John Millikin
On Mon, Sep 20, 2010 at 22:11, Conrad Parker con...@metadecks.org wrote: I've been using unsafeCoerce: getFloat64be :: Get Double getFloat64be = do n - getWord64be return (unsafeCoerce n :: Double) putFloat64be :: Double - Put putFloat64be n = putWord64be (unsafeCoerce n ::

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-21 Thread John Millikin
On Tue, Sep 21, 2010 at 12:08, Daniel Fischer daniel.is.fisc...@web.de wrote: Endianness only matters when marshaling bytes into a single value -- Data.Binary.Get/Put handles that. Once the data is encoded as a Word, endianness is no longer relevant. I mean, take e.g. 2^62 :: Word64. If you

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-20 Thread John Millikin
On Mon, Sep 20, 2010 at 03:22, Daniel Fischer daniel.is.fisc...@web.de wrote: unsafeCoerce is not supposed to work for casts between Integral and Floating types. If you try to unsafeCoerce# between unboxed types, say Double# and Word64#, you're likely to get a compile failure (ghc panic). If

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-19 Thread John Millikin
On Sun, Sep 19, 2010 at 20:16, Conrad Parker con...@metadecks.org wrote: Anyway, good work. Does this have any overlap with data-binary-ieee754? There was some recent discussion here about the encoding speed in that package. I should probably make it more clear that data-binary-ieee754 is for

Re: [Haskell-cafe] ANNOUNCE: text 0.9.0.0 and text-icu 0.4.0.0

2010-09-19 Thread John Millikin
On Sun, Sep 19, 2010 at 21:17, Bryan O'Sullivan b...@serpentine.com wrote: I've issued new releases of the text and text-icu packages, the fast, comprehensive Unicode text manipulation libraries. http://hackage.haskell.org/package/text http://hackage.haskell.org/package/text-icu What's new in

Re: [Haskell-cafe] ANN: ieee version 0.7

2010-09-19 Thread John Millikin
On Sun, Sep 19, 2010 at 21:43, Patrick Perry patpe...@gmail.com wrote: I needed real IEEE754 binary support for round-trip parsing, where (for example) maintaining the particular bit pattern of a NaN is important. For 99% of people, the unsafe method will work fine. How does a C-style cast

Re: [Haskell-cafe] Re: Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-09-07 Thread John Millikin
On Mon, Sep 6, 2010 at 22:49, Ben midfi...@gmail.com wrote: Sorry to be late coming into this conversation. Something that has bothered me (which I have mentioned to John Lato privately) is that it is very easy to write non-compositional code due to the chunking.  For example, there is a

Re: [Haskell-cafe] ANNOUNCE: Haddock version 2.8.0

2010-09-04 Thread John Millikin
On Fri, Sep 3, 2010 at 23:02, David Menendez d...@zednenem.com wrote: Yes, using foreign namespaces is one of the things recommended against when serving XHTML as text/html. This says nothing about documents following the recommendations in Appendix C. I'm not debating that it's *possible* to

Re: [Haskell-cafe] ANNOUNCE: Haddock version 2.8.0

2010-09-04 Thread John Millikin
On Sat, Sep 4, 2010 at 14:46, Jeremy Shaw jer...@n-heptane.com wrote: So the choices are:  1. only focus on getting the xhtml 1.0 served as application/xml working correctly, and ie users get nothing..  2. create xhtml 1.0 that would work correctly if served as application/xml, but serve it

Re: [Haskell-cafe] Confused about ByteString, UTF8, Data.Text and sockets, still.

2010-09-03 Thread John Millikin
On Fri, Sep 3, 2010 at 05:04, JP Moresmau jpmores...@gmail.com wrote: I have replaced JSon by AttoJson (there was also JSONb, which seems quite similar), which allows me to work solely with ByteStrings, bypassing the calls to utf8-string completely. Performance has improved noticeably. I'm

Re: [Haskell-cafe] ANNOUNCE: Haddock version 2.8.0

2010-09-03 Thread John Millikin
On Fri, Sep 3, 2010 at 20:39, Albert Y. C. Lai tre...@vex.net wrote: In theory, what does file extension matter? Media type is the dictator. The normative Section 5.1 permits the choice of application/xhtml+xml or text/html. While the latter entails extra requirements in the informative

Re: [Haskell-cafe] ANNOUNCE: Haddock version 2.8.0

2010-09-02 Thread John Millikin
On Thu, Sep 2, 2010 at 21:14, Mark Lentczner ma...@glyphic.com wrote: I choose to switch Haddock's output from HTML to XHTML mostly because I have found the consistency of rendering cross-browser to be greater and easier to achieve with XHTML. I'm not alone in this opinion: Many well

Re: [Haskell-cafe] ANNOUNCE: text 0.8.0.0, fast Unicode text support

2010-08-31 Thread John Millikin
Is there a summary of the API changes available? I see a new module, but Precis is choking on Data.Text and Data.Text.Lazy, so I'm not sure what existing signatures have been modified. Don't forget, you can always improve the text library yourself. I love to receive patches, requests for

Re: [Haskell-cafe] Quick Question for QuickCheck2

2010-08-30 Thread John Millikin
Define a custom element generator, which has characters with your desired values: myRange :: Gen Char myRange = elements (['A'..'Z'] ++ ['a' .. 'z'] ++ ~...@#$%^*()) You can use forAll to run tests with a specific generator: forAll myRange $ \c - chr (ord c) == c On Mon, Aug 30, 2010 at

Re: [Haskell-cafe] Quick Question for QuickCheck2

2010-08-30 Thread John Millikin
Update your cabal package list, and then install QuickCheck. Optionally, you can use a version specifier: cabal update cabal install 'QuickCheck = 2' This should make QuickCheck 2 the default in GHCI. If it doesn't, you may need to specify the version: ghci -package QuickCheck-2.2

Re: [Haskell-cafe] Re: Hackage on Linux

2010-08-26 Thread John Millikin
On Thu, Aug 26, 2010 at 20:51, Richard O'Keefe o...@cs.otago.ac.nz wrote: Maybe Linux is different.  One thing is NOT different, and that is Linux upgrades *DO* reliably break programs that use dynamic linking. Dynamic libraries get  - left out  - changed incompatibly  - moved some place

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-25 Thread John Millikin
On Wed, Aug 25, 2010 at 01:33, John Lato jwl...@gmail.com wrote: Is this really true?  Consider iteratees that don't have a sensible default value (e.g. head) and an empty stream.  You could argue that they should really return a Maybe, but then they wouldn't be divergent in other formulations

Re: [Haskell-cafe] Low level problem with Data.Text.IO

2010-08-25 Thread John Millikin
For debugging the error, we'll need to know what your locale's encoding is. You can see this by echoing the $LANG environment variable. For example: $ echo $LANG en_US.UTF-8 means my encoding is UTF-8. Haskell doesn't currently have any decoding libraries with good error handling (that I know

Re: [Haskell-cafe] How to generate dependend values with QuickCheck

2010-08-25 Thread John Millikin
You're generating two random values, where you probably want to just generate one and then calculate the second from it. Try this: instance Arbitrary QCExample where arbitrary = do i1 - arbitrary return (QCExample i1 (i1 * 2)) 2010/8/25 Jürgen Nicklisch-Franken j...@arcor.de:

Re: [Haskell-cafe] Re: ANNOUNCE: enumerator, an alternative iteratee package

2010-08-24 Thread John Millikin
On Tue, Aug 24, 2010 at 05:12, John Lato jwl...@gmail.com wrote: Oleg included the error state to enable short-circuiting of computation, and I guess everyone just left it in.  Recently I've been wondering if it should be removed, though, in favor requiring explicit (i.e. explicit in the type

Re: [Haskell-cafe] Fwd: Semantics of iteratees, enumerators, enumeratees?

2010-08-24 Thread John Millikin
Here's my (uneducated, half-baked) two cents: There's really no need for an Iteratee type at all, aside from the utility of defining Functor/Monad/etc instances for it. The core type is step, which one can define (ignoring errors) as: data Step a b = Continue (a - Step a b)

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-23 Thread John Millikin
After fielding some more questions regarding error handling, it turns out that my earlier mail was in error (hah) -- error handling is much more complicated than I thought. When I gave each iteratee its own error type, I was expecting that each pipeline would have only one or two sources of

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-22 Thread John Millikin
On Sat, Aug 21, 2010 at 23:14, Paulo Tanimoto ptanim...@gmail.com wrote: One question: enumFile has type    enumFile :: FilePath - Enumerator SomeException ByteString IO b and iterParser has type    iterParser :: Monad m = Parser a - Iteratee ParseError ByteString m a How do we use both

Re: [Haskell-cafe] Re: Error in enumerator when using interpreter instead of compiler

2010-08-22 Thread John Millikin
It's certainly a bug in iterFile -- I think it'll have to be modified to close the file on EOF, not after returning a continuation. Semi-working in the compiled version is probably just a quirk of the garbage collector and/or OS. ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Re: Error in enumerator when using interpreter instead of compiler

2010-08-22 Thread John Millikin
Well, now I know why the iteratee package never defined something like iterFile -- it's not really possible. The only way to open handles within an iteratee prevents exception-safe release. enumerator-0.3 will remove the iterFile functions. iterHandle will remain, to be used as in your second

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-21 Thread John Millikin
I think the docs are wrong, or perhaps we're misunderstanding them. Magnus is correct. Attached is a test program which listens on two ports, 42000 (blocking IO) and 42001 (non-blocking). You can use netcat, telnet, etc, to send it data. The behavior is as Magnus describes: bytes from

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-21 Thread John Millikin
On Sat, Aug 21, 2010 at 11:35, Gregory Collins g...@gregorycollins.net wrote: John Millikin jmilli...@gmail.com writes: I think the docs are wrong, or perhaps we're misunderstanding them. Magnus is correct. Attached is a test program which listens on two ports, 42000 (blocking IO) and 42001

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-21 Thread John Millikin
On Sat, Aug 21, 2010 at 11:58, Judah Jacobson judah.jacob...@gmail.com wrote: You should note that in ghc=6.12, hWaitForInput tries to decode the next character of input based on to the Handle's encoding.  As a result, it will block if the next multibyte sequence is incomplete, and it will

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-21 Thread John Millikin
On Sat, Aug 21, 2010 at 12:44, Magnus Therning mag...@therning.org wrote: As an aside, has anyone written the code necessary to convert a parser, such as e.g.  attoparsec, into an enumerator-iteratee[1]? This sort of conversion is trivial. For an example, I've uploaded the attoparsec-enumerator

Re: [Haskell] Re: [Haskell-cafe] ANNOUNCE: enumerator, an alternative iteratee package

2010-08-21 Thread John Millikin
On Sat, Aug 21, 2010 at 14:17, Paulo Tanimoto ptanim...@gmail.com wrote: Cool, but is there a reason it won't work with version 0.2 you just released?  build-depends:    [...]    , enumerator = 0.1 0.2 I noticed that when installing it. Hah ... forgot to save the vim buffer. Corrected

  1   2   >