Re: [Haskell-cafe] Re: sendfile leaking descriptors on Linux?

2010-02-06 Thread Felipe Lessa
On Sat, Feb 06, 2010 at 09:16:35AM +0100, Bardur Arantsson wrote: > Brandon S. Allbery KF8NH wrote: > >On Feb 5, 2010, at 02:56 , Bardur Arantsson wrote: > [--snip--] > > > >"Broken pipe" is normally handled as a signal, and is only mapped > >to an error if SIGPIPE is set to SIG_IGN. I can well im

Re: [Haskell-cafe] Using ShowS or Difference Lists

2010-02-06 Thread Felipe Lessa
On Sat, Feb 06, 2010 at 11:12:40PM +1030, Mark Spezzano wrote: > -- Function: joinLines > -- Joins the Words within Lines together with whitespace and newline > characters > -- Argument: Lines to pad with whitespace and newlines > -- Evaluate: The processed and concatenated String > joinLines :: [

Re: [Haskell-cafe] GUI programming

2010-02-08 Thread Felipe Lessa
On Mon, Feb 08, 2010 at 12:54:03PM +0300, Victor Nazarov wrote: > As I understand Gtk2hs still don't run in -threaded environment. It does run, just use unsafeInitGUIForThreadedRTS. -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http:

Re: [Haskell-cafe] automatically exclude unused modules at compile time

2010-02-08 Thread Felipe Lessa
On Mon, Feb 08, 2010 at 11:25:13AM -0600, Hong Yang wrote: > Can we make GHC a little bit more intelligent to automatically exclude > unused modules at compile time as in case 4)? (Am I just too lazy to add > several dashes?) Did you use -split-objs? Does it help? -- Felipe.

Re: [Haskell-cafe] Generate random UArray in constant memory space.

2010-02-09 Thread Felipe Lessa
On Tue, Feb 09, 2010 at 04:27:57PM -0800, Bryan O'Sullivan wrote: > It creates and returns a vector, so if you ask it to give you a billion > items, it's going to require north of 8 gigabytes of memory. This should not > come as a surprise, I'd hope :-) Assuming that's not what you actually > want

Re: [Haskell-cafe] ANN: hmatrix 0.8.3

2010-02-12 Thread Felipe Lessa
On Fri, Feb 12, 2010 at 02:56:56PM +0100, Alberto Ruiz wrote: > I have released a new version of hmatrix, a library for numeric > computation based on LAPACK, BLAS and GSL. Recent developments > include improved SVD functions, a simple ODE solver, easier OS/X > installation (thanks to H. Apfelmus),

Re: [Haskell-cafe] ANN: Dungeons of Wor - a largish FRP example and a fun game, all in one!

2010-02-13 Thread Felipe Lessa
On Sat, Feb 13, 2010 at 09:49:53PM +0100, Henk-Jan van Tuyl wrote: > I tried it, but after briefly displaying a window, the program > terminates with the message: > dow: user error (unknown OpenGL extension entry glTexParameteri, > check for OpenGL 3.1) > > I suppose the program needs a newer ver

Re: [Haskell-cafe] What is the meaning of tilde ("~") symbol

2010-02-14 Thread Felipe Lessa
On Sun, Feb 14, 2010 at 09:00:14AM -0500, MightyByte wrote: > At any rate, they still don't help for things like '~', so > there's definitely a use for a wiki page like this. Of course, Hoogle and Hayoo could be modified to show the docs when such symbols are searched as a special condition. -- F

Re: [Haskell-cafe] Efficient M to N conversion on fusion?

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 07:52:51PM +0900, iquiw wrote: > Is there any efficient way to convert M-length ByteString, Text or > Vector into N-length one? This is just a guess, but in vector at least it should be possible to use sized[1] to tell how much space should be allocated on the final vector.

Re: [Haskell-cafe] Threading and FFI

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 09:00:08AM -0800, Yves Parès wrote: > I was wondering: is the Haskell default runtime (that which uses only one > processor) scheduler able to interrupt a thread which is currently calling > to a C function in order to enable another haskell thread to progress? > I think it

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 01:37:54PM -0600, Louis Wasserman wrote: > Is there a nice package out there somewhere with a linear programming > implementation? Preferably with a nicely functional interface? hmatrix? Cheers, -- Felipe. ___ Haskell-Cafe mail

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-16 Thread Felipe Lessa
On Tue, Feb 16, 2010 at 03:12:53PM -0500, Daniel Peebles wrote: > How would you use hmatrix? By linear programming I assume he means systems > of linear inequalities, as typically solved by the simplex algorithm. I too > am interested in this question (and the more general one of nonlinear > optimi

Re: [Haskell-cafe] ANN: concurrent-extra-0.1

2010-02-17 Thread Felipe Lessa
Hello, Thanks for the release! On Wed, Feb 17, 2010 at 03:10:38PM +0100, Roel van Dijk wrote: > * RLock: A lock which can be acquired multiple times by the same > thread. Also known as a reentrant mutex. In acquire (l. 111), if the lock was already acquired it goes by | otherwise →

Re: [Haskell-cafe] ANN: concurrent-extra-0.1

2010-02-17 Thread Felipe Lessa
On Wed, Feb 17, 2010 at 05:11:45PM +0100, Roel van Dijk wrote: > On Wed, Feb 17, 2010 at 3:27 PM, Felipe Lessa wrote: > > In release (l. 142) Nothing is put into mv > > > >                        then do Lock.release lock > >                                putMVar mv

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Felipe Lessa
On Sun, Feb 21, 2010 at 05:45:22PM +0200, Artyom Kazak wrote: > Hello everybody! > I want to write a little program, that will receive a string as command-line > argument and write it in the file. But if this string contains '+RTS', GHC > runtime won't pass the rest of the string to my program. > W

Re: [Haskell-cafe] Re: Some great results on fused code with the LLVM backend

2010-02-24 Thread Felipe Lessa
On Wed, Feb 24, 2010 at 01:28:56PM -0500, Edward Kmett wrote: > > * GHC/LLVM bytecode with JIT-option? > > There is little preventing this one. Oh, what a great idea! C code being inlined into Haskell functions! :D If clang were used to compile the C code into LLVM IR, and everything were linked

Re: [Haskell-cafe] Hackage redirect loop

2010-02-26 Thread Felipe Lessa
On Sat, Feb 27, 2010 at 01:56:34AM +0100, Daniel Fischer wrote: > Trying to access http://hackage.haskell.org/trac/hackage I land in a > redirection loop no matter which page or which browser I try. It worked > earlier today. Has anybody an idea what the heck might be going on? > Is it just me? Wo

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Felipe Lessa
On Sat, Feb 27, 2010 at 05:08:18PM -0800, zaxis wrote: > Then can i change it to : > case timeout of > Just str -> do > [(t, _)] <- reads str > addTimeout t (hPutStrLn stderr "*** TIMEOUT" >> _exit 1) > return () > _ -> return () No, that's diffe

Re: [Haskell-cafe] How do you rewrite your code?

2010-03-02 Thread Felipe Lessa
On Tue, Mar 02, 2010 at 08:20:30PM +0100, Sean Leather wrote: > There are numerous threads on the Haskell Café involving rewriting, > refactoring, refining, and in general improving code (for some definition of > improve). I am interested in seeing examples of how Haskell code can be > rewritten to

Re: [Haskell-cafe] ANNOUNCE: Parsec 3.1.0

2010-03-04 Thread Felipe Lessa
On Wed, Mar 03, 2010 at 10:45:12PM -0600, Derek Elkins wrote: > The main features of this release are: > - the performance should be much better and comparable to Parsec 2 Great! Will we finally be able to convert everyone to Parsec 3? Cheers, -- Felipe.

Re: [Haskell-cafe] Bubble sort algorithm implementations (Haskell vs. C)

2010-03-21 Thread Felipe Lessa
On Sun, Mar 21, 2010 at 03:39:08PM +1000, Yasir Arsanukaev wrote: > I'm interested not in particular algorithm performance but rather in > performance of its implementations in various languages. Is your C program using lists or arrays? These are different algorithms. -- Felipe.

Re: [Haskell-cafe] Re: Bubble sort algorithm implementations (Haskell vs. C)

2010-03-21 Thread Felipe Lessa
On Mon, Mar 22, 2010 at 01:08:39AM +, kingping wrote: > Here's my C implementation: > http://hpaste.org/fastcgi/hpaste.fcgi/view?id=24191#a24191 I don't know how much difference in time there would be, but you should use lists in C and/or mutable arrays in Haskell, otherwise you are comparing

Re: [Haskell-cafe] GHC vs GCC

2010-03-26 Thread Felipe Lessa
I'd guess that the LLVM backend could generate code that is at least as fast as gcc. It would be nice if you could test it. -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Difficulties installing LLVM bindings

2010-04-09 Thread Felipe Lessa
On Fri, Apr 09, 2010 at 01:38:21PM -0400, Aran Donohue wrote: > Have you seen anything like this before? Any tips or things to try? I can't > think of what magic setting I'm missing. Do you have llvm-config on your path? $ llvm-config I have in the past installed the LLVM bindings with a $HOME

Re: [Haskell-cafe] ANN: scan-0.1.0.3, a Haskell style scanner

2010-04-19 Thread Felipe Lessa
=On Mon, Apr 19, 2010 at 06:24:25PM +0200, Henning Thielemann wrote: > Christian Maeder schrieb: > > Henning Thielemann schrieb: > > > >> The updated Haskell code might be written to a new file by default. Then > >> I can interactively transfer the corrections I like to the original code > >> using

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-04-28 Thread Felipe Lessa
On Wed, Apr 28, 2010 at 04:16:08PM -0700, Ben wrote: > so i tried state machines of a sort > > newtype STAuto s a b = STAuto { unSTAuto : (a, s) -> (b, s) } > > where the interruptibility would come from being able to save out the > state s. i was not successful, unfortunately, in this level of >

Re: [Haskell-cafe] Benchmarks game updated to ghc 6.12.2

2010-04-29 Thread Felipe Lessa
On Thu, Apr 29, 2010 at 10:54:09AM +0200, Ketil Malde wrote: > Anyway - it occurs to me that this can fairly simply be sped up by > parallelizing: chunk the input, complement chunks in parallel, and > reverse. Any takers? Do you mean, something like this? import Data.ByteString.Char8 as S im

Re: [Haskell-cafe] why does Data.Text.Lazy.IO.readFile return the internal type Data.Text.Lazy.Internal.Text, when Data.Text.IO.readFile returns plain IO Data.Text.Text?

2010-04-30 Thread Felipe Lessa
On Fri, Apr 30, 2010 at 11:09:05PM +0200, Daniel Fischer wrote: > Hmm, > > Prelude> :t Data.Text.Lazy.IO.readFile > Data.Text.Lazy.IO.readFile > :: FilePath -> IO text-0.7.1.0:Data.Text.Lazy.Internal.Text > Prelude> :t Data.Text.IO.readFile > Data.Text.IO.readFile > :: FilePath -> IO text-0.7.1

Re: [Haskell-cafe] ANNOUNCE: gt-tools-0.1.4

2010-05-06 Thread Felipe Lessa
On Thu, May 06, 2010 at 09:30:50PM +0300, Sergei Trofimovich wrote: > /me wonders if Miss lambdabot might like to have such functionality. > What do you think? Do the terms of use of Google Translate allow it? Cheers, -- Felipe. ___ Haskell-Cafe mailin

Re: [Haskell-cafe] No copy XML parser (rough idea only)

2010-05-14 Thread Felipe Lessa
On Fri, May 14, 2010 at 08:57:42AM -0700, John Millikin wrote: > Additionally, since the original bytestring is shared in your types, > potentially very large buffers could be locked in memory due to > references held by only a small portion of the document. Chopping a > document up into events or

Re: [Haskell-cafe] Haskell, Queries and Monad Comprehension

2010-05-24 Thread Felipe Lessa
On Mon, May 24, 2010 at 03:20:41AM +0200, Günther Schmidt wrote: > Hi all, > > is there anybody currently using Haskell to construct or implement a > query language? Do you mean, HaskellDB? Cheers, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-10 Thread Felipe Lessa
On Thu, Jun 10, 2010 at 11:14:42PM +0200, Daniel Fischer wrote: > Show can work (should with the constraint on Equ), Eq is hairy. > > instance Show t => Show (Obs t) where > show (Equ a b) = show a ++ " `Equal` " ++ show b > show (Plus a b) = ... > show (Konst x) = "Konst " ++ show x >

Re: [Haskell-cafe] Encoding the encoding type of a string into its type

2010-06-11 Thread Felipe Lessa
On Fri, Jun 11, 2010 at 04:17:25PM +0200, Christopher Done wrote: > There are a lot of issues with string encoding type mismatches. > Especially "automatic" conversions. This mailing list gets enough > posts about encoding confusions. > > Would it make sense to make the string depend on its encodin

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-11 Thread Felipe Lessa
On Sat, Jun 12, 2010 at 12:13:14AM +0200, Dupont Corentin wrote: > Thanks all, it works fine (see below). > > I lamentably try to make the same for show: > > showTypeable :: (Typeable a) => a -> String > > showTypeable x = case cast x of > > Just x' -> show x' > >

Re: [Haskell-cafe] GATD and pattern matching

2010-06-11 Thread Felipe Lessa
On Fri, Jun 11, 2010 at 08:12:43PM -0500, Antoine Latter wrote: > >  1) Which extensions are required to make the code compile. > > OverlappingInstances (of course), and IncoherrentInstances, since > neither instance is more specific than the other. Well, I guess it can't be compiled at all :(

Re: [Haskell-cafe] Harder than you'd think

2010-06-13 Thread Felipe Lessa
On Sun, Jun 13, 2010 at 01:09:24PM +0100, Andrew Coppin wrote: > Does anybody have a less-insane way of doing this? Did you take a look at happstack-ixset[1]? [1] http://hackage.haskell.org/package/happstack-ixset -- Felipe. ___ Haskell-Cafe mailing li

Re: [Haskell-cafe] Tiger compiler: variable escaping analysis phase

2010-06-22 Thread Felipe Lessa
On Tue, Jun 22, 2010 at 09:33:22AM -0300, José Romildo Malaquias wrote: > In the variable escaping analysis phase of the compiler, a function > findEscape looks for escaping variables and record this information in > the escape fields of the abstract syntax. To do this the entire abstract > syntax

Re: [Haskell-cafe] Minix

2010-06-22 Thread Felipe Lessa
On Tue, Jun 22, 2010 at 08:54:26PM +0200, Henk-Jan van Tuyl wrote: > I just read about Minix and found a discussion [1] about Andrew > Tanenbaum (the creator of Minix) wanting to try drivers written in > Haskell on Minix. It has been four years since, is there currently a > way to (cross)compile Ha

Re: [Haskell-cafe] Network of GUI Controls - using MonadFix?

2010-06-23 Thread Felipe Lessa
On Thu, Jun 24, 2010 at 02:35:55AM +0200, Günther Schmidt wrote: > Is that something that MonadFix is meant to be used for? In current Gtk libraries, no. You'll do something like do btns <- mapM createBtn [1..4] mapM_ connect $ zip btns (tail $ cycle btns) However, if some library requir

Re: [Haskell-cafe] Construction of short vectors

2010-06-25 Thread Felipe Lessa
On Fri, Jun 25, 2010 at 12:41:48AM +0400, Alexey Khudyakov wrote: > Then constructor like one below arise naturally. And I don't know how to write > them properly. It's possible to use fromList but then list could be allocated > which is obviously wasteful. Did you see the generated core? I think

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sat, Jun 26, 2010 at 09:29:29AM +0300, Roman Beslik wrote: > Incorrect encoding of filepaths is common in e.g. Cyrillic Linux > (because of multiple possible encodings --- CP1251, KOI8-R, UTF-8) > and is solved by fiddling with the current locale and media mount > options. No need to change a pr

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sat, Jun 26, 2010 at 04:48:39PM +0400, Bulat Ziganshin wrote: > Saturday, June 26, 2010, 4:44:20 PM, Felipe Lessa wrote: > > Even if we said "we don't care", we at least should change > > FilePath to be [Word8], and not [String]. Currently filepaths >

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sat, Jun 26, 2010 at 05:01:06PM +0400, Bulat Ziganshin wrote: > >> > Even if we said "we don't care", we at least should change > >> > FilePath to be [Word8], and not [String]. Currently filepaths > > > other OSs worked fine, should I use this API (i.e. type FilePath > > = String) to its fulles

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sat, Jun 26, 2010 at 05:34:49PM +0400, Alexey Khudyakov wrote: > It should solve most of problems I believe. But such change will break > a lot of programs maybe most of them. How could one introduce such a > change? One variant is to create new hierarchy and gradually deprecate > old. > > Also

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sun, Jun 27, 2010 at 02:55:33AM +0300, Roman Beslik wrote: > On 26.06.10 15:44, Felipe Lessa wrote: > >However, suppose your program needs to create a file with a name > >based on a database information. Your database is UTF-8. How do > >you translate that UTF-8 data i

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sun, Jun 27, 2010 at 02:52:54AM +0300, Roman Beslik wrote: > On 26.06.10 16:34, Alexey Khudyakov wrote: > >On Sat, 26 Jun 2010 10:14:50 -0300 > >Felipe Lessa wrote: > >>On Sat, Jun 26, 2010 at 05:01:06PM +0400, Bulat Ziganshin wrote: > >>>but what you prop

Re: [Haskell-cafe] Core packages and locale support

2010-06-26 Thread Felipe Lessa
On Sat, Jun 26, 2010 at 10:01:57PM -0300, Felipe Lessa wrote: > The types are: > > getArgs :: IO [String] > writeFile :: FilePath -> String -> IO () On a similar note, getArgs probably suffers from the same problem. Which should it be? a) getArgs :: IO [String] b) ge

Re: [Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Felipe Lessa
On Sun, Jun 27, 2010 at 10:54:08AM +0100, Max Bolingbroke wrote: > Example 2: Codensity is the mother of all Monads I thought the continuation monad was the mother of all monads. :) For example, see [1]. Cheers! [1] http://blog.sigfpe.com/2008/12/mother-of-all-monads.html -- Felipe. ___

Re: [Haskell-cafe] Re: ANN: list-tries-0.0 - first release

2009-04-21 Thread Felipe Lessa
On Wed, Apr 22, 2009 at 12:29:05AM +0300, Matti Niemenmaa wrote: > Good to hear that it works for someone else, too. (I don't have a new > enough version of containers installed myself, after upgrading to > 6.10.2.) Just bear in mind that some functions won't work. What exactly don't work? What is

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-25 Thread Felipe Lessa
On Sat, Apr 25, 2009 at 10:34:05AM -0400, Xiao-Yong Jin wrote: > You don't write lisp, do you? Or probably it is just me. > But I would prefer to write the line as > > newtype MyCoolMonad = MyCoolMonad (FirstTransformer >(SecondTransformer >

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-25 Thread Felipe Lessa
On Sat, Apr 25, 2009 at 07:38:59PM +0400, Miguel Mitrofanov wrote: >> Also, I don't mistake the transformers as different >> parameters because of the parenthesis > > You should really try Lisp. In my opinion, parenthesis are a kind of > noise - too small, too many. I don't try lisp because I don'

Re: [Haskell-cafe] createProcess problem

2009-04-27 Thread Felipe Lessa
On Mon, Apr 27, 2009 at 06:00:52PM -0500, Vasili I. Galchin wrote: > I feel that it has something to do with double quotes in Haskell ... > probably something obviously silly that I am doing. The problem is that ["-p blastn"] means that there's only one argument, while ["-p", "blastn"] means what

Re: [Haskell-cafe] Runge-Kutta and architectural style

2009-04-28 Thread Felipe Lessa
On Mon, Apr 27, 2009 at 04:34:27PM +1200, Richard O'Keefe wrote: > (5) A generator that generates native code to > be called through FFI. It may be interesting to see the LLVM package, it's pretty much straightforward to use it with numerical calculations. -- Felipe. _

Re: [Haskell-cafe] Generating random enums

2009-05-01 Thread Felipe Lessa
On Fri, May 01, 2009 at 01:08:26PM -0500, Thomas Hartman wrote: > For quickchecking, the code below "cheats" by not defining the > coarbitrary funciton, which I confess I don't really understand and > never use. FWIW, QuickCheck 2 separates 'coarbitrary' in a different class. -- Felipe. _

Re: [Haskell-cafe] The essence of my monad confusion

2009-05-02 Thread Felipe Lessa
On Sat, May 02, 2009 at 05:31:03PM +0100, Paul Keir wrote: > An example immediately follows that quotation on the wiki: > > do text <- getLine >if null text > then putStrLn "You refuse to enter something?" > else putStrLn ("You entered " ++ text) Then, how about getMyLine = getL

Re: [Haskell-cafe] ANN: Silkworm game

2009-05-02 Thread Felipe Lessa
Hi! On Sat, May 02, 2009 at 01:00:23PM -0600, Duane Johnson wrote: > Silkworm combines the Hipmunk binding to Chipmunk 2D Game > Dynamics with OpenGL, and GLFW (an alternative to GLUT). It's great to see Hipmunk being useful to someone :). I've written the binding to turn some of my ideas into c

Re: [Haskell-cafe] Combining computations

2009-05-03 Thread Felipe Lessa
I don't know if I understood your intentions, but let's go. The problem is that you're trying to combine different monads. We have mplus :: MonadPlus m => m a -> m a -> m a, so you never leave 'm', but you want mplus' :: ??? => n a -> m a -> m a where 'n' could be a different monad. In s

Re: [Haskell-cafe] ANN: Silkworm game

2009-05-03 Thread Felipe Lessa
On Sun, May 03, 2009 at 02:07:23PM +0200, Sven Panne wrote: > As a side note, I get a very bad feeling when Hipmunk gets compiled on my > x86_64 box: [...] > This can't be correct, but I'll probably have to take a look at that. Or is it > a know bug that Hipmunk ist not 64bit-clean? My machine is

Re: [Haskell-cafe] applicative challenge

2009-05-04 Thread Felipe Lessa
On Mon, May 04, 2009 at 10:49:56PM +0100, Conor McBride wrote: > The effect of > > iffy askPresident launchMissiles seekUNResolution > > is to ask the President, then launch the missiles, then lobby the > UN, then decide that the result of seeking a UN resolution is > preferable. > > Remember fol

Re: [HOpenGL] Re: [Haskell-cafe] Decoupling OpenAL/ALUT packages from OpenGL

2009-05-10 Thread Felipe Lessa
On Sun, May 10, 2009 at 01:50:08PM +0200, Sven Panne wrote: > Nevertheless, having a common set of (strict) data types for > vector math will probably be very useful, even if it won't > fulfill everybody's needs. I can say that it would be useful at least for Hipmunk, specially being able to pass

Re: [Haskell-cafe] How i use GHC.Word.Word8 wit Int ?

2009-05-19 Thread Felipe Lessa
On Wed, May 20, 2009 at 08:40:15AM +0800, z_a...@163.com wrote: > I know "length [1..33]" is Int not Word8, but Word8 is enough here. Just saying '33' is enough here. :) -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskel

Re: [Haskell-cafe] Haskell programmers in São Carlos - SP - Brazil?

2009-05-26 Thread Felipe Lessa
On Tue, May 26, 2009 at 12:42:12PM -0300, Andrei Formiga wrote: > I don't think there's one, but I would subscribe to it. I would as well, but what would we gain with it? Wouldn't it rot because every message one of us wanted to post was general enough to just post on haskell-cafe? Would it be a

[Haskell-cafe] HPC and derived instances

2009-05-30 Thread Felipe Lessa
Hello! Why isn't there an option to control whether HPC, the Haskell Program Coverage, will consider derived instances "coverable". I'm using it and my top level coverage is 52% while my expression coverage is at 92%. Looking carefully we see that most non-tested top level definitions are derived

Re: [Haskell-cafe] Nested Lists

2009-06-04 Thread Felipe Lessa
How about... *Main> bunch () [1..16] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] *Main> bunch (8 :+: ()) [1..16] [[1,2,3,4,5,6,7,8],[9,10,11,12,13,14,15,16]] *Main> bunch (8 :+: 4 :+: ()) [1..16] [[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]]] *Main> bunch (8 :+: 4 :+: 2 :+: ()) [1..16] 1,2]

Re: [Haskell-cafe] RE: Nested Lists

2009-06-04 Thread Felipe Lessa
On Thu, Jun 04, 2009 at 05:09:29PM +0100, Paul Keir wrote: > Thanks. I don't know Type Families, but take the point that > the input can be parameterised with something something other > than a list. i.e. (8 :+: 4 :+: 2 :+: ()) presumably has the > same type as (4 :+: 2 :+: ()). In fact, no. (4 :

[Haskell-cafe] Re: [Haskell] ANNOUNCE: OpenGLRaw 1.0.0.0

2009-06-11 Thread Felipe Lessa
On Thu, Jun 11, 2009 at 06:56:01PM +0200, Sven Panne wrote: > Version 1.0.0.0 covers the OpenGL 3.1 core, all ARB extensions > and all EXT extensions. What about OpenGL 2.1? As I understand, Linux won't have OpenGL 3.0 or 3.1 for at least some months, $ glxinfo | grep 'OpenGL version' OpenGL ver

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: OpenGLRaw 1.0.0.0

2009-06-11 Thread Felipe Lessa
On Thu, Jun 11, 2009 at 07:55:23PM +0200, Krzysztof Skrzętnicki wrote: > On my machine I get: > > $ glxinfo | grep -i version > server glx version string: 1.4 > client glx version string: 1.4 > GLX version: 1.3 > OpenGL version string: 3.0.0 NVIDIA 180.51 > OpenGL shading language version string: 1

Re: [Haskell-cafe] Wiki user accounts

2009-06-12 Thread Felipe Lessa
On Fri, Jun 12, 2009 at 07:53:41PM +0200, Thomas ten Cate wrote: > This runs on MediaWiki, right? How about adding a CAPTCHA for account > registrations? What do we avoid at all costs? ___ |___| -- Felipe.

Re: [Haskell-cafe] GHCi infers a type but refuses it as type signature

2009-06-22 Thread Felipe Lessa
On Tue, Jun 23, 2009 at 02:02:25AM +0200, Eric wrote: > It seems that an extension is required: > > Non type-variable argument in the constraint: MonadState [a] m > (Use -XFlexibleContexts to permit this) > In the type signature for `play3': > play3 :: (MonadState [a] m, Eq a) =>

[Haskell-cafe] Re: [Haskell] ANN: Reusable Corecursive Queues via Continuations

2009-06-23 Thread Felipe Lessa
On Mon, Jun 22, 2009 at 10:31:34PM -0400, Leon Smith wrote: > Also, a substantially revised draft of the associated paper, "Lloyd > Allison's Corecursive Queues: Why Continuations Matter" is now available. > [3] This paper will appear in the upcoming Monad Reader issue 14, and > comments would

Re: [Haskell-cafe] Could FFI support pass-by-value of structs?

2009-06-23 Thread Felipe Lessa
On Tue, Jun 16, 2009 at 10:48:19AM -0300, Maurí­cio wrote: > /*/ > struct ex { > int x; > int y; > int z; > }; > > ex example_functions (ex p) > { > (...) > } > /*/ You may adopt the approach I used with Hipmunk[1] where there is a wrapper library written in C. For your exam

Re: [Haskell-cafe] "shadowing" keywords like "otherwise"

2009-06-28 Thread Felipe Lessa
On Sun, Jun 28, 2009 at 12:49:12AM -0700, Kim-Ee Yeoh wrote: > This isn't really a shadowing/redefinition issue. Here's > a perfectly legitimate snippet that compiles fine: > > f 0 = 0 > f otherwise = 1+otherwise What? It is a redefinition issue *as well*, but this kind of warning isn't active by

Re: [Haskell-cafe] Half-integer

2009-06-28 Thread Felipe Lessa
On Sun, Jun 28, 2009 at 02:24:30PM +0100, Andrew Coppin wrote: > Now, the question is... Is this useful enough to be worth putting on > Hackage? Why not? :) -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailma

Re: [Haskell-cafe] Re: test-framework success

2009-06-28 Thread Felipe Lessa
On Sun, Jun 28, 2009 at 11:07:27AM +0100, Max Bolingbroke wrote: > Awesome! I'm really glad to hear you are having success with the package! BTW, thanks for fixing the spacing issue with nested tests! :) -- Felipe. ___ Haskell-Cafe mailing list Haskell-

Re: [Haskell-cafe] XMonad and NetworkManager?

2009-06-29 Thread Felipe Lessa
On Mon, Jun 29, 2009 at 01:28:47PM +0400, Alexey Khudyakov wrote: > I use wicd to manage wireless connections for about three month and > I'm pretty happy with it. It seems to be much saner than network manager. > Didn't any serious problems with it. I second that. I've gone away from NM because

Re: [Haskell-cafe] ANN: TernaryTrees-0.1.1.1 - An efficient ternary tree implementation of Sets and Maps

2009-06-29 Thread Felipe Lessa
On Tue, Jun 30, 2009 at 03:29:45AM +1000, Alex Mason wrote: > (being able to insert 230,000+ words, check that all those > words are actually in the set, write the set out to disk using > the Data.Binary instance, reading them back in, and checking > the old and new sets are equal takes about 3.5 s

Re: [Haskell-cafe] Suggestions for simulating Object ID

2009-06-30 Thread Felipe Lessa
On Tue, Jun 30, 2009 at 03:25:26PM +0530, Hemanth Kapila wrote: > Can some one please suggest something on simulating some sort of > "object-Ids" in Haskell? Data.Unique[1]? [1] http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Unique.html -- Felipe.

Re: [Haskell-cafe] Suggestions for simulating Object ID

2009-06-30 Thread Felipe Lessa
On Tue, Jun 30, 2009 at 07:57:07PM +0530, Hemanth Kapila wrote: > Can't we come up with something like this staying within the > limits of purity? No, because that would break referential transparency :(. I.e., it would be possible to distinguish things that should be "equal", such as '3' from '1

Re: [Haskell-cafe] ANN: HalfInteger-1.1.1

2009-07-04 Thread Felipe Lessa
On Sat, Jul 04, 2009 at 12:37:21PM +0100, Andrew Coppin wrote: > It's on Hackage: > > http://hackage.haskell.org/package/AC-HalfInteger-1.1.1 > > It'll be interesting to see if I uploaded it right... o_O I guess you did, congrats! :) ...on the Haddock comments of halve and double, it should be

Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-04 Thread Felipe Lessa
On Sat, Jul 04, 2009 at 06:56:44PM +0100, Andrew Coppin wrote: > http://hackage.haskell.org/package/AC-Colour-1.1.1 Why don't you use colour[1]? [1] http://hackage.haskell.org/package/colour -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell

Re: [Haskell-cafe] Documentation design

2009-07-05 Thread Felipe Lessa
I would also like some sort of "combo" mode for Hackage where the docs are shown the same way that they are now but with a link to "Internals" showing the view that you propose, perhaps showing only internals or highlighting them. Then we would be able to have the internal documentation on Hackage

[Haskell-cafe] Re: [Haskell] ANNOUNCE: StateVar 1.0.0.0

2009-07-14 Thread Felipe Lessa
On Tue, Jul 14, 2009 at 07:16:41PM +0200, Sven Panne wrote: > To further modularize the OpenGL/OpenAL packages, a new > StateVar package has been released to Hackage. It contains > state variables, which are references in the IO monad, like > IORefs or parts of the OpenGL state. That's just great,

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Felipe Lessa
On Wed, Jul 15, 2009 at 08:27:04AM +1000, John Ky wrote: > a :: Data > > let b = getNext a > let c = getNext b > > c == a -- Gives True What do you mean? This works type Data = () getNext = id but I guess this is not what you meant ;). -- Felipe.

Re: [Haskell-cafe] Pattern matching does not work like this?

2009-07-15 Thread Felipe Lessa
On Wed, Jul 15, 2009 at 08:09:37AM -0400, Andrew Wagner wrote: > Err, technically, aren't functions and constructors mutually exclusive? So > if something is a function, it's, by definition, not a constructor? I guess what Eugene Kirpichov meant was that not being a function (and being a construct

Re: [Haskell-cafe] Plot data reconstruction reading pixel colors from image files

2009-07-17 Thread Felipe Lessa
On Fri, Jul 17, 2009 at 06:31:20PM +0200, Cetin Sert wrote: > How can I open and read colors of specific pixels of an image file in > Haskell? Which packages, functions do you recommend? You could try DevIL, SDL-image or Gtk, I guess. -- Felipe. ___ Has

Re: [Haskell-cafe] ANN: cautious-file 0.1.1: Ways to write a file cautiously, to avoid data loss

2009-07-20 Thread Felipe Lessa
Nice library! On Sun, Jul 19, 2009 at 11:35:34PM +0100, Robin Green wrote: > A variant, writeFileWithBackup, also allows you to supply a custom > backup computation to backup old copy(ies) of the destination file It would be nice to have the backup action receive the file name as a parameter, so

[Haskell-cafe] Re: [Haskell] TABI 0.1: a typeful tagged cross-language calling convention

2009-07-21 Thread Felipe Lessa
On Tue, Jul 21, 2009 at 08:11:47PM +0400, Bulat Ziganshin wrote: > if you have any specific needs, we can discuss it. my own needs is > mainly combination of first and third clauses of quoted list, so > second claim is somewhat artificial :) it is possible but only > partially implemented I was j

Re: [Haskell-cafe] Implicit concatenation in list comprehensions

2009-07-21 Thread Felipe Lessa
On Tue, Jul 21, 2009 at 12:29:18PM -0700, Dan Weston wrote: > This would mean that > > [ | c ] = concat $ do { c; return [] } > > The right is legal Haskell and gives []. The left is (not yet) > legal. Should it be? Please, please, do not allow that. People wanting [] should write []. Thanks!

Re: [Haskell-cafe] Generalizing takeWhile

2009-07-22 Thread Felipe Lessa
On Wed, Jul 22, 2009 at 06:00:38PM +0200, Matthias Görgens wrote: ] I need to take some elements from the front of a list.  However the ] criteria are somewhat complex. ] ] > walk f [] = [] ] > walk f (x:xs) = case f x ] > of Just g -> x : walk g xs ] >Nothing ->

Re: [Haskell-cafe] Generalizing takeWhile

2009-07-22 Thread Felipe Lessa
On Thu, Jul 23, 2009 at 07:28:55AM +0200, Matthias Görgens wrote: ] I often want to take one more element than takeWhile does, or only > takeWhileMore n p x | p x = Just . F $ takeWhileMore n p > | otherwise = Just . F $ takeN n ] start checking the predicate after takin

Re: [Haskell-cafe] QuickCheck behaving strange

2009-07-24 Thread Felipe Lessa
On Fri, Jul 24, 2009 at 08:11:12PM +0200, Tobias Olausson wrote: > prop_schedule :: Ord t => [Interval a t] -> Bool > prop_schedule []= True > prop_schedule [a] = True > prop_schedule (x:y:ys) = end x <= begin y && prop_schedule (y:ys) [..] > How come QuickCheck passes 100 tests of r

Re: [Haskell-cafe] Memoized game-tree evaluation

2009-07-25 Thread Felipe Lessa
On Sat, Jul 25, 2009 at 10:08:20AM -0400, Matthew wrote: > I'm working on defining a data type for representing game-trees > for chess or other two-person board games. My plan is to > memoize the evaluations of a game-state at each depth so that > values don't need to be recomputed for future moves

Re: [Haskell-cafe] A Question of Restriction

2009-07-26 Thread Felipe Lessa
On Sun, Jul 26, 2009 at 09:01:22PM -0700, Brian Troutwine wrote: > Hello all. > > I would like to define a data type that is the super-set of several > types and then each of the proper subset types. For example: > data Foo = O !Odd | E !Even >data Odd = One | Three >data Even = Two | Fou

Re: [Haskell-cafe] powerSet = filterM (const [True, False]) ... is this obfuscated haskell?

2009-07-28 Thread Felipe Lessa
On Tue, Jul 28, 2009 at 10:58:53AM +0200, Sebastian Fischer wrote: > tails = dropWhileM (const [True,False]) Actually this should be tails = dropWhileM (const [False, True]) -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://w

Re: [Haskell-cafe] Need feedback on my Haskell code

2009-07-28 Thread Felipe Lessa
Small tips: - Use swap and avoid those if's. - [a] ++ b is the same as a : b. - Factor out the first point that is always there. - Factor out line' arguments that don't change with the recursion. Untested: > swap :: Bool -> (a,a) -> (a,a) > swap False = id > swap True = \(x,y) -> (y,x) > > li

[Haskell-cafe] Re: [Haskell] ANNOUNCE: OpenGL 2.3.0.0

2009-07-29 Thread Felipe Lessa
On Wed, Jul 29, 2009 at 06:26:30PM +0200, Sven Panne wrote: > Apart from that, a bug in vertexAttribPointer has been fixed. ...and the new ObjectName, StateVar and Tensor packages are being used, and this is great! Thanks for the release. -- Felipe. __

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: OpenGL 2.3.0.0

2009-07-29 Thread Felipe Lessa
On Wed, Jul 29, 2009 at 10:24:23PM -0300, Rafael Gustavo da Cunha Pereira Pinto wrote: > mapAccumL was added to Data.Traversable in package base-4. GHC 6.8.2 uses > base-3... But this means that Tensor's dependencies should be on base >= 4, not 3. -- Felipe. _

Re: [Haskell-cafe] Request for Changelogs

2009-08-06 Thread Felipe Lessa
On Thu, Aug 06, 2009 at 04:27:56PM +0200, Joachim Breitner wrote: > And cabal/hackage guys: Llease introduce a standard Changes format for > cabal packages so that http://hackage.haskell.org/package/hlint readily > lists (or links to) changes. I second that! +1 -- Felipe.

Re: [Haskell-cafe] Hugs faster and more reliable than GHC for large list monad 'do' block

2009-08-06 Thread Felipe Lessa
On Thu, Aug 06, 2009 at 04:25:07PM -0700, Dan Weston wrote: > > ghc --version > The Glorious Glasgow Haskell Compilation System, version 6.10.4 Confirmed on Gento amd64 with custom-built GHC from Haskell overlay: $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.10.4 $ u

Re: [Haskell-cafe] Announce: EnumMap-0.0.1

2009-08-08 Thread Felipe Lessa
On Sat, Aug 08, 2009 at 04:14:15PM -0700, Thomas DuBuisson wrote: > There exists a small but measurable performance hit for at least one > test case (using Int as keys, obviously). Perhaps the bias would be > the other way if we were comparing EnumMap to an IntMap wrapped with > to/from Enum. Per

  1   2   3   4   5   >