Re: [Haskell-cafe] Any Haskell events in Madrid next week?

2013-09-06 Thread Salvador Lucas

Hi,

There is a workshop on Functional Programming and also
a conference on programming languages

   http://babel.ls.fi.upm.es/tpf2013/cfp_english.txt

If interested, you can contact the organizers...

Regards,

Salvador.

El 06/09/13 22:59, Joachim Breitner escribió:

Hi,

I'll be visiting Madrid next week (research visit) and I'm wondering if
there are any Haskell or FP Group meeting or other events that might be
interesting? I could possibly contribute a talk. (Both preferably in
English.)

Wednesday or Thursday evening might would most convenient.

Greetings,
Joachim



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Performance of delete-and-return-last-element

2013-08-30 Thread Lucas Paul
Suppose I need to get an element from a data structure, and also
modify the data structure. For example, I might need to get and delete
the last element of a list:

darle xs = ((last xs), (rmlast xs)) where
  rmlast [_] = []
  rmlast (y:ys) = y:(rmlast ys)

There are probably other and better ways to write rmlast, but I want
to focus on the fact that darle here, for lack of a better name off
the top of my head, appears to traverse the list twice. Once to get
the element, and once to remove it to produce a new list. This seems
bad. Especially for large data structures, I don't want to be
traversing twice to do what ought to be one operation. To fix it, I
might be tempted to write something like:

darle' [a] = (a, [])
darle' (x:xs) = let (a, ys) = darle' xs in (a, (x:ys))

But this version has lost its elegance. It was also kind of harder to
come up with, and for more complex data structures (like the binary
search tree) the simpler expression is really desirable. Can a really
smart compiler transform/optimize the first definition into something
that traverses the data structure only once? Can GHC?

- Lucas

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Examples of MVars usage

2013-06-12 Thread lucas di cioccio
Hi Francisco,

You can try GitHub's code search
https://github.com/search?l=Haskellq=mvarref=cmdformtype=Code

Cheers,
--Lucas


2013/6/12 Francisco M. Soares Nt. xfrancisco.soa...@gmail.com

 Hello, everyone.

 I am looking for packages on hackage which use MVars extensively. Those
 which create plenty of MVars -- not just one or two for conditional
 synchronization or to keep track of a value throughout the program. My
 purpose is to analyze usage patterns of MVars. Does anybody have any
 suggestions?

 So far I have analyzed a few packages:

 * conjure (0.1)
 * distributed-process (0.4.2)
 * distributed-process-p2p (0.1.1.0)
 * leksah (0.12.1.3)
 * manatee-core (0.1.1)
 * urlcheck (0.1.1)

 Nonetheless, I feel like I still haven't covered a good enough range of
 usage, since some examples are small, and some use MVars just for a small
 number of cases, while the heavy lifting is done with STM. And surely
 because there are only 6 of them.

 Any suggestion will be very much appreciated.

 []'s
 --
 Francisco Soares Nt.


 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] [ANN] Haskell-Paris meetup

2013-06-03 Thread lucas di cioccio
Dear all,

I'm happy to announce that the Haskell-Paris group will meet on June 25th
in Paris. Please register (free) at
http://www.meetup.com/haskell-paris/events/122515522/  .
Program is not decided yet (contributions are welcome). We'll update once
we know the lineup.

I don't like to send spammy emails but I would like to take advantage of
this announcement to invite any non-Parisian Haskellers to get in touch
with us (email, twitter, or meetup page) if you are in town. We may an
event scheduled close in time and we can anyway propose a get-together in a
restaurant so that visitors can taste our great fooddrink and everyone can
chat about her favorite programming language. I did this type of
semi-planned dinners a few times with some Ruby folks and it's a good way
to build ties :).

Regards,
--Lucas DiCioccio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] [announce] second Haskell meetup in Paris

2013-01-11 Thread lucas di cioccio
Hi,

I am pleased to annouce that I'm bootstrapping a Haskell-enthusiastics
group in Paris.

We recently scheduled our second Haskell meetup in Paris.
This meetup will take place next Monday (Monday, January 14, 2013). AF83 (
http://af83.com/ ) has been kind enough to offer us a room for our meeting.
You don't have to, but it is recommended to, register for the meetup on
http://meetup.haskell-paris.fr/ or by sending me an email.

The website for our group is http://haskell-paris.fr/ (in French). You
should pay it a click not only because it's written in Haskell but also to
glance at our logo, propose a talk, or read the digest of past meetup(s).

Regards,
--Lucas DiCioccio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] haskell platform - mac lion - installation error

2012-03-10 Thread Salvador Lucas

Dear Peter,

I recently had a similar problem with the same Haskell Platform version
but on a Macmini (running Lion as well).

I learnt that you have to install the 'command line tools' by using the
'preferences' of your XCode installation. After that, everything will work.

Best regards,

Salvador.

El 10/03/12 10:15, Peter escribió:
Hello - I'm a new user, having some trouble installing the Haskell 
Platform (2011.4.0.0 64bit.pkg) on a Macbook Pro (10.7.3).  I 
installed Xcode 4.3.1 (4E1019), then the Haskell Platform. When I 
double-click on the Platform package icon, I get an installation 
dialogue with an error message reading Developer Tools Missing - 
Please install Xcode developer tools first.  Are Xcode developer 
tools something distinct from Xcode itself?  I'm mystified by this 
error message.  Any assistance would be greatly appreciated - thank you.



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Salvador Lucas

Dear Martin,

I think that the (practical) reason is avoiding equality checks during 
pattern matching.


For instance, how do you evaluate this:

  foo ((+1):(1+):[])?

Both expressions in the first and second entries of the list are 
semantically equivalent,
but from an operational point of view, you have to ensure the equality 
of two functions

over an infinite domain (of integer numbers).

Best regards,

Salvador.


Martin Hofmann escribió:

It is pretty clear, that the following is not a valid Haskell pattern:

foo (x:x:xs) = x:xs

My questions is _why_ this is not allowed. IMHO, the semantics should be
clear: The pattern is expected to succeed, iff 'x' is each time bound to
the same term. 


Isn't this allowed, because this would require a strict evaluation of
the 'x' variables?

Thanks,

Martin

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
  


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-03 Thread lucas
On Fri, Apr 03, 2009 at 10:22:07AM +0200, Ketil Malde wrote:
 lu...@die.net.au writes:
 
  I'm relatively new to haskell so as one does, I am rewriting an
  existing program in haskell to help learn the language.
 
  However, it eats up all my RAM whenever I run the program.
 
 This typically happens to me when I parse large files and either am a)
 using a parser that is too strict (like Luke says) or b) using a
 parser that is too lazy - or rather, it parses into a lazy data
 structure which is then populated with unevaluated thunks holding onto
 the input data.
 

Thanks for all the help everyone . I've decided to dump Parsec, as the file
structure is simple enough to implement using basic list manipulation
(which is, I've read, one of haskell's strong points) and has turned
out to be much simpler code.

I think I was reading the write your own scheme tutorial when I
started writing that code, so natually started using parsec.

As a side note, I was reading the I/O section of RWH last night and
came across the lazy vs. strict I/O part, however it didn't occur to
me that Parsec was strict.

Anyway, thanks for all the help and suggestions.

-- 
Lucas Hazel lu...@die.net.au


pgp5StOlyFrnV.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-03 Thread lucas
On Fri, Apr 03, 2009 at 10:27:08PM +1100, lu...@die.net.au wrote:
 On Fri, Apr 03, 2009 at 10:22:07AM +0200, Ketil Malde wrote:
  lu...@die.net.au writes:
  
   I'm relatively new to haskell so as one does, I am rewriting an
   existing program in haskell to help learn the language.
  
   However, it eats up all my RAM whenever I run the program.
  
 
 Thanks for all the help everyone . I've decided to dump Parsec, as the file
 structure is simple enough to implement using basic list manipulation
 (which is, I've read, one of haskell's strong points) and has turned
 out to be much simpler code.
 

Using lazy I/O has reduced run time by 75% and RAM consumption to 3MB

Thank you :)

-- 
Lucas Hazel lu...@die.net.au


pgpPMNEI3nA3B.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-02 Thread lucas
I'm relatively new to haskell so as one does, I am rewriting an
existing program in haskell to help learn the language.

However, it eats up all my RAM whenever I run the program.

http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3175#a3175

Obviously I'm doing something wrong, but without my magical FP pants I
don't know what that might be.

-- 
Lucas Hazel lu...@die.net.au


pgpCpy889Gy8E.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Program using 500MB RAM to process 5MB file

2009-04-02 Thread lucas
On Thu, Apr 02, 2009 at 07:55:07PM -0400, Rick R wrote:
 You could profile your app for memory usage. Then you could figure out just
 what function is blowing up the mem usage and figure out how to optimize it.
 
 
 http://book.realworldhaskell.org/read/profiling-and-optimization.html
 
 
 2009/4/2 lu...@die.net.au
 
  I'm relatively new to haskell so as one does, I am rewriting an
  existing program in haskell to help learn the language.
 
  However, it eats up all my RAM whenever I run the program.
 
  http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3175#a3175
 
  Obviously I'm doing something wrong, but without my magical FP pants I
  don't know what that might be.
 

I ran some profiling as suggested,

[SNIP]

total time  =8.36 secs   (418 ticks @ 20 ms)
total alloc = 3,882,593,720 bytes  (excludes profiling overheads)

COST CENTREMODULE   %time %alloc

line   PkgDb 89.7   93.5

COST CENTRE MODULE no. entries %time %alloc %time %alloc
linePkgDb  305 109771  89.7  93.3   89.7  93.3

[SNIP]

The line function is part of the file parser

line :: Parser String
line = anyChar `manyTill` newline

files' :: Parser Files
files' = line `manyTill` newline

Perhaps I should also explain the structure of the file. It's for a
simple package manager called pkgutils, used for CRUX[1]. The file
contains information for all the packages installed and is structured
as follows

package name
package version
file
file
...
file

package name
...

From profiling it shows that the memory is simple consumed by reading
in all the lines, the graph from using -p -hd shows an almost Ologn2
growth of the heap as the collection of lines grows.

Is there a better way to do this?

[1] http://crux.nu
-- 
Lucas Hazel lu...@die.net.au


pgplYxxA2pBsy.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Question on case x of g when g is a function

2005-01-27 Thread Salvador Lucas
Because both bit0 and bit1 are free *local* variables
within the case expression. So, they have nothing
to do with your defined functions bit0 and bit1.
Best regards,
Salvador.
[EMAIL PROTECTED] wrote:
Can a kind soul please enlighten me on why f bit0 and f bit1 
both return 0?

 

bit0 = False
bit1 = True
f x = case x of
   bit0 - 0
   bit1 - 1
   

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
 

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe