Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread timothyhobbs
I'm not sure that there is anything "great" about this bug.  It seems to me to be a rather severe demonstration of a somewhat already known design flaw in the runtime :( Could you please comment on the actual bug rather than replying here so that the devs see that this behaviour has been confirm

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread timothyhobbs
This seems like a bug in GHC. But it has nothing to do with MVars.  I've narrowed this down and filed a bug report here: http://hackage.haskell.org/trac/ghc/ticket/7528 Timothy -- Původní zpráva -- Od: Yuras Shumovich Datum: 24. 12. 2012 Předmět: Re: [Haskell-cafe] multi-threa

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread timothyhobbs
The real question is, does this mean that GHC is stopping the world every time it puts an MVar? Tim -- Původní zpráva -- Od: Brandon Allbery Datum: 24. 12. 2012 Předmět: Re: [Haskell-cafe] multi-thread and lazy evaluation " On Mon, Dec 24, 2012 at 8:45 AM, Corentin Dupont mail

Re: [Haskell-cafe] Simple GUI Form

2012-12-01 Thread timothyhobbs
Also GTK, but I ran across this a little while ago http://hackage.haskell. org/package/barrie not sure if it still builds as it's a bit old, but it looked interesting. -- Původní zpráva -- Od: Rune Harder Bak Datum: 1. 12. 2012 Předmět: Re: Re: [Haskell-cafe] Simple GUI Form "S

Re: [Haskell-cafe] Simple GUI Form

2012-12-01 Thread timothyhobbs
I created that for a specific application I was writing, where I was saving the data directly to disk.  I modularized as an afterthought.  But I don't see anything wrong with using types that have JS in their names.  It is STILL a haskell data structure.  Just one which can be converted to a re

Re: [Haskell-cafe] Simple GUI Form

2012-11-29 Thread timothyhobbs
I know it's not wx, but if you were willing to use GTK, you could simply install: http://hackage.haskell.org/package/gtk-jsinput and generate the form automatically as described in: https://github.com/timthelion/gtk-jsinput/blob/master/Graphics/UI/Gtk/ Custom/JSInput.hs Timothy -

Re: [Haskell-cafe] Real-time code in Haskell (Was: Can a GC delay TCP connection formation?)

2012-11-27 Thread timothyhobbs
What triggers GC in haskell?  We obviously aren't using Java's method of GC as needed(for good reasons, Java's method is terrible because you get slow downs when you need speed the most).  But we should be able to learn something from Java and have a gc::IO() method that one could call BEFORE a

Re: [Haskell-cafe] Can a GC delay TCP connection formation?

2012-11-27 Thread timothyhobbs
Could you give us more info on what your constraints are?  Is it necessary that you have a certain number of connections per second, or is it necessary that the connection results very quickly after some other message is received? -- Původní zpráva -- Od: Johan Tibell Datum: 27

Re: [Haskell-cafe] A small step towards solving cabal hell.

2012-11-18 Thread timothyhobbs
You are correct this won't help(and may even hurt) in places where there is true mutual inter-dependency between parts of libraries.  But I gave examples where I was sure this was not the case. Timothy -- Původní zpráva -- Od: Brandon Allbery Datum: 18. 11. 2012 Předmět: Re: [

Re: [Haskell-cafe] A small step towards solving cabal hell.

2012-11-18 Thread timothyhobbs
I understand your concern.  Of course with cabals current implementation this proposal requires a lot of fluff.  I thought about implementing a cabal syntax directly into Haskell pragmas, getting rid of the cabal file format entirely.  I think that would be a pie in the sky optimum.  However, I

Re: [Haskell-cafe] A small step towards solving cabal hell.

2012-11-18 Thread timothyhobbs
Well in some cases, it might not be easy to break up the libraries.  If there is sufficient mutual dependency, doing so won't even help the situation.  However, I already looked at the code to some large libraries, such as xmonad-contrib, and gtk2hs and am certain that no code modifications are

[Haskell-cafe] A small step towards solving cabal hell.

2012-11-18 Thread timothyhobbs
I've read a lot of negative regarding the problems with cabal and hackage. I've written quite a few of them myself. I want to propose a simple change in philosophy of packages. Haskell has inherited a philosophy from the imperative world, that there are two types of packages: Libraries and applic

Re: [Haskell-cafe] List all multiply/add combinations

2012-11-17 Thread timothyhobbs
This smells like homework to me, which isn't a bad thing, it will however change the way I answer you. Please look at http://hackage.haskell.org/packages/archive/base/latest/doc/ html/Data-List.html#v:permutations and show us your attempts to use this function. Timothy -- Původní zpráva

Re: [Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-13 Thread timothyhobbs
I agree with Andreas, we need a "package recall" method.  This should be an ability granted only to certain people, so that all of hackage cannot be deleted by one rogue user with recall privileges, but this is still a necessary feature. Timothy -- Původní zpráva -- Od: Andrea

[Haskell-cafe] hackageDB haddock errors

2012-11-13 Thread timothyhobbs
Hello, There are several packages without haddock documentation on hackage.  The one that bugs me right now, is the latest version of gtk2hs: http://hackage. haskell.org/package/gtk I've been told that this may be due to hackage updating docs with an infrequent cron job, so that new packages don

Re: [Haskell-cafe] Hard drive thrashing with modern controllers

2012-11-10 Thread timothyhobbs
Hmm.  I was hoping for good news that things had changed for the better :( .   I want these files to be on the disk so I don't lose data in the case of failure.  A common solution here is to acidify the program, but that is not acceptable from a usability standpoint.  I don't want to have the use

[Haskell-cafe] Hard drive thrashing with modern controllers

2012-11-10 Thread timothyhobbs
Hello, I have a very general question that doesn't exactly relate to Haskell.  Do I need to worry about hard drive thrashing with a modern controller?  I understand, that such "thrashing" can significantly reduce the lifespan of modern SSD drives. For example, if I do: import Control.Monad foo

Re: [Haskell-cafe] Where is the documentation on exception types kept?

2012-11-07 Thread timothyhobbs
Thanks!  That is a neat way.  At least for exceptions which I know to exists and know how to trigger ;) Tim -- Původní zpráva -- Od: Albert Y. C. Lai Datum: 7. 11. 2012 Předmět: Re: [Haskell-cafe] Where is the documentation on exception types kept? "On 12-11-07 03:36 PM, timoth

Re: [Haskell-cafe] Where is the documentation on exception types kept?

2012-11-07 Thread timothyhobbs
I really like to be able to find these things in documentation and if not documentation than source code.  However thank you for your reply, in this case it has helped me :) Timothy -- Původní zpráva -- Od: Simon Hengel Datum: 7. 11. 2012 Předmět: Re: [Haskell-cafe] Where is th

[Haskell-cafe] Where is the documentation on exception types kept?

2012-11-07 Thread timothyhobbs
Hello, I am trying to catch an "thread blocked on MVar indefinitely exception."  Of course I can use ::SomeException as explained in http://hackage.haskell.org/ packages/archive/base/latest/doc/html/Control-Exception.html#g:3 but there is no explanation as to how to find the more case specific exc

[Haskell-cafe] Cross platform method for getting the /actual/ contents of a directory

2012-11-07 Thread timothyhobbs
Hello, I'm writing a function to find out if a given directory is empty.  I came up with the obvious: do{  contents <-  getDirectoryContents "/home/timothy/works/current/anonGraph/ empty/" ;  let   realContents     =   filter    (\file -> case file of    "." -> False ;    ".." -> Fals

Re: [Haskell-cafe] Is XMonad still developed or with a current maintainer?

2012-11-05 Thread timothyhobbs
I am subscribed to the xmonad mailing list. But the question still stands.  The list is pretty quiet and it seems xmonad is maintainerless :( -- Původní zpráva -- Od: Roman Cheplyaka Datum: 5. 11. 2012 Předmět: Re: [Haskell-cafe] Is XMonad still developed or with a current main

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-29 Thread timothyhobbs
To be clear, the project ArchHaskell has little or no relation to my original post.  If I understand correctly, ArchHaskell is a set of Arch uses who attempted to repackage the packages in hackage in the AUR.  This addresses issues of package management that are unrelated to my complaint.  My co

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-28 Thread timothyhobbs
Actually Arch has been accommodating in other cases when there was a stable library and a new/developing.  It certainly keeps around two versions of python, autoconf, GTK, qt, gambas...  The solution I'm proposing would be a little different than those cases, but on the same principle. Timothy

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-28 Thread timothyhobbs
I didn't wish to suggest that the latest version shouldn't be available.  If you read my entire message, the suggestion I made, is that arch should install the latest with the next to latest in parallel and do so by default rather than as some weird and hacky work-around. Sending pull request

[Haskell-cafe] GHC maintenance on Arch

2012-10-28 Thread timothyhobbs
Hello, Who is in charge of the ghc and haskell packages on Arch linux?  The current system isn't working. Arch linux tends to update packages very quickly. For ghc, always having the latest ghc isn't a good thing.  At least if you actually want to get some work done.  A majority of the time the

Re: [Haskell-cafe] Either Monad and Laziness

2012-09-11 Thread timothyhobbs
Use a tuple: (Result,Maybe Error) rather than an Either.  Do everything lazily, and in the case of an error, undo the result. -- Původní zpráva -- Od: Eric Velten de Melo Datum: 11. 9. 2012 Předmět: [Haskell-cafe] Either Monad and Laziness "Hello, I am currently trying to rewrit

Re: [Haskell-cafe] hstats median algorithm

2012-09-03 Thread timothyhobbs
Aha!!!  Now it's working.  Just had to compile with -O2 :D :D Now I'm over twice as fast for a list of 2 million!  With better length based analysis of how many buckets should be used, this number can be improved. You can feel free to use my code however you like.  I've attached the final version

Re: [Haskell-cafe] hstats median algorithm

2012-09-03 Thread timothyhobbs
Thanks for the advice.  After taking most of it it is faster.  But it is still many times slower than it ought to be!  This algorithm should be much faster than simply sorting the list, and yet it is more than twice as slow! One note, you said: > Increment length. > >> modifySTRef >> lengthRe

Re: [Haskell-cafe] hstats median algorithm

2012-09-03 Thread timothyhobbs
So I've been playing with the median problem today.  Not sure why, but it stuck in my head. >import Data.List >import Control.Monad.ST >import Data.STRef >import Control.Monad I've been using the hashing algorithm that I described last night, but it's quite slow.  I must be missing something obv

Re: [Haskell-cafe] hstats median algorithm

2012-09-02 Thread timothyhobbs
Sorry, I am horribly mistaken.  Hash table is O(n)+O(numbuckets)+O (middlebucketsize log(middlebucketsize))...  It's too late for this stuff... Tim -- Původní zpráva -- Od: timothyho...@seznam.cz Datum: 3. 9. 2012 Předmět: Re: [Haskell-cafe] hstats median algorithm " It really d

Re: [Haskell-cafe] hstats median algorithm

2012-09-02 Thread timothyhobbs
It really depends on how you are reading in the data and what you plan to do with it besides taking the median.  Obviously, if you read in your data as an ordered list things can be done O(n) without any trouble. In another case, if you already know the range, you can make a hash table and st

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-02 Thread timothyhobbs
Looks like I failed to reply all -- Původní zpráva -- Od: timothyho...@seznam.cz Datum: 2. 9. 2012 Předmět: Re: Re: [Haskell-cafe] Over general types are too easy to make. " Care to link me to a code repository that doesn't have this problem? The only Haskell program that I have i

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-02 Thread timothyhobbs
The thing is, that one ALWAYS wants to create a union of types, and not merely an ad-hock list of data declarations.  So why does it take more code to do "the right thing(tm)" than to do "the wrong thing(r)"?  Lets take an example from Conor McBride's "she"  https://github.com/timthelion/her-lexer/

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-02 Thread timothyhobbs
The problem with the last example I gave is evident in your statement "It appears you need to distinguish between Bars and Frogs". I have written quite a number of largish code bases, and I've run into the following problem every time: case largeMultiConstructorTypedValue of    Foo{blah=blah

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-01 Thread timothyhobbs
So after having played with it a little, it looks like GADTs are the way to go.  The method of manipulating the module system won't work because of two reasons: A) How can a user pattern match against data constructors that are hidden by the module system? B) It's an awful hack. Do I understan

Re: [Haskell-cafe] Over general types are too easy to make.

2012-08-31 Thread timothyhobbs
Sure, but that's relying on the promise that you're passing it a valid BadFrog...  Consider then: deBadFrog $ BadFrogType (BadBar { badFoo = 1}) -- Původní zpráva -- Od: John Wiegley Datum: 31. 8. 2012 Předmět: Re: [Haskell-cafe] Over general types are too easy to make. ">

[Haskell-cafe] Over general types are too easy to make.

2012-08-31 Thread timothyhobbs
I'd have to say that there is one(and only one) issue in Haskell that bugs me to the point where I start to think it's a design flaw: It's much easier to type things over generally than it is to type things correctly. Say we have a >data BadFoo = > BadBar{ >  badFoo::Int} | > BadFrog{ >  badFro

Re: [Haskell-cafe] A first glimps on the {-# NOUPDATE #-} pragma

2012-08-29 Thread timothyhobbs
And of course the biggest reason for this change, is we want GHC to continue to become "smarter".  Remember, Haskell is a high level language.  The original promise, is that the code should be algebraically optimizable by the compiler itself.  Yes, of course many Haskell coders have learned to dea

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-16 Thread timothyhobbs
So that we are using concrete examples.  here is an example of a change that really shouldn't break any package: https://github.com/timthelion/threadmanager/commit/c23e19cbe78cc6964f23fdb90 b7029c5ae54dd35 The exposed functions are the same.  The behavior is changed.  But as the commiter

Re: [Haskell-cafe] [Haskell] Spam on the Haskell wiki

2012-07-30 Thread timothyhobbs
Can we have at least 5 consonants?  There are enough people with names such as "Srbský" in eastern European  In fact, the Czechs can make use of as many as 9 consonants in a row!  http://ld.johanesville.net/perlicky/03- jazykova-nej-a-jine-hricky On a side note, image based CAPACHA's can c

Re: [Haskell-cafe] Is (==) commutative?

2012-07-24 Thread timothyhobbs
There's always this, for ALL types a :(  So even where you would think that the documentation can claim that a given Eq instance follows the law of commutativity, it really cannot. Prelude Control.Concurrent System.IO.Unsafe> do m <- newEmptyMVar ;putMVar m 1 ; print $ (unsafePerformIO (do v

Re: [Haskell-cafe] Record syntax, reopening a can of worms.

2012-05-27 Thread timothyhobbs
Somehow I don't understand you. Could you please fill out your example into a working bit of code? Thank you, Timothy -- Původní zpráva -- Od: Yves Parès Datum: 27. 5. 2012 Předmět: Re: [Haskell-cafe] Record syntax, reopening a can of worms. " > case myData of >   myA@A{} ->

Re: [Haskell-cafe] Record syntax, reopening a can of worms.

2012-05-27 Thread timothyhobbs
Your Maybe example is very contrived.  The place where I ran into this was much less contrived I think. I have an editor for a visual programming language. That looks like this: https://github.com/timthelion/gridhaskell-haskarrow/wiki I'm using a modified version of the Document-View model for

[Haskell-cafe] Record syntax, reopening a can of worms.

2012-05-26 Thread timothyhobbs
Hello list, As my first post.  I'd like to open a can of worms that I sure has been opened before.  That is record syntax. As we all know, there are some type safety problems with our current record syntax. The most obvious is that this compiles without even giving you a warning: >data MyData =