[Haskell-cafe] Re: package naming policy (was: Please check your dependencies on fgl)

2010-06-08 Thread John Lato
> From: Don Stewart > > ivan.miljenovic: >> Thomas Bereknyei are currently re-writing fgl (just about completely >> from scratch) and we plan to make an initial release to get feedback >> on the API in the next few weeks. >> >> However, I'm sending this email out now to warn people that I highly >

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread John Lato
On Tue, May 4, 2010 at 5:31 PM, Gregory Crosswhite wrote: > > Yes, but I think that it is also important to distinguish between cases where > an error is expected to be able to occur at runtime, and cases where an error > could only occur at runtime *if the programmer screwed up*.  If you struct

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread John Lato
On Tue, May 4, 2010 at 2:09 PM, Limestraël wrote: > 2010/5/4 John Lato >> >> "Crashing at the point of the error" isn't necessarily useful in >> Haskell due to lazy evaluation.  The code will crash when the result >> of the partial function is evaluated

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread John Lato
> From: Rafael Cunha de Almeida > > Ivan Miljenovic disse: >> On 3 May 2010 14:17, aditya siram wrote: >>> I'm a little confused about this too. I've seen many functions defined like: >>> f x = (\s -> ...) >>> which is a partial function because it returns a function and is the same >>> as: >>>

Re: [Haskell-cafe] Proper Handling of Exceptional IEEE Floating Point Numbers

2010-04-23 Thread John Lato
> From: "Barak A. Pearlmutter" > >> ... An invalid comparison evaluating to _|_ is arguably more >> correct, but I personally find the idea of introducing more bottoms >> rather distasteful. > > Too late!  NaN is pretty much the _|_ of IEEE Floating Point. > > That was certainly the intent of the

Re: [Haskell-cafe] lazy-vs-strict, recursive IO (was: memory needed for SAX parsing XML)

2010-04-23 Thread John Lato
(changed the thread title hoping to get some others to weigh in on the recursive I/O scheme presented here) > From: Daniil Elovkov > John Lato wrote: >> >>> Another (additional) approach would be to encapsulate unsafeInterleaveIO >>> within some routine and n

Re: [Haskell-cafe] memory needed for SAX parsing XML

2010-04-22 Thread John Lato
> Message: 8 > Date: Tue, 20 Apr 2010 12:08:36 +0400 > From: Daniil Elovkov > Subject: Re: [Haskell-cafe] memory needed for SAX parsing XML > To: Haskell-Cafe > Message-ID: <4bcd6104.50...@googlemail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Jason Dagit wrote: >> >> >

Re: [Haskell-cafe] hamming distance allocation

2010-04-19 Thread John Lato
> From: Daniel Fischer > > Am Montag 19 April 2010 14:37:33 schrieb John Lato: >> Is it really necessary to use Strings?  I think a packed type, e.g. >> Vector or ByteString, would be much more efficient here. > > Not very much if the strings are fairly short (and th

Re: [Haskell-cafe] hamming distance allocation

2010-04-19 Thread John Lato
> Subject: Re: [Haskell-cafe] hamming distance allocation > > Am Montag 19 April 2010 01:03:14 schrieb Arnoldo Muller: >> Hello all: >> >> I want to generate some hamming distance statistics about a set of >> strings. As explained in another e-mail in this list, I used the >> following code to call

Re: [Haskell-cafe] Floyd Warshall performance (again)

2010-04-16 Thread John Lato
On Fri, Apr 16, 2010 at 5:02 PM, Daniel Fischer wrote: > Am Freitag 16 April 2010 17:41:06 schrieb John Lato: >> > From: Mathieu Boespflug >> > >> > Dear haskell-cafe, >> > >> > I implemented the Floyd Warshall algorithm for finding the shortest

Re: [Haskell-cafe] Floyd Warshall performance (again)

2010-04-16 Thread John Lato
> From: Mathieu Boespflug > > Dear haskell-cafe, > > I implemented the Floyd Warshall algorithm for finding the shortest > path in a dense graph in Haskell, but noted the performance was > extremely poor compared to C. Even using mutable unboxed arrays it was > running about 30 times slower. I rew

[Haskell-cafe] Re: building "encoding" on Windows?

2010-04-01 Thread John Lato
> From: Andrew Coppin > >> A new version is due to be release >> pretty soon (somewhere begin april). It has Mingw and Msys included, and >> also some pre-built binaries like cabal and haddock. > > Plain GHC has included Haddock for a while now. It seems to me that > including the entirity of MinG

[Haskell-cafe] Re: Do I need to roll my own?

2010-03-31 Thread John Lato
Hi Dave, > From: David Leimbach > > I'm looking at iteratee as a way to replace my erroneous and really > inefficient lazy-IO-based backend for an expect like Monad DSL I've been > working for about 6 months or so now on and off. > > The problem is I want something like: > > expect "some String"

[Haskell-cafe] Re: Data Structures GSoC

2010-03-31 Thread John Lato
> From: Roman Leshchinskiy > > On 31/03/2010, at 18:14, Achim Schneider wrote: > >> We have a lot of useful interfaces (e.g. ListLike, Edison), but they >> don't seem to enjoy wide-spread popularity. > > Perhaps that's an indication that we need different interfaces? IMO, huge > classes which gen

[Haskell-cafe] Re: building "encoding" on Windows?

2010-03-29 Thread John Lato
> Message: 20 > Date: Mon, 29 Mar 2010 21:45:49 +0100 > From: > Subject: Re: [Haskell-cafe] building "encoding" on Windows? > To: haskell-cafe@haskell.org > Message-ID: <4bb1117d.5090...@btinternet.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > wagne...@seas.upenn.edu wrote:

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-24 Thread John Lato
ination of class implementations and > compilation flags in a single process would be very useful and would save a > lot of manual testing. > > 2010/3/24 John Lato >> >> Hi Alberto, >> >> To some extent this already exists, it's just that nobody uses it.  I >

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-24 Thread John Lato
Hi Alberto, To some extent this already exists, it's just that nobody uses it. I believe it's the approach taken by the Edison libraries. Also the ListLike package provides the type classes ListLike, StringLike, and a few others. Neither seems to have become very popular despite having well-res

Re: [Haskell-cafe] Iteratee performance

2010-03-19 Thread John Lato
I think this is a bit easier to write with iteratee-HEAD. There are some significant changes from the 0.3 version, and not all the old functions are implemented yet, however the "cnt" iteratee can be written as: cnt :: Monad m => I.Iteratee S.ByteString m Int cnt = I.liftI (step 0) where st

Re: [Haskell-cafe] Parsec to parse tree structures?

2010-03-15 Thread John Lato
Hi Dave, > From: david fries > > Hello Café > > Some time ago I wrote a parser for a project of one our customers. The > format was proprietary and binary. The data was structured as a tree > with tables pointing to sub tables farther in the file. (Well actually > there was one or two cases where

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread John Lato
> From: zaxis > > So if the local variable can be changed, then we can use loop, etc. same as > imperative languages. For example, for (i=0; i<100; i++)  where `i` is a > local variable in function. > In addition to John Millikin's suggestion, you can also do: map f [0..99] where f :: Int ->

[Haskell-cafe] Re: First time haskell - parse error!

2010-03-10 Thread John Lato
> From: Ketil Malde > > "S. Doaitse Swierstra" writes: > >>>      then (s1 ++ s2 ++ s3 ++ s4) where >>>              s1 = "Golds " >>>              s2 = show (gold s g) >>>              s3 = ", Silvers " >>>              s4 = show (silver s g) > >> If you want to keep the definitions local to the

[Haskell-cafe] Re: Testing and module export lists

2010-02-24 Thread John Lato
> From: Magnus Therning > > How do people who like unit testing / property testing deal with export lists? > > I often find that I do want an export list to reduce clutter in the > finished code, but for testing I'd like to expose everything in a > module.  Is there a nice way to deal with this (u

[Haskell-cafe] data-accessor-template-0.2.1.3 breaks cabal-install with ghc-6.12

2010-02-12 Thread John Lato
Hello, I've recently run across an odd situation. I have a brand new install of GHC-6.12.1 (just did a fresh install of OSX 10.6), and am reinstalling some libraries. I've run into an unusual problem. I'm not sure if this would be considered a cabal bug or not, but I don't think it's a good sit

Re: [Haskell-cafe] Re: Haskell-Cafe Digest, Vol 78, Issue 14

2010-02-12 Thread John Lato
On Fri, Feb 12, 2010 at 10:32 AM, Maciej Piechotka wrote: > On Thu, 2010-02-11 at 17:49 -0600, John Lato wrote: >> On Thu, Feb 11, 2010 at 10:00 AM, Gregory Collins >> wrote: >> > Maciej Piechotka writes: >> > >> >> On Tue, 2010-02-09 at 16:41 +

Re: [Haskell-cafe] Re: Haskell-Cafe Digest, Vol 78, Issue 14

2010-02-11 Thread John Lato
On Thu, Feb 11, 2010 at 10:00 AM, Gregory Collins wrote: > Maciej Piechotka writes: > >> On Tue, 2010-02-09 at 16:41 +0000, John Lato wrote: >>> >>> See http://inmachina.net/~jwlato/haskell/ParsecIteratee.hs for a valid >>> Stream instance using iteratee

Re: [Haskell-cafe] Iteratee, parsec & co.

2010-02-09 Thread John Lato
> From: Edward Kmett > > 3. Why Seek FileOffset is error message? >> > > I'm not quite sure what you're asking here. One of the infelicities of iteratee-0.3 is that it defines a data type: > data ErrMsg = Err String > | Seek FileOffset > deriving (Show, Eq) I believe

[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 78, Issue 14

2010-02-09 Thread John Lato
Edward's reply was quite good. I'll just try to fill in a few items he didn't address. > From: Maciej Piechotka > > I read a lot about iteratee IO and it seemed very interesting > (Unfortunately it lacks tutorial). Especially features like 'no input > yet' in network programming (with lazy IO +

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-08 Thread John Lato
Hi Stephen, > From: Stephen Tetley > > Hi John > > I'm not sure about making Binding polymorphic to get Functor, > Traversable, Foldable... > > While I think you're correct that partitionEithers might not be a > useful example to draw from in this case, I'd assume that Binding > would be part of

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-06 Thread John Lato
> From: Aran Donohue > > Hi Haskell-Cafe, > > Consider a data type such as > > data Binding = Binding Var (Either Value [Value]) > > representing a variable bound either to a fixed value or that has a list of > possible values. > > I'd like to perform an operation on say, the fixed-value members o

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-06 Thread John Lato
uch faster at chunk size 1, but slower with 100-element > chunks. > > On Fri, Feb 5, 2010 at 08:56, John Lato wrote: >> On Fri, Feb 5, 2010 at 4:31 PM, Valery V. Vorotyntsev >> wrote: >>>> John Lato wrote: >>>> >>>>> Both designs app

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-05 Thread John Lato
On Fri, Feb 5, 2010 at 4:31 PM, Valery V. Vorotyntsev wrote: >> John Lato wrote: >> >>> Both designs appear to offer similar performance in aggregate, >>> although there are differences for particular functions.  I haven't >>> yet had a chance to test

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-05 Thread John Lato
> Subject: Re: [Haskell-cafe] safe lazy IO or Iteratee? > > Downside: iteratees are very hard to understand. I wrote a > decently-sized article about them trying to figure out how to make > them useful, and some comments in one of Oleg's implementations > suggest that the "iteratee" package is subt

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread John Lato
ners ask the cafe about "handle closed before data could be read" errors, and also the proliferation of IO libraries. I know which I approach I think represents the best way forward, but I would be surprised if there was a community consensus at this point. In any case, I'm gl

Re: [Haskell-cafe] matrix question

2010-02-03 Thread John Lato
> From: Ivan Lazar Miljenovic > > man writes: >> http://hackage.haskell.org/package/hmatrix-0.8.1.1 >> >> it wraps gls, blas and lapack (so you need to install the libraries). > > There's also the blas package if you just want blas support. I've been using blas recently with very good results.

Re: [Haskell-cafe] Very imperfect hash function

2010-01-31 Thread John Lato
On Fri, Jan 29, 2010 at 9:26 AM, Hans Aberg wrote: > On 29 Jan 2010, at 15:57, John Lato wrote: > >> Are you >> basically just suggesting to stick everything in an array with the key >> as an index? > > You still need to fold the key values onto some interval. N

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread John Lato
On Fri, Jan 29, 2010 at 12:46 PM, Hans Aberg wrote: > On 29 Jan 2010, at 12:52, John Lato wrote: > >>> There are minimal perfect hash functions; there are some libraries >>> mentioned here, though they are not in Haskell code: >>>  http://en.wikipedia.org/wiki/P

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread John Lato
> From: Hans Aberg > > On 28 Jan 2010, at 20:07, Steve Schafer wrote: > >> The data are currently in a large lookup table. To save space, I'd >> like >> to convert that into a sort of hash function: >> >> hash :: key -> value >> >> My question is this: Is there any kind of generic approach that ca

Re: [Haskell-cafe] Type level splices and instance deriving

2010-01-25 Thread John Lato
Hello, > From: Khudyakov Alexey > Hello > > However I run into problem with them. It's possible to create instance for > type class which doesn't have superclass. If it does have one compiler > complains that it could not deduce context. All my attempts to provide context > fail. What have you t

[Haskell-cafe] Re: Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread John Lato
> From: Heinrich Apfelmus > Don Stewart wrote: >> jmillikin: >>> Here's the fastest Haskell version I could come up with. It discards >>> all error handling, validation, and correctness in the name of >>> performance, but still can't get anywhere near C: >>> http://hpaste.org/fastcgi/hpaste.fcgi/v

Re: [Haskell-cafe] hsql won't install due to system.time

2010-01-22 Thread John Lato
Hello, Could this be a global/user install issue? That is, if the old-time package is installed per-user, and you're trying to install a package globally, the user-installed packages all show up as hidden, because they can't be dependencies of a global install. This shows up frequently because g

Re: [Haskell-cafe] Parsers (Parsec and Iteratee-based Parsers)

2010-01-11 Thread John Lato
t was >> parsec that got me started with Haskell. > > I think you should be in contact with John Lato.  Last time we had > correspondence he mentioned a hybrid between iteratees and parsec. > I don't know if I'd call it a hybrid, however there is a way to embed Parsec p

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-19 Thread John Lato
> From: Felipe Lessa > > On Fri, Dec 18, 2009 at 02:13:02PM +0000, John Lato wrote: >> So now the program needs a result of some type (String in your >> example) and gets an undefined, and then immediately crashes >> with an "Exception - undefined" error. >

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-18 Thread John Lato
Hello, > Date: Fri, 18 Dec 2009 13:04:47 +0100 > From: Andr?s Mocs?ry > > > switch 1 =  "Unchecked" > > switch 2 =  "Checked" > > switch 3 =  "Unknown" > > switch x =  "Nothing" > > These general ways really avoid this particular crash, but does something > real bad to the code in my opinion. ..

[Haskell-cafe] Re: A new form of newtype

2009-12-09 Thread John Lato
> From: "Richard O'Keefe" > Subject: Re: [Haskell-cafe] A new form of newtype > > People are now writing EDSLs using Haskell to generate code for > all sorts of interesting things.  What if you want to use Haskell > as a host for an EDSL targeted at a 24-bit DSP? *plug* for this specific case, I

[Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-08 Thread John Lato
> From: Andrew Coppin > > John Lato wrote: > >> The only workable approach is to have users specify the >> locations of these files, which unfortunately requires more >> sophistication than can be expected of most Windows users (and even >> some Windows de

[Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-07 Thread John Lato
To reply to an earlier point of Andrew's (I can't find the quote now, sorry), one of the biggest difficulties developers face on Windows is the lack of common install locations/practices. Windows software is usually distributed as a binary, which may or may not include header files. These files m

[Haskell-cafe] Re: Low Level Audio - Writing bytes to the sound card?

2009-12-04 Thread John Lato
> From: M Xyz > >> if you get it to work > > As a spoiled Java programmer, this new role as pioneer is a bit intimidating, > but I will give it a shot. :) > > I downloaded the portaudio v19 source and I'm attempting to build it. > Apparently I have to register my Visual Studio Express with Micro

[Haskell-cafe] Re: seems like I'm on the wrong track

2009-12-03 Thread John Lato
> From: Henning Thielemann > > Michael P Mossey schrieb: >> Perhaps someone could either (1) help me do what I'm trying to do, or >> (2) show me a better way. >> >> I have a problem that is very state-ful and I keep thinking of it as OO, >> which is driving me crazy. Haskell is several times harde

[Haskell-cafe] Re: Are there standard idioms for lazy, pure, error handling?

2009-11-30 Thread John Lato
> From: Bas van Dijk > > On Mon, Nov 30, 2009 at 6:22 AM, John Millikin wrote: >> ...I've considered two possible error handling modes... > > Regarding parsing, there's a third option: iteratees[1]. See [2] for a > motivation and description of iteratees. > I think it's interesting to note that

[Haskell-cafe] advice for dispatch question

2009-11-02 Thread John Lato
Hello, I've been thinking about a problem recently, and would like to know if there are any recommendations for a solution. I have two container-like type classes, defined as follows: > import Control.Monad > > type family ElemOf c :: * > type family MonadOf c :: * -> * > > class PureContainer c

[Haskell-cafe] Re: MTL vs Transformers?

2009-10-13 Thread John Lato
> From: Erik de Castro Lopo > > Well Iteratee built with MTL passes all the tests that shipped with it > so I suppose it must be correct. > Unfortunately the iteratee tests aren't exhaustive, but if it builds with MTL it should work. I'm more surprised that it built just by changing the .cabal f

[Haskell-cafe] Re: Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-12 Thread John Lato
> From: Derek Elkins > > On Sun, Oct 11, 2009 at 8:55 AM, Iain Barnett wrote: >> >> On 11 Oct 2009, at 13:58, John Lato wrote: >> >>> For anyone writing introductions to generic programming, take this as >>> a plea from Haskellers everywhere.  If on

[Haskell-cafe] Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-11 Thread John Lato
For anyone writing introductions to generic programming, take this as a plea from Haskellers everywhere. If one of the RWH authors can't understand how to make use of these techniques, what hope do the rest of us have? John Lato P.S. Some might wryly note that I'm the maintainer of

[Haskell-cafe] Re: Looking for a new HWN editor

2009-09-08 Thread John Lato
I'd just like to say a big "Thank you" to Brent for his service as the HWN editor. I appreciate it very much and always look forward to HWN. Thanks for all your work, Brent. Cheers, John > > Message: 11 > Date: Sat, 5 Sep 2009 17:26:08 -0400 > From: Brent Yorgey > Subject: [Haskell-cafe] Lookin

Re: [Haskell-cafe] Re: memoization

2009-09-06 Thread John Lato
On Sun, Sep 6, 2009 at 4:30 PM, Daniel Fischer wrote: > Am Sonntag 06 September 2009 13:36:57 schrieb John Lato: >> I just discovered that changing DiffArray to a plain Array improves >> performance of my code by almost a factor of 10.  Bitten by DiffArray >> yet agai

[Haskell-cafe] Re: memoization

2009-09-06 Thread John Lato
I just discovered that changing DiffArray to a plain Array improves performance of my code by almost a factor of 10. Bitten by DiffArray yet again! John -- this is no good, just change DiffArray to Array. > update :: (Char -> [Int]) -> DiffArray Int ModP -> Char -> DiffArray Int ModP > update lo

[Haskell-cafe] Re: memoization

2009-09-06 Thread John Lato
Hello, I agree that your answer is elegant, but it's not an efficient algorithm in any language. How about this, keeping the rest of your code the same? import Data.Array.Diff import Data.IArray update :: (Char -> [Int]) -> DiffArray Int ModP -> Char -> DiffArray Int ModP update lookup arr c =

[Haskell-cafe] Re: Problem on existential type.

2009-09-05 Thread John Lato
Also, the two definitions for liftGW are exactly equivalent. You have: liftGW (GridWidget label) f = f label liftGW (GridWidget textView) f = f textView The only difference between the two is name to which the data parameter to GridWidget is bound, which doesn't change the meaning at all. You s

[Haskell-cafe] Re: quick and dirty file parsing (was: no subject)

2009-08-22 Thread John Lato
] -> [[a]] groupN n [] = [] groupN n xs = let (h,t) = splitAt n xs in h:groupN n t Or, for a nonrecursive version: groupN2 = fix g where g f n [] = [] g f n xs = let (h,t) = splitAt n xs in h: f n t but that's probably not what you had in mind. I've found that using unfoldr is simpler than fold if you wish to use HOFs to accomplish this, but neither is as simple as explicit recursion. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: How to convert a list to a vector encoding its length in its type?

2009-08-21 Thread John Lato
l vectors, which I found helpful when faced with the same problem recently [3], [4]. Cheers, John Lato [1] http://hackage.haskell.org/package/type-level [2] http://www.ict.kth.se/forsyde/files/tutorial/apa.html [3] http://inmachina.net/~jwlato/haskell/iter-audio/src/Sound/Iteratee/Channelized

Re: [Haskell-cafe] containers and maps

2009-08-13 Thread John Lato
On Thu, Aug 13, 2009 at 1:51 PM, Jake McArthur wrote: > John Lato wrote: >> > >> This might work with UVector (I intend to try it this evening); I >> don't know how well the fusion framework will hold up in class >> dictionaries. > > Do report back, as I

[Haskell-cafe] Re: unsafeDestructiveAssign?

2009-08-13 Thread John Lato
> From: John Meacham > Subject: Re: [Haskell-cafe] unsafeDestructiveAssign? > On Wed, Aug 12, 2009 at 06:48:33PM +0100, John Lato wrote: > > On Wed, Aug 12, 2009 at 2:39 PM, Derek Elkins > wrote: > > > > > > (To Alberto as well.) > > > > &

Re: [Haskell-cafe] containers and maps

2009-08-13 Thread John Lato
On 8/13/09, Jake McArthur wrote: > Jake McArthur wrote: > > > The monoids package offers something similar to this: > > > >    mapReduce :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> m > > > > If we take (Elem c) to be (item), (e) to be (item'), (c) to be (full), and > (m) to be (full'),

[Haskell-cafe] containers and maps

2009-08-12 Thread John Lato
ly need to write the whole thing when you're actually using map, and then it'll include the ListLike instance automatically. Obviously this isn't so much one container class to rule them all as it is a set of classes that all work together, but as long as it's sensible that'

Re: [Haskell-cafe] unsafeDestructiveAssign?

2009-08-12 Thread John Lato
On Wed, Aug 12, 2009 at 2:39 PM, Derek Elkins wrote: > > (To Alberto as well.) > > Unsurprisingly, Lennart stated the real issue, but I'll re-emphasize > it.  As much trouble as such a profound violation of purity would > cause, it's not the biggest problem.  If that were all, you could > easily wr

[Haskell-cafe] unsafeDestructiveAssign?

2009-08-12 Thread John Lato
Hi Job, I don't think this hypothetical function could exist; you may as well call it "notEverSafeOhTheHumanity" and be done with it. Since Haskell provides no guarantees about when (if ever) any given function/data will be evaluated, you would need some mechanism to tell the compiler that a dat

[Haskell-cafe] Re: Examples

2009-08-11 Thread John Lato
e code. This also answers the question of where to put executables that are Buildable but not Installable. Thoughts? Cheers, John Lato > Date: Sun, 9 Aug 2009 21:07:53 -0400 > From: "John D. Ramsdell" > Subject: Re: [Haskell-cafe] Examples > To: Haskell Cafe > Message

[Haskell-cafe] Re: Strange memory usage problem

2009-07-31 Thread John Lato
GHC inlines it automatically. Since getRB is also called in the commented-out code, it probably isn't automatically inlined when that code is available. I suspect that the inlining allows GHC to infer some strictness property it otherwise can't. Cheers, John Lato

[Haskell-cafe] Re: Problems with nested Monads

2009-07-15 Thread John Lato
his join-like function: join2 :: (Monad n) => n (StateT s n a) -> StateT s n a join2 m = StateT (\state -> m >>= flip runStateT state) (I don't know a good name for this function; it's called "joinIM" in iteratee) Perhaps this would apply to your situation? Chee

[Haskell-cafe] Re: iteratee enumHandle (and parsing)

2009-07-14 Thread John Lato
d onto all the data until you've loaded enough to run it. If you tell me what functions you find lacking from iteratee, I'll look into implementing them. I'd rather not re-implement all of Parsec, but the text parsers should be simple enough, as well as some of the combinators.

[Haskell-cafe] Re: Monad Input/Output and Monad Transformers

2009-07-03 Thread John Lato
al solution is to define custom lifting functions for the most commonly performed operations. However, my feeling is that you're probably trying to put together a monad stack to model what you're trying to do too soon, when you'd be better served trying to develop data s

[Haskell-cafe] Re: Strange type error with associated type synonyms

2009-06-04 Thread John Lato
ontrived, but I don't have any real code to hand because I've fixed it already. You get a better message if you give a type signature for 'bar', but that requires lexical scoping (at least in my case), which means the code would no longer be Haskell98 (which it otherwise is IIRC). Cheers, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: A problem with par and modules boundaries...

2009-05-22 Thread John Lato
;s happening in more detail by going through the Core output. John Lato > Message: 23 > Date: Thu, 21 May 2009 22:59:51 -0400 > From: Mario Bla?evi? > Subject: [Haskell-cafe] A problem with par and modules boundaries... > To: > Message-ID: <.1242961...@magma.ca> >

[Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-15 Thread John Lato
leimy2k: > On Thu, May 14, 2009 at 8:46 PM, Don Stewart wrote: > >> leimy2k: >> > >> > >> > On Thu, May 14, 2009 at 8:40 PM, Don Stewart wrote: >> > >> >     leimy2k: >> >     > I actually need little endian encoding... wondering if anyone else >> hit >> >     this >> >     > with Data.Binary. (b

Re: [Haskell-cafe] Re: Configuring cabal dependencies at install-time

2009-04-07 Thread John Lato
at it too. I could provide a wide array > of instances for different stock data types, and I could know that if > someone depends on both, say,  'monoids' and 'parsec 3' that the parsec > instances will be present and usable in my package. > > Most importantly, it wou

[Haskell-cafe] Re: Configuring cabal dependencies at install-time

2009-04-07 Thread John Lato
but then the total packages on hackage would explode. I don't feel great about doing that with my own packages either; is it a problem? If so, maybe there could be just one extra package, e.g. buster and buster-extras. Is there a better solution I'm missing? John Lato

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-31 Thread John Lato
On Mon, Mar 30, 2009 at 11:03 PM, Henning Thielemann wrote: > > On Sun, 29 Mar 2009, John Lato wrote: > >> On Sat, Mar 28, 2009 at 9:49 PM, Henning Thielemann >> wrote: >>> >>> On Sat, 28 Mar 2009, John Lato wrote: >>> >>>> Honest

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-29 Thread John Lato
On Sat, Mar 28, 2009 at 9:49 PM, Henning Thielemann wrote: > > On Sat, 28 Mar 2009, John Lato wrote: > >>> From: Donn Cave >>> >>> I have never felt that I really understood that one. >> >> Honestly, me neither, until recently.  I'm onl

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread John Lato
st> > Content-Type: text/plain; charset=utf-8 > > On Fri, 2009-03-27 at 20:38 +0300, Gregory Petrosyan wrote: >> On Fri, Mar 27, 2009 at 7:31 PM, Donn Cave wrote: >> > Quoth John Lato , >> > >> >> An exception is caused by some sort of interaction

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread John Lato
> From: Donn Cave > Quoth John Lato , > >> An exception is caused by some sort of interaction with the run-time >> system (frequently a hardware issue).  The programmer typically can't >> check for these in advance, but can only attempt to recover after >> th

Re: [Haskell-cafe] Re: Use unsafePerformIO to catch Exception?

2009-03-27 Thread John Lato
On Fri, Mar 27, 2009 at 9:51 PM, Jason Dusek wrote: > 2009/03/27 John Lato : >> From: Jules Bean >> > wren ng thornton wrote: >> > > The type of head should not be [a] -> a + Error, it should >> > > be (a:[a]) -> a. With the latter type the com

[Haskell-cafe] Re: Use unsafePerformIO to catch Exception?

2009-03-27 Thread John Lato
;head' is necessary. Couldn't you always replace it with a case statement, with undefined on [] if necessary? I won't deny that it's extremely useful, though! John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread John Lato
On Fri, Mar 27, 2009 at 10:01 AM, Gregory Petrosyan wrote: > Thanks a lot for the answer! > > On Thu, Mar 26, 2009 at 4:36 PM, John Lato wrote: >> Languages with checked exceptions usually use them for two purposes: >> >> 1.  Exceptional conditions - disk full, CPU

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread John Lato
> Message: 15 > From: Xiao-Yong Jin > John Lato writes: > > So I have another question.  Is the following function safe > and legitimate? > >> safeDiv :: (Exception e, Integral a) => >>            a -> a -> Either e a >> safeDiv x y = unsafePerfo

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread John Lato
so some of these thoughts may be a bit loose for the moment. In particular my thoughts from the above paragraph have only recently become clear. Henning T., FYI your constant advocacy has gotten at least one person around to this view. Cheers, John Lato ___

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

2009-03-26 Thread John Lato
category theory newbies as well (at least I found it so). It really should go on a wiki somewhere. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: How to increment an Int in Haskell (stack overflow issue)

2009-03-25 Thread John Lato
> From: Tim Bauer > > I have a program that is currently blowing out the stack, >    Stack space overflow: current size 8388608 bytes. >    Use `+RTS -Ksize' to increase it. > I am pretty sure I get to the end of the computation that > increments various statistic counters (lazily?) and only > whe

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-25 Thread John Lato
> Jake McArthur writes: > >> Xiao-Yong Jin wrote: >> | The problem is that there will be many functions using such >> | a function to invert a matrix, making this inversion >> | function return Either/Maybe or packing it in a monad is >> | just a big headache. >> >> I disagree. If you try to take

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-04 Thread John Lato
> John A. De Goes schrieb: > >> Elsewhere, laziness can be a real boon, so I don't understand your >> question, "Why have laziness in Haskell at all?" > > As I have written, many libaries process their data lazily (or could be > changed to do so without altering their interface) but their interface

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-04 Thread John Lato
On Tue, Mar 3, 2009 at 1:03 AM, Henning Thielemann wrote: > > On Mon, 2 Mar 2009, John Lato wrote: > > While I think that the Iteratee pattern has benefits, I suspect that it > can't be combined with regular lazy functions, e.g. of type [a] -> [a]. Say > I have a chain

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-02 Thread John Lato
allowed for seekable resources. So you've managed to achieve many of the benefits of lazy IO (composability, generality, and efficiency) without the drawbacks. Furthermore resources are managed strictly and released as soon as possible. I hope this is helpful. Cheers, John Lato > Me

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread John Lato
Hi Don, Would you please elaborate on what features or capabilities you think are missing from left-fold that would elevate it out of the special purpose category? I think that the conception is so completely different from bytestrings that just saying it's not a bytestring equivalent doesn't giv

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread John Lato
Hello, I'm not sure that I would call it a general-purpose resource preserving technique. As I understand it, the general concept is a means to handle strict data processing in a functional manner. Any "resource preserving" that comes from this is actually from the use of strict IO rather than l

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-02-28 Thread John Lato
rs would like to explore more fully. The results of that research will likely find there way into this library. Sincerely, John Lato > Hi all, > > in the last few months I was looking for haskell database library, > eventually settling for HDBC (thanks John btw). > > Takusen al

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-26 Thread John Lato
on't think anyone has spoke ill > of a "+hackage" flag. > I would agree with Haskell Platform as default search, and also with a +hackage flag. I would also support platform-specific flags if they were simple to implement. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-26 Thread John Lato
> John Lato writes: > >> Brandon Allbery wrote: >>> On 2009 Feb 21, at 20:47, Jonathan Cast wrote: >>>> On Sat, 2009-02-21 at 07:25 -0700, John A. De Goes wrote: > >>>>> Not showing platform-specific packages by default *might* make >>

[Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
Achim Schneider wrote: > John Lato wrote: >> On Wed, Feb 25, 2009 at 4:45 PM, Brandon S. Allbery KF8NH >> wrote: >> > On 2009 Feb 25, at 5:23, John Lato wrote: >> >> >> >> Brandon Allbery wrote: >> >>> >> >>> I hav

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
On Wed, Feb 25, 2009 at 3:49 PM, Jonathan Cast wrote: > On Wed, 2009-02-25 at 10:23 +0000, John Lato wrote: >> 4.  Cross-platform concerns are something that responsible developers >> need to consider, just like localization and i18n.  I.e., why >> *shouldn't* you thi

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
On Wed, Feb 25, 2009 at 4:45 PM, Brandon S. Allbery KF8NH wrote: > On 2009 Feb 25, at 5:23, John Lato wrote: >> >> Brandon Allbery wrote: >>> >>> I have to second this; I'm a Unix sysadmin, 98% of the time if I'm >>> writing a program it'

[Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
is particularly tied to a Posix (or Windows) feature, and it wouldn't make sense to attempt a cross-platform version. If you're a Unix sysadmin and you use Haskell, that may be true most or all of the time. But for many packages, including most packages on hackage, it should be given consid

<    1   2   3   4   >