2009/3/26 Luke Palmer :
> The spine of this trie is maximally lazy: this is key. If the structure of
> the spine depended on the input data (as it does for Data.Map), then we
> wouldn't be able to process infinite data, because we can never get it all.
> So even making a trie out of the list _|_ g
Thomas Hartman wrote:
Luke, does your explanation to Guenther have anything to do with
coinduction? -- the property that a producer gives a little bit of
output at each step of recursion, which a consumer can than crunch in
a lazy way?
It has more to do with "tying the knot" (using laziness to
Gü?nther Schmidt wrote:
The depth this language has is just amazing and the stuff that is
tackled in this language is just aaahhh. Can't quite put it in
words, maybe something along the lines "the ultimate thing, key to the
universe" I don't know.
Humbling and frustrating especially when
wren ng thornton wrote:
> Colin Adams wrote:
> > 2009/3/25 wren ng thornton :
> > when I look up the Haddock-generated documentation for a function, I
> > DON'T appreciate it if that is in the form of a hyperlink to a
> > research paper.
> > And that occurs in several of the libraries shipped wit
On Thu, 2009-03-26 at 21:57 -0400, wren ng thornton wrote:
> Jonathan Cast wrote:
> > Xiao-Yong Jin wrote:
> > > > Xiao-Yong Jin wrote:
> > > > > So I have another question. Is the following function safe
> > > > > and legitimate?
> > > > >
> > > > >> safeDiv :: (Exception e, Integral a) =>
> > >
Jonathan Cast wrote:
Xiao-Yong Jin wrote:
> > Xiao-Yong Jin wrote:
> > > 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 = unsafePerformIO . try . evalu
Luke Palmer wrote:
Alexander Dunlap wrote:
> Ultimately, it's not detectable statically, is it? Consider
>
> import Control.Applicative
>
> main = do
> f <- lines <$> readFile "foobar"
> print (head (head f))
>
> You can't know whether or not head will crash until runtime.
Static checkers are
Alexander Dunlap wrote:
wren ng thornton wrote:
> Jules Bean wrote:
> > head uses "error" in precisely the correct, intended fashion.
> >
> > head has a precondition (only call on non-empty lists)
>
> And that is *exactly* my complaint: the precondition is not verified by the
> compiler. Therefor
On Thu, Mar 26, 2009 at 6:42 PM, Alexander Dunlap <
alexander.dun...@gmail.com> wrote:
> On Thu, Mar 26, 2009 at 5:23 PM, wren ng thornton
> wrote:
> > It's a static error, detectable statically, and yet it's deferred to the
> > runtime. I'd much rather the compiler catch my errors than needing t
Thomas Hartman wrote in article
<910ddf450903261240p4e4fc8b3pa927fac1b80b2...@mail.gmail.com> in
gmane.comp.lang.haskell.cafe:
> Well, that's reassuring.
>
> The reason I asked is that the testp function didn't just show poor
> performance. The state monad implementation actually gave a differe
Hello,
I just uploaded fallingblocks to Hackage. It is another Tetris clone, but
it uses SDL, and I thought there could be more SDL examples.
Any and all comments and suggestions will be extremely appreciated!
There is a darcs repo at
http://patch-tag.com/publicrepos/fallingblocks
Cheers!
-Ben
On Thu, Mar 26, 2009 at 5:23 PM, wren ng thornton wrote:
> Jules Bean wrote:
>>
>> wren ng thornton wrote:
>> > I have long been disappointed by a number of `error`s which shouldn't >
>> > be. For example, the fact that `head` and `div` are not total strikes > me
>> > as a (solvable) weakness of t
John Lato wrote:
> From: wren ng thornton
> Dan Weston wrote:
> > So to be clear with the terminology:
> >
> > inductive = good consumer?
> > coinductive = good producer?
> >
> > So fusion should be possible (automatically? or do I need a GHC rule?) with
> > inductive . coinductive
> >
> > O
Well Folks,
I've been programming for almost a decade now and making a living off it
for almost 8 years.
To me programing in Haskell is sometimes quite a humbling experience,
because I come to realize how shallow my ventures so far were.
The depth this language has is just amazing and the s
Jules Bean wrote:
wren ng thornton wrote:
> I have long been disappointed by a number of `error`s which shouldn't
> be. For example, the fact that `head` and `div` are not total strikes
> me as a (solvable) weakness of type checking, rather than things that
> should occur as programmer errors/
Re that link: search for wren's comments containing "it is however
nicely coinductive"
2009/3/26 Thomas Hartman :
> Luke, does your explanation to Guenther have anything to do with
> coinduction? -- the property that a producer gives a little bit of
> output at each step of recursion, which a cons
Luke, does your explanation to Guenther have anything to do with
coinduction? -- the property that a producer gives a little bit of
output at each step of recursion, which a consumer can than crunch in
a lazy way?
I find that coinduction seems to figure frequently in algos that
process a stream.
Colin Adams wrote:
2009/3/25 wren ng thornton :
> > Most of the "documentation" is in research papers, and a "normal"
> > programmer don't want to read these papers.
>
> Yes, and no. There is quite a bit of documentation in research papers, and
> mainstream programmers don't read research. Howe
I'm also learning Haskell so the solution below might be (1) inefficient and
(2) incorrect, but hey, let's give it a try :-)
For simplicity, in the testing code, I assume an infinite list of key/value
pairs where they keys are of type Char between 'a' and 'z' and the values
are Integers (the code a
Dear Luke,
let me thank you first of all for your response, period, and let me also
assure you that your efforts are not (totally) in vain. :)
Of course I had all kinds of guesses what sort of dark arts you employed
here, mostly really long shots (Memoization, CPS ...). And at the end of
th
;^)
On Thu, Mar 26, 2009 at 5:32 PM, Jonathan Cast wrote:
> On Thu, 2009-03-26 at 17:27 -0500, Vasili I. Galchin wrote:
> > ok .. how about API independent? ;^)
>
> Last I checked VMS, OS/360 (NB: not dead by a long shot), etc. had APIs
> too.
>
> What you really mean is `does not break when run
On Thu, 2009-03-26 at 17:27 -0500, Vasili I. Galchin wrote:
> ok .. how about API independent? ;^)
Last I checked VMS, OS/360 (NB: not dead by a long shot), etc. had APIs
too.
What you really mean is `does not break when run against Windows's
pseudo-POSIX API despite Microsoft's best efforts' :)
Wow, uniplate is the library from my dreams :)
I knew there should be easy, elegant and simple solution (I hate brute
force, that's why I start using Haskell).
Many thanks.
2009/3/26 Neil Mitchell :
> Hi
>
>> f1 = foo 5
>> f2 = foo 8
>> f3 = foo 9
>>
>> I want to extract a list [5, 8, 9] (suppo
ok .. how about API independent? ;^)
On Thu, Mar 26, 2009 at 5:14 PM, Jonathan Cast wrote:
> On Thu, 2009-03-26 at 17:16 -0500, Vasili I. Galchin wrote:
> > Hello,
> >
> > I have been looking through Hackage and using Hoogle to "fork
> > and execute" a program in an OS-independent way, i.e.
On Thu, 2009-03-26 at 17:16 -0500, Vasili I. Galchin wrote:
> Hello,
>
> I have been looking through Hackage and using Hoogle to "fork
> and execute" a program in an OS-independent way, i.e. neutral from
> POSIX and Win32 APIs. Does such a library function exist?
System.Process.createProces
Hello,
I have been looking through Hackage and using Hoogle to "fork and
execute" a program in an OS-independent way, i.e. neutral from POSIX and
Win32 APIs. Does such a library function exist?
Regards, Vasili
___
Haskell-Cafe mailing list
Haskell
On Thu, 26 Mar 2009, Heinrich Apfelmus wrote:
Luke Palmer wrote:
Yeah, make a trie. Here's a quick example.
Nice!
There was a thread about this question a few years ago, with some very
interesting developments like the "blueprint technique" by Bertram
Felgenhauer.
http://thread.gmane.or
Luke Palmer wrote:
> On Tue, Mar 24, 2009 at 3:15 PM, Gü?nther Schmidt wrote:
>
>> Hi,
>>
>> let say I got an unordered lazy list of key/value pairs like
>>
>> [('a', 99), ('x', 42), ('a', 33) ... ]
>>
>> and I need to sum up all the values with the same keys.
>>
>> So far I wrote a naive implemen
Here is the error message of: cabal --jhc install OpenGL
http://pastebin.com/m541052a3
2009/3/26 Thomas DuBuisson
> Sorry for the double but I messed up the example. That should have been:
>
>cabal --jhc install Crypto
>
>
>
> On Thu, Mar 26, 2009 at 2:10 PM, Thomas DuBuisson
> wrote:
> >
Sorry for the double but I messed up the example. That should have been:
cabal --jhc install Crypto
On Thu, Mar 26, 2009 at 2:10 PM, Thomas DuBuisson
wrote:
> I don't know about OpenGL specifically, but there is the --jhc flag
> for cabal-install, ex:
>
> cabal --jhc Crypto
>
> Thomas
I don't know about OpenGL specifically, but there is the --jhc flag
for cabal-install, ex:
cabal --jhc Crypto
Thomas
2009/3/26 Csaba Hruska :
> Hi!
>
> As OpenGL haskell binding depends only on base, it would be great to compile
> it with jhc. I've tried to do that, but I had some problems w
On Thu, Mar 26, 2009 at 12:21 PM, GüŸnther Schmidt wrote:
> Hi guys,
>
> I tried for days now to figure out a solution that Luke Palmer has
> presented me with, by myself, I'm getting nowhere.
Sorry, I meant to respond earlier.
They say you don't really understand something until you can explai
> Excellent!
> The black magic had me scratching my head until I realized it was broken
> magic. :)
I should probably rerelease Uniplate so the documentation gets fixed,
but its not actually "broken" - although there is no way it does what
I intended!
vals x = [Val i | i <- universe x]
Given the
Hi!
As OpenGL haskell binding depends only on base, it would be great to compile
it with jhc. I've tried to do that, but I had some problems with
preprocessor directives.
It would be also great to add jhc support for OpenGL bindings build scripts.
Or, it would be better to add jhc support for cab
Hi John,
> Actually, looking at the docs for UniplateStr[1], isn't there an error in
> the following example statement in the Queries section?
>
> vals x = [Val i | i <- universe x]
>
> Shouldn't that be:
> vals x = [i | Val i <- universe x]
Yep, you are indeed right. I've fixed the examples in t
Excellent!
The black magic had me scratching my head until I realized it was broken
magic. :)
/jve
On Thu, Mar 26, 2009 at 4:23 PM, Neil Mitchell wrote:
> Hi John,
>
> > Actually, looking at the docs for UniplateStr[1], isn't there an error in
> > the following example statement in the Queries
Hi, I announce the release of io-capture package of version 0.2
io-capture is a Library to capturing stdout and stderr in IO
action. It exports a function named `capture', It takes an IO
and an String, the action to run and the given whole stdin, and
returns whole stdout and stderr in the action
Actually, looking at the docs for UniplateStr[1], isn't there an error in
the following example statement in the Queries section?
vals x = [Val i | i <- universe x]
Shouldn't that be:
vals x = [i | Val i <- universe x]
?
/jve
1.
http://hackage.haskell.org/packages/archive/uniplate/1.2.0.3/doc
Your space ship enters an asteroid belt, try to avoid
collisions!
wxAsteroids is a game demonstrating the wxHaskell GUI.
More about this at:
http://www.haskell.org/haskellwiki/wxAsteroids
--
Met vriendelijke groet,
Henk-Jan van Tuyl
--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--
Well, that's reassuring.
The reason I asked is that the testp function didn't just show poor
performance. The state monad implementation actually gave a different
answer -- nonterminating, where the pattern matching solution
terminated.
2009/3/26 Jonathan Cast :
> On Thu, 2009-03-26 at 12:29 -070
On Thu, 2009-03-26 at 12:29 -0700, Thomas Hartman wrote:
> > I wonder if JHC
> > or some other compiler might work better with these examples?
>
> Are you saying that different compilers might give different answers?
>
> Yikes!
>
> Too clever indeed!
No, they might produce code with different p
On Wed, 25 Mar 2009, Thomas Hartman wrote:
With the state version, there's a lot of behind-the-scenes magic, and
as we've seen, things can go wrong.
Also, the issue isn't infinite lists, but lists that are longer than
the sum of the partitions provided. The state monad partition version
goes eq
> I wonder if JHC
> or some other compiler might work better with these examples?
Are you saying that different compilers might give different answers?
Yikes!
Too clever indeed!
2009/3/26 :
> On Wed, 25 Mar 2009, Thomas Hartman wrote:
>
>> With the state version, there's a lot of behind-the-sc
All this is certainly true. But there is still a valid concern: Numerical tasks
often allow to predict whether an error might occur or not. Let's say you know
that you have a normal matrix N and want to calculate (1+N*N)^-1. Of course the
matrix is invertible and therefore it is reasonable to pr
safeDiv :: (Exception e, Integral a) =>
a -> a -> Either e a
safeDiv x y = unsafePerformIO . try . evaluate $ div x y
I just want to know, from a theoretical point of view,
whether this 'safeDiv' in above definition is the same as
safeDiv' :: (Exception e, Integral a) =>
On Thu, 2009-03-26 at 14:23 -0400, Xiao-Yong Jin wrote:
> Henning Thielemann writes:
>
> > On Thu, 26 Mar 2009, Xiao-Yong Jin wrote:
> >
> >> So I have another question. Is the following function safe
> >> and legitimate?
> >>
> >>> safeDiv :: (Exception e, Integral a) =>
> >>>a -> a
Henning Thielemann writes:
> On Thu, 26 Mar 2009, Xiao-Yong Jin wrote:
>
>> 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 = unsafePerformIO . try . evaluate $ div x
Hi guys,
I tried for days now to figure out a solution that Luke Palmer has
presented me with, by myself, I'm getting nowhere.
He has kindly provided me with this code:
import Data.Monoid
newtype IntTrie a = IntTrie [a]
deriving Show
singleton :: (Monoid a) => Int -> a -> IntTrie a
sing
On Wed, 25 Mar 2009, wren ng thornton wrote:
Extensible exceptions are impressive, but the existence of exceptions
outside of type annotations says something about purity.
Did I already promote explicit-exceptions package? :-)
___
Haskell-Cafe maili
> 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 = unsafePerformIO . try . evaluate $ div x y
>
> I believe it sh
2009/3/26 Vasyl Pasternak :
> Hi,
>
> I want to parse haskell file to find all calls to function 'foo' and
> gathers a create a list of all
> argumets, which passed to it. E.g. from the following code:
>
> f1 = foo 5
> f2 = foo 8
> f3 = foo 9
>
> I want to extract a list [5, 8, 9] (suppouse functi
Hello Don,
Thursday, March 26, 2009, 8:26:18 PM, you wrote:
>>> +RTS -c -F1.1
>> It now requires 386 MB of memory, but is 4.7 times slower.
>>
>> So, now memory required is about the same as the C++ version, but how
>> can I optimize memory usage without having to tweak the garbage
>> collect
manlio_perillo:
> Bulat Ziganshin ha scritto:
>> Hello Manlio,
>>
>> Thursday, March 26, 2009, 6:39:12 PM, you wrote:
>>
>>> The test consists in adding 1000 elements to an empty map.
>>
>> +RTS -c -F1.1
>>
>> then read about garbage collection
>>
>>
>
> It now requires 386 MB of memory, but is
Hello Manlio,
Thursday, March 26, 2009, 8:17:03 PM, you wrote:
> So, now memory required is about the same as the C++ version, but how
> can I optimize memory usage without having to tweak the garbage collector?
C++ doesn't use GC so why you compare?
--
Best regards,
Bulat
Bulat Ziganshin ha scritto:
Hello Manlio,
Thursday, March 26, 2009, 6:39:12 PM, you wrote:
The test consists in adding 1000 elements to an empty map.
+RTS -c -F1.1
then read about garbage collection
It now requires 386 MB of memory, but is 4.7 times slower.
So, now memory required
Hi
> f1 = foo 5
> f2 = foo 8
> f3 = foo 9
>
> I want to extract a list [5, 8, 9] (suppouse function takes only one
> argument)
Firstly, use haskell-src-exts and Language.Haskell.Exts - its a much
better library, deals with many extensions, and gives you everything
Language.Haskell did.
> parse
Brandon S. Allbery KF8NH ha scritto:
On 2009 Mar 26, at 11:39, Manlio Perillo wrote:
The execution time and CPU usage is almost the same.
However the C++ version requires 305 MB, the GHC version 617 MB.
I wonder how much of that is due to lifting (i.e. laziness).
http://hpaste.org/fastcgi/h
Hi,
I want to parse haskell file to find all calls to function 'foo' and
gathers a create a list of all
argumets, which passed to it. E.g. from the following code:
f1 = foo 5
f2 = foo 8
f3 = foo 9
I want to extract a list [5, 8, 9] (suppouse function takes only one argument)
The most obvious w
Hello Manlio,
Thursday, March 26, 2009, 6:39:12 PM, you wrote:
> The test consists in adding 1000 elements to an empty map.
+RTS -c -F1.1
then read about garbage collection
--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com
__
On 2009 Mar 26, at 11:39, Manlio Perillo wrote:
The execution time and CPU usage is almost the same.
However the C++ version requires 305 MB, the GHC version 617 MB.
I wonder how much of that is due to lifting (i.e. laziness).
--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@k
Hi Henk-Jan,
It works for me, see for example HLint:
http://community.haskell.org/~ndm/darcs/hlint
And a blog I wrote on it:
http://neilmitchell.blogspot.com/2008/02/adding-data-files-using-cabal.html
The data files are copied in to the data directory upon install. The
data-files: bit must be ne
L.S.,
I am trying to install an application with data files (I am developing
that application). These data files are mentioned in the .cabal file,
after the "Data-files:" keyword. When I give command "runhaskell setup
install", the data files are not copied; how can I correct this?
--
Re
On Thu, 26 Mar 2009, Xiao-Yong Jin wrote:
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 = unsafePerformIO . try . evaluate $ div x y
I believe it should be okay to use this 'saf
John Lato writes:
> Even in Haskell this separation isn't absolute. Programmer errors,
> such as dividing by 0, can and do lead to exceptional conditions. The
> proper way to handle dividing by 0 is to not do it in the first place,
> but if it happens because of a programming error, you've got
Claus Reinke ha scritto:
Continuing our adventures into stylistic and semantic differences:-)
Can you write this analysis on the wiki?
Thanks!
Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/has
Hi.
I have tried to compare performance of the g++ std::map versus the GHC
IntMap.
The test consists in adding 1000 elements to an empty map.
Haskell code is here:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2899
C++ code is here:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2900
Th
* Claus Reinke wrote:
> Continuing our adventures into stylistic and semantic differences:-)
It's good practice to keep a simple minded version of the code and using
quickcheck to try to find differences between the optimized and trivial
version. It's good practice to even check, that the optimize
> As I understand it, programs compiled with GHC currently use MSYS for all
> I/O operations, resulting in all kinds of strange behaviour in corner cases.
> (E.g., if you use System.Directory and ask whether "C:\\" is a directory, it
> says no, yet you can read the contents of that directory.) I wo
On Thu, 26 Mar 2009, Jules Bean wrote:
There are programming styles which avoid using 'head'. You are free to use
those if you don't like it. I myself am content to use 'head' on lists which
I know are guaranteed to be non-empty.
Since I became aware that viewl (Data.Sequence) and uncons (By
Continuing our adventures into stylistic and semantic differences:-)
Comparing the 'State' and explicit recursion versions
takeListSt = evalState . mapM (State . splitAt)
-- ..with a derivation leading to..
takeListSt []s = []
takeListSt (h:t) s = x : takeListSt t s'
where
wren ng thornton wrote:
I have long been disappointed by a number of `error`s which shouldn't
be. For example, the fact that `head` and `div` are not total strikes me
as a (solvable) weakness of type checking, rather than things that
should occur as programmer errors/exceptions at runtime. The
On Wed, Mar 25, 2009 at 7:02 PM, Gregory Petrosyan
wrote:
> First of all, thanks everybody for the discussion -- very interesting to read!
>
> Apologies if this is off-topic a bit.
>
> While reading, I have a feeling that proposed solutions are somewhat similar
> to checked exceptions. And IMO the
> From: wren ng thornton
> Dan Weston wrote:
>> So to be clear with the terminology:
>>
>> inductive = good consumer?
>> coinductive = good producer?
>>
>> So fusion should be possible (automatically? or do I need a GHC rule?) with
>> inductive . coinductive
>>
>> Or have I bungled it?
>
> Not
2009/3/26 Thomas Hartman :
>> Beginner list processing code can and often does go awry when presented with
>> infinite lists.
>
> I didn't mean code that a beginner would write, I mean code that would
> be easy to understand for a beginner to read
For that, in this particular example, a type sign
2009/3/23 Andrew Butterfield
> Benjamin L.Russell wrote:
>
>> This is wonderful--just what I was waiting for! The application looks
>> beautiful, and I'm very happy that GHCi now has a matching GUI
>> application along the lines of WinHugs.
>>
>>
> Indeed - me too !
>
>> It would be even better
-- Forwarded message --
From: Pepe Gallardo
Date: 2009/3/25
Subject: Re: [Haskell-cafe] Re: ANNOUNCE: WinGhci, a GUI for GHCI on Windows
To: "Benjamin L.Russell"
Hi Benjamin*,*
**
The only requirement to run WinGhci is to have GHC installed and to have GHC
bin directory on your
After reading the chapter about parsers in Bird's book, I tried to implement
a simple parser myself, and this was a great experience, a real eye opener
on how declarative and composable Haskell can be. Haskell is... well magic
:-) It gave me same kind of joy I had when I made my first moving sprite
2009/3/25 wren ng thornton :
>> Most of the "documentation" is in research papers, and a "normal"
>> programmer don't want to read these papers.
>
> Yes, and no. There is quite a bit of documentation in research papers, and
> mainstream programmers don't read research. However, this is a big part
78 matches
Mail list logo