Re: [Haskell-cafe] Message

2011-11-07 Thread Alex Kropivny
Short answer: no, and what it gives is quite different.


Long answer:

Erlang gives me two things that are hard to replicate:
1. firm-realtime performance, even at high load: the distributed GC is very
nice
2. a very well defined model for handling, and recovering from failure

Hot code reload is nice, but is mostly used as a bandaid for the multitude
of bugs present with dynamic typing and a let it crash (minimal defensive
programming, let process isolation handle bad cases by failing) approach.
So it's absence in Haskell doesn't bother me.

1 is a personal preference that's been useful in a couple of projects. It's
application specific and probably not a factor for most people, I just had
a chance to enjoy it.

2 is solved in Erlang via techniques and know-how built up from years of
practice and testing. High level abstractions like supervision trees,
restart types, and gen_servers are well known. Most importantly, the
correct way to use them to build robust systems is well known. This is
definitely duplicateable, it just needs some time and lots of testing to
reach the same level of trust I've got for Erlang.

My Haskell code is mostly total, and avoids failure-in-the-small (stupid
bugs) amazingly well.

My Erlang code is an onion of recovery points, and avoids
failure-in-the-large (hardware/link failures, nasty corner cases) amazingly
well.

CloudHaskell looks like it provides the fundamental abstractions needed to
start building the onion, and bring Erlang's robustness to Haskell. Getting
to the same point will take time and effort, but I think is possible.

On Thu, Nov 3, 2011 at 9:09 PM, Ryan Newton rrnew...@gmail.com wrote:

  I have interfaced Erlang and Haskell... And delivered it as a product.  I
  just came up with a dead-simple text based communication syntax from
 Erlang
  to Haskell that was very easily testable.  It allowed for complete
 isolation

 Interesting.  I can't imagine there are too many people who have done
 this.  So I must ask -- given the explicit attempt to imitate Erlang
 in recent CloudHaskell work, does that come close to giving you
 everything you would have wanted in this app?

 (Hot code update being the big missing piece.)

 Cheers,
   -Ryan

 ___
 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] Message

2011-11-04 Thread David Leimbach
On Thu, Nov 3, 2011 at 9:09 PM, Ryan Newton rrnew...@gmail.com wrote:

  I have interfaced Erlang and Haskell... And delivered it as a product.  I
  just came up with a dead-simple text based communication syntax from
 Erlang
  to Haskell that was very easily testable.  It allowed for complete
 isolation

 Interesting.  I can't imagine there are too many people who have done
 this.  So I must ask -- given the explicit attempt to imitate Erlang
 in recent CloudHaskell work, does that come close to giving you
 everything you would have wanted in this app?


I don't know, as I've not looked at all at CloudHaskell at all.  My current
job doesn't really give me a lot of time for it.

There's definite advantages to polyglot programming approaches.  The
difficulty is in the glue, and that doesn't have to really be that
difficult.  I just picked a text based protocol that was really easy to
implement and understand as well as test externally.  No XML, no JSON,
nothing standardized, just tiny and really obvious.  With a sufficiently
simple protocol getting C++, haskell and erlang on the same page was pretty
trivial, and the separation of concerns for each piece was really well
drawn.

It felt like what was meant by the unix philosophy of one good tool for
each job coordinated over pipes because well that's exactly what I did.

Dave


 (Hot code update being the big missing piece.)

 Cheers,
   -Ryan

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


Re: [Haskell-cafe] Message

2011-11-03 Thread Ryan Newton
 I have interfaced Erlang and Haskell... And delivered it as a product.  I
 just came up with a dead-simple text based communication syntax from Erlang
 to Haskell that was very easily testable.  It allowed for complete isolation

Interesting.  I can't imagine there are too many people who have done
this.  So I must ask -- given the explicit attempt to imitate Erlang
in recent CloudHaskell work, does that come close to giving you
everything you would have wanted in this app?

(Hot code update being the big missing piece.)

Cheers,
  -Ryan

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


Re: [Haskell-cafe] Message

2011-10-22 Thread Claus Reinke
The world needs programmers to accept and take seriously Greg 
Wilson's extensible programming, and stop laughing it off as lolwut 
wysiwyg msword for programming, and start implementing it.

http://third-bit.com/blog/archives/4302.html


Who is the world? For starters, I don't think it is Greg Wilson's
idea, and if you look for alternate sources, often under other titles, 
you'll find parts of it implemented, with varying degrees of success
and often little acceptance. The idea is much older than one might 
think - conferences on extensible languages were held around 1970. 

Early implementation approximations didn't have the disposable 
computing power of today's PCs, nor did early implementers find
an audience ready for their ideas (to feed their students or 
themselves, some of those who were such ahead of the curve 
had to switch to working on more conventional, funded, topics).


Useful search keys:

- extensible languages (as in AI, the meaning of extensible tends
   to be redefined whenever a problem gets solved, so many features
   that used to mark an extensible language in the past have now
   become standard)

- structure editors (in that they were forerunners of projectional
   IDEs, and exhibited some of their advantages and disadvantages;
   there have been many efforts to generate structure editors from 
   language descriptions)


- projectional language workbenches (instead of parsing source
   to AST, the IDE/workbench operates on an AST-like abstract
   model, and source code views are just projections of that; 
   makes it easier to embed sublanguages);


   Smalltalkers will probably claim their image-based IDEs have
   been doing that all along.

- hyper-programming (where persistent runtime data can be 
   embedded in code via linking, similar to hypertext, with

   generic editors instead of generic Read/Show)

- Banana Algebra: Syntactic Language Extension via an Algebra 
   of Languages and Transformations (one example of research

   on language composition)

IDE generators, IDE tooling for domain-specific languages, 
language-oriented programming, language workbenches, ... 
they all contribute to the now broader interest in the topic.


In the context of Haskell, there once was Keith Hanna's
document-centered programming:

http://www.cs.kent.ac.uk/projects/vital/
http://www.cs.kent.ac.uk/projects/pivotal/

Perhaps Keith's projects can serve as an inspiration to just 
start hacking?-) The subject is an instance of these quotes:


The future is already here - it's just not very evenly distributed.
William Gibson

The best way to predict the future is to invent it.
Alan Kay

Claus
http://clausreinke.github.com/



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


Re: [Haskell-cafe] Message

2011-10-22 Thread MigMit
Yeah, I was going to mention Smalltalk too, as one of the languages NOT using 
plain text to store programs — which led to a very strong boundary between ST 
and other world, not doing any favors to the first.

The idea of using some non-plaintext-based format to store programs appeared 
lots of times, without any significant achivements. And I think one of the main 
reasons for that is that it makes interacting with other tools extremely 
difficult. Not just with pre-existing tools. Even if grep didn't exist, it 
would be very easy to hack something like it if you need to search your 
codebase for a specific word; you don't need any complex APIs to read plain 
text files, there are just two functions — one to read a line of code, and 
another one to check for eof. Similarly, it's easy to generate your Java files 
with a Perl script — with Perl itself not knowing anything about Java. Text has 
the advantage of being SIMPLE — and the vague idea of embedding a spreadsheet 
in your code (what the hell for?) doesn't come close to beating it.

And you know what? You don't really need to give up text-based storage to have 
graphic capabilities. Windows resources files (.rc) are text-based, and there 
are plenty of visual editors for them, including one in Visual Studio; and, 
thankfully, it still produces the same old text-based file — and sometimes it's 
very desirable to look into one, for example, if you want to know which control 
is tagged with this ID.

Отправлено с iPad

22.10.2011, в 21:06, Claus Reinke claus.rei...@talk21.com написал(а):

 The world needs programmers to accept and take seriously Greg Wilson's 
 extensible programming, and stop laughing it off as lolwut wysiwyg msword 
 for programming, and start implementing it.
 http://third-bit.com/blog/archives/4302.html
 
 Who is the world? For starters, I don't think it is Greg Wilson's
 idea, and if you look for alternate sources, often under other titles, you'll 
 find parts of it implemented, with varying degrees of success
 and often little acceptance. The idea is much older than one might think - 
 conferences on extensible languages were held around 1970. 
 Early implementation approximations didn't have the disposable computing 
 power of today's PCs, nor did early implementers find
 an audience ready for their ideas (to feed their students or themselves, some 
 of those who were such ahead of the curve had to switch to working on more 
 conventional, funded, topics).
 
 Useful search keys:
 
 - extensible languages (as in AI, the meaning of extensible tends
   to be redefined whenever a problem gets solved, so many features
   that used to mark an extensible language in the past have now
   become standard)
 
 - structure editors (in that they were forerunners of projectional
   IDEs, and exhibited some of their advantages and disadvantages;
   there have been many efforts to generate structure editors fromlanguage 
 descriptions)
 
 - projectional language workbenches (instead of parsing source
   to AST, the IDE/workbench operates on an AST-like abstract
   model, and source code views are just projections of that;makes it 
 easier to embed sublanguages);
 
   Smalltalkers will probably claim their image-based IDEs have
   been doing that all along.
 
 - hyper-programming (where persistent runtime data can beembedded in code 
 via linking, similar to hypertext, with
   generic editors instead of generic Read/Show)
 
 - Banana Algebra: Syntactic Language Extension via an Algebraof Languages 
 and Transformations (one example of research
   on language composition)
 
 IDE generators, IDE tooling for domain-specific languages, language-oriented 
 programming, language workbenches, ... they all contribute to the now broader 
 interest in the topic.
 
 In the context of Haskell, there once was Keith Hanna's
 document-centered programming:
 
 http://www.cs.kent.ac.uk/projects/vital/
 http://www.cs.kent.ac.uk/projects/pivotal/
 
 Perhaps Keith's projects can serve as an inspiration to just start hacking?-) 
 The subject is an instance of these quotes:
 
 The future is already here - it's just not very evenly distributed.
 William Gibson
 
 The best way to predict the future is to invent it.
 Alan Kay
 
 Claus
 http://clausreinke.github.com/
 
 
 ___
 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] Message

2011-10-21 Thread Goutam Tmv

Would you ever see yourself write a web application like Twitter or Facebook in 
Haskell?
  ___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Message

2011-10-21 Thread Yves Parès
Wow, controversial point I guess...
I would add: and if yes, what would you use and why?

2011/10/21 Goutam Tmv vo1d_poin...@live.com

  Would you ever see yourself write a web application like Twitter or
 Facebook in Haskell?

 ___
 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] Message

2011-10-21 Thread Michael Snoyman
This is clearly a job for node.js and the /dev/null data store, since
they are so web scale~

Less sarcasm: I think any of the main Haskell web frameworks (Yesod,
Happstack, Snap) could scale better than Ruby or PHP, and would use
any of those in a heartbeat for such a venture. I'd personally use
Yesod.

I think data store would be a trickier issue. I'd likely use one of
the key/value stores out there, possibly Redis, though I'd really need
to do more research to give a real answer.

Michael

On Fri, Oct 21, 2011 at 9:42 AM, Yves Parès limestr...@gmail.com wrote:
 Wow, controversial point I guess...
 I would add: and if yes, what would you use and why?

 2011/10/21 Goutam Tmv vo1d_poin...@live.com

 Would you ever see yourself write a web application like Twitter or
 Facebook in Haskell?

 ___
 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 mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Message

2011-10-21 Thread Ivan Lazar Miljenovic
2011/10/21 Goutam Tmv vo1d_poin...@live.com:
 Would you ever see yourself write a web application like Twitter or Facebook
 in Haskell?

No.  But then, I wouldn't write a web application like either of them
in _any_ language.

Now, if your question was is Haskell a good language for writing
large-scale web applications such as ..., then that's a different
story... and one I'm not qualified to answer.

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

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


Re: [Haskell-cafe] Message

2011-10-21 Thread Matti Oinas
I don't think I'm going to write next twitter or facebook but yes, it
is on my TODO list. If such an applications can be written with
languages like PHP then why not. Can't think of any language that is
worse than PHP but still there are lots of web applications written
with that. Even I have written many using PHP.

Why I would use Haskell? To see if it is better option to that problem
than other languages.

I have allready installed Yesod but for now I don't have enough time
to work on this project. After 6 months the situation should be
different.

2011/10/21 Michael Snoyman mich...@snoyman.com:
 This is clearly a job for node.js and the /dev/null data store, since
 they are so web scale~

 Less sarcasm: I think any of the main Haskell web frameworks (Yesod,
 Happstack, Snap) could scale better than Ruby or PHP, and would use
 any of those in a heartbeat for such a venture. I'd personally use
 Yesod.

 I think data store would be a trickier issue. I'd likely use one of
 the key/value stores out there, possibly Redis, though I'd really need
 to do more research to give a real answer.

 Michael

 On Fri, Oct 21, 2011 at 9:42 AM, Yves Parès limestr...@gmail.com wrote:
 Wow, controversial point I guess...
 I would add: and if yes, what would you use and why?

 2011/10/21 Goutam Tmv vo1d_poin...@live.com

 Would you ever see yourself write a web application like Twitter or
 Facebook in Haskell?

 ___
 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 mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe




-- 
/***/

try {
   log.trace(Id= + request.getUser().getId() +  accesses  +
manager.getPage().getUrl().toString())
} catch(NullPointerException e) {}

/***/

This is a real code, but please make the world a bit better place and
don’t do it, ever.

* http://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html *

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


Re: [Haskell-cafe] Message

2011-10-21 Thread Alex Kropivny
Let's look at this from a high, project management level. Twitter ran on...
Ruby initially? Facebook ran on PHP.

Immediately this tells me that programming language choice wasn't a factor
in their success. One succeeded in building a large throughput system with a
slow language, the other succeeded in building a massively popular website
with a bad one.

What hard problems did they have to solve?

Twitter had to deal with scalability, distribution, and massive throughput.
These are hard problems on their own, and are non-trivial even in languages
tailor made to handle them. (Although using Erlang would make things a good
deal easier.)

Facebook is not a technical problem at all. There are interesting challenges
hidden within (ad targeting and friend feed optimization) but they're tiny,
isolated components. Rapid development and prototyping of features help
Facebook, but if the features are easy CRUD stuff it's perfectly cost
effective to hire a pile of PHP developers to do them.


One has problems that are hard regardless of tool choice, the other has no
hard problems at all. No Haskell needed, use whatever language you can
outsource overseas.



With that in mind. Using Haskell gives you an edge, for most problems, even
the ones with poor libraries. If you can get the programmer manpower you
need, it is a clear advantage over your competition.

Your startup may not need that advantage - as Facebook retrospectively
didn't - but you don't know that when just starting out. If Facebook went
deep into user behaviour analysis and newsfeed optimization, the way OkCupid
has with dating, Haskell would suddenly stand out.

If you need every advantage you can get, you use the best tools for the job.
Haskell is one of the best and shiniest - I personally would use Erlang for
any embarrassingly parallel parts of the service and do the rest in Haskell.


On Fri, Oct 21, 2011 at 1:00 AM, Matti Oinas matti.oi...@gmail.com wrote:

 I don't think I'm going to write next twitter or facebook but yes, it
 is on my TODO list. If such an applications can be written with
 languages like PHP then why not. Can't think of any language that is
 worse than PHP but still there are lots of web applications written
 with that. Even I have written many using PHP.

 Why I would use Haskell? To see if it is better option to that problem
 than other languages.

 I have allready installed Yesod but for now I don't have enough time
 to work on this project. After 6 months the situation should be
 different.

 2011/10/21 Michael Snoyman mich...@snoyman.com:
  This is clearly a job for node.js and the /dev/null data store, since
  they are so web scale~
 
  Less sarcasm: I think any of the main Haskell web frameworks (Yesod,
  Happstack, Snap) could scale better than Ruby or PHP, and would use
  any of those in a heartbeat for such a venture. I'd personally use
  Yesod.
 
  I think data store would be a trickier issue. I'd likely use one of
  the key/value stores out there, possibly Redis, though I'd really need
  to do more research to give a real answer.
 
  Michael
 
  On Fri, Oct 21, 2011 at 9:42 AM, Yves Parès limestr...@gmail.com
 wrote:
  Wow, controversial point I guess...
  I would add: and if yes, what would you use and why?
 
  2011/10/21 Goutam Tmv vo1d_poin...@live.com
 
  Would you ever see yourself write a web application like Twitter or
  Facebook in Haskell?
 
  ___
  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 mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 



 --
 /***/

 try {
log.trace(Id= + request.getUser().getId() +  accesses  +
 manager.getPage().getUrl().toString())
 } catch(NullPointerException e) {}

 /***/

 This is a real code, but please make the world a bit better place and
 don’t do it, ever.

 *
 http://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html*

 ___
 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] Message

2011-10-21 Thread Øystein Kolsrud
I don't know if you are familiar with it, but perhaps this article can be of
interest to you:

http://www.paulgraham.com/avg.html

And a little historical summary:

http://en.wikipedia.org/wiki/Viaweb

Best regards,
Øystein Kolsrud

2011/10/21 Goutam Tmv vo1d_poin...@live.com

  Would you ever see yourself write a web application like Twitter or
 Facebook in Haskell?

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




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


Re: [Haskell-cafe] Message

2011-10-21 Thread Yves Parès
That's interesting, have you ever worked on interfacing Erlang with Haskell?

BTW, Twitter switched to Scala, so obviously their initial choice of Ruby
end up invalidated.

2011/10/21 Alex Kropivny alex.kropi...@gmail.com

 Let's look at this from a high, project management level. Twitter ran on...
 Ruby initially? Facebook ran on PHP.

 Immediately this tells me that programming language choice wasn't a factor
 in their success. One succeeded in building a large throughput system with a
 slow language, the other succeeded in building a massively popular website
 with a bad one.

 What hard problems did they have to solve?

 Twitter had to deal with scalability, distribution, and massive throughput.
 These are hard problems on their own, and are non-trivial even in languages
 tailor made to handle them. (Although using Erlang would make things a good
 deal easier.)

 Facebook is not a technical problem at all. There are interesting
 challenges hidden within (ad targeting and friend feed optimization) but
 they're tiny, isolated components. Rapid development and prototyping of
 features help Facebook, but if the features are easy CRUD stuff it's
 perfectly cost effective to hire a pile of PHP developers to do them.


 One has problems that are hard regardless of tool choice, the other has no
 hard problems at all. No Haskell needed, use whatever language you can
 outsource overseas.



 With that in mind. Using Haskell gives you an edge, for most problems, even
 the ones with poor libraries. If you can get the programmer manpower you
 need, it is a clear advantage over your competition.

 Your startup may not need that advantage - as Facebook retrospectively
 didn't - but you don't know that when just starting out. If Facebook went
 deep into user behaviour analysis and newsfeed optimization, the way OkCupid
 has with dating, Haskell would suddenly stand out.

 If you need every advantage you can get, you use the best tools for the
 job. Haskell is one of the best and shiniest - I personally would use Erlang
 for any embarrassingly parallel parts of the service and do the rest in
 Haskell.


 On Fri, Oct 21, 2011 at 1:00 AM, Matti Oinas matti.oi...@gmail.comwrote:

 I don't think I'm going to write next twitter or facebook but yes, it
 is on my TODO list. If such an applications can be written with
 languages like PHP then why not. Can't think of any language that is
 worse than PHP but still there are lots of web applications written
 with that. Even I have written many using PHP.

 Why I would use Haskell? To see if it is better option to that problem
 than other languages.

 I have allready installed Yesod but for now I don't have enough time
 to work on this project. After 6 months the situation should be
 different.

 2011/10/21 Michael Snoyman mich...@snoyman.com:
  This is clearly a job for node.js and the /dev/null data store, since
  they are so web scale~
 
  Less sarcasm: I think any of the main Haskell web frameworks (Yesod,
  Happstack, Snap) could scale better than Ruby or PHP, and would use
  any of those in a heartbeat for such a venture. I'd personally use
  Yesod.
 
  I think data store would be a trickier issue. I'd likely use one of
  the key/value stores out there, possibly Redis, though I'd really need
  to do more research to give a real answer.
 
  Michael
 
  On Fri, Oct 21, 2011 at 9:42 AM, Yves Parès limestr...@gmail.com
 wrote:
  Wow, controversial point I guess...
  I would add: and if yes, what would you use and why?
 
  2011/10/21 Goutam Tmv vo1d_poin...@live.com
 
  Would you ever see yourself write a web application like Twitter or
  Facebook in Haskell?
 
  ___
  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 mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 



 --
 /***/

 try {
log.trace(Id= + request.getUser().getId() +  accesses  +
 manager.getPage().getUrl().toString())
 } catch(NullPointerException e) {}

 /***/

 This is a real code, but please make the world a bit better place and
 don’t do it, ever.

 *
 http://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html*

 ___
 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 

Re: [Haskell-cafe] Message

2011-10-21 Thread David Leimbach
On Fri, Oct 21, 2011 at 8:02 AM, Yves Parès limestr...@gmail.com wrote:

 That's interesting, have you ever worked on interfacing Erlang with
 Haskell?


I have interfaced Erlang and Haskell... And delivered it as a product.  I
just came up with a dead-simple text based communication syntax from Erlang
to Haskell that was very easily testable.  It allowed for complete isolation
of components and them to be developed and debugged in parallel.  The
Haskell code was an Erlang pipe driver, which, in turn was connected to a
C program to drive a polling interface, controlled by Haskell with the fancy
IO done in C.  All of this was on a relatively small linux appliance.

I'm pretty proud of that little system.  It was quickly done, and I was able
to mock out various pieces of it very quickly as well.  When the hardware it
was meant to control finally arrived I think I only spent a few extra hours
turning the screws to make it work for real and then we discovered
wiring problems :-)


 BTW, Twitter switched to Scala, so obviously their initial choice of Ruby
 end up invalidated.


I believe they have Java, Clojure and Scala actually.  I know of a guy doing
a start up using only Go, and that language is not even fully released yet.
 They're most definitely using Clojure in their Storm realtime event
processing framework anyway, and it's freely available.

Other than finding people who can come work for you writing good Haskell
code, I don't see any reason to avoid doing a startup using that language as
a code base.  The Haskell Platform makes things a little nicer, but needs to
have more regular releases.  Go comes with a lot of batteries already
making it slightly more attractive.

Dave



 2011/10/21 Alex Kropivny alex.kropi...@gmail.com

 Let's look at this from a high, project management level. Twitter ran
 on... Ruby initially? Facebook ran on PHP.

 Immediately this tells me that programming language choice wasn't a factor
 in their success. One succeeded in building a large throughput system with a
 slow language, the other succeeded in building a massively popular website
 with a bad one.

 What hard problems did they have to solve?

 Twitter had to deal with scalability, distribution, and massive
 throughput. These are hard problems on their own, and are non-trivial even
 in languages tailor made to handle them. (Although using Erlang would make
 things a good deal easier.)

 Facebook is not a technical problem at all. There are interesting
 challenges hidden within (ad targeting and friend feed optimization) but
 they're tiny, isolated components. Rapid development and prototyping of
 features help Facebook, but if the features are easy CRUD stuff it's
 perfectly cost effective to hire a pile of PHP developers to do them.


 One has problems that are hard regardless of tool choice, the other has no
 hard problems at all. No Haskell needed, use whatever language you can
 outsource overseas.



 With that in mind. Using Haskell gives you an edge, for most problems,
 even the ones with poor libraries. If you can get the programmer manpower
 you need, it is a clear advantage over your competition.

 Your startup may not need that advantage - as Facebook retrospectively
 didn't - but you don't know that when just starting out. If Facebook went
 deep into user behaviour analysis and newsfeed optimization, the way OkCupid
 has with dating, Haskell would suddenly stand out.

 If you need every advantage you can get, you use the best tools for the
 job. Haskell is one of the best and shiniest - I personally would use Erlang
 for any embarrassingly parallel parts of the service and do the rest in
 Haskell.


 On Fri, Oct 21, 2011 at 1:00 AM, Matti Oinas matti.oi...@gmail.comwrote:

 I don't think I'm going to write next twitter or facebook but yes, it
 is on my TODO list. If such an applications can be written with
 languages like PHP then why not. Can't think of any language that is
 worse than PHP but still there are lots of web applications written
 with that. Even I have written many using PHP.

 Why I would use Haskell? To see if it is better option to that problem
 than other languages.

 I have allready installed Yesod but for now I don't have enough time
 to work on this project. After 6 months the situation should be
 different.

 2011/10/21 Michael Snoyman mich...@snoyman.com:
  This is clearly a job for node.js and the /dev/null data store, since
  they are so web scale~
 
  Less sarcasm: I think any of the main Haskell web frameworks (Yesod,
  Happstack, Snap) could scale better than Ruby or PHP, and would use
  any of those in a heartbeat for such a venture. I'd personally use
  Yesod.
 
  I think data store would be a trickier issue. I'd likely use one of
  the key/value stores out there, possibly Redis, though I'd really need
  to do more research to give a real answer.
 
  Michael
 
  On Fri, Oct 21, 2011 at 9:42 AM, Yves Parès limestr...@gmail.com
 wrote:
  Wow, controversial point I guess...
 

Re: [Haskell-cafe] Message

2011-10-21 Thread Albert Y. C. Lai

On 11-10-21 03:59 AM, Ivan Lazar Miljenovic wrote:

2011/10/21 Goutam Tmvvo1d_poin...@live.com:

Would you ever see yourself write a web application like Twitter or Facebook
in Haskell?


No.  But then, I wouldn't write a web application like either of them
in _any_ language.


+1

The world does not need another Twitter, another Facebook, another 
Reddit, another graphics engine, another database system, or another 
operating system.


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


Re: [Haskell-cafe] Message

2011-10-21 Thread aditya siram
Non snarky question - what does it need?
-deech

On Fri, Oct 21, 2011 at 12:51 PM, Albert Y. C. Lai tre...@vex.net wrote:
 On 11-10-21 03:59 AM, Ivan Lazar Miljenovic wrote:

 2011/10/21 Goutam Tmvvo1d_poin...@live.com:

 Would you ever see yourself write a web application like Twitter or
 Facebook
 in Haskell?

 No.  But then, I wouldn't write a web application like either of them
 in _any_ language.

 +1

 The world does not need another Twitter, another Facebook, another Reddit,
 another graphics engine, another database system, or another operating
 system.

 ___
 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] Message

2011-10-21 Thread Tom Murphy
Ok, I'll bite: what's it need?

- Tom / amindfv


On Fri, Oct 21, 2011 at 1:51 PM, Albert Y. C. Lai tre...@vex.net wrote:

 On 11-10-21 03:59 AM, Ivan Lazar Miljenovic wrote:

 2011/10/21 Goutam Tmvvo1d_poin...@live.com:

 Would you ever see yourself write a web application like Twitter or
 Facebook
 in Haskell?


 No.  But then, I wouldn't write a web application like either of them
 in _any_ language.


 +1

 The world does not need another Twitter, another Facebook, another Reddit,
 another graphics engine, another database system, or another operating
 system.


 __**_
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://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] Message

2011-10-21 Thread Gaius Hammond
There's no technical reason why not; Twitter is written in Scala and Facebook's 
chat system in Erlang. 


Would I see *myself* working at one of these companies? Not likely. 


Cheers,


G



--

-Original Message-
From: Goutam Tmv vo1d_poin...@live.com
Sender: haskell-cafe-boun...@haskell.org
Date: Fri, 21 Oct 2011 15:37:42 
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Message

___
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] Message

2011-10-21 Thread Albert Y. C. Lai

On 11-10-21 01:57 PM, aditya siram wrote:
 Non snarky question - what does it need?

On 11-10-21 01:58 PM, Tom Murphy wrote:

Ok, I'll bite: what's it need?


Thank you for asking.

The world needs another tutorial on lazy evaluation for Haskell. There 
are currently only 0.5, and it is written by me. While I will complete 
it to 1, the world needs 3. (Generally, the world needs 3 tutorials for 
every subject.)

http://www.vex.net/~trebla/haskell/lazy.xhtml

The world needs programmers to accept and take seriously Greg Wilson's 
extensible programming, and stop laughing it off as lolwut wysiwyg 
msword for programming, and start implementing it.

http://third-bit.com/blog/archives/4302.html

The world needs more applied formal methods.
http://vstte.ethz.ch/pdfs/vstte-hoare-misra.pdf

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


Re: [Haskell-cafe] Message

2011-10-21 Thread Alex Kropivny
Yes I did, in detail. There are two trivial solutions I like:

1. The BERT library (http://bert-rpc.org/) uses Erlang terms for the
protocol, and has straightforward mappings to Haskell equivalents.
- Pros: trivial on both sides, Erlang terms are really good primitives to
build a protocol from
- Cons: Erlang likes using large (5 to 10 size) tuples and Haskell doesn't,
protocol needs to take that into account

2. JSON over HTTP, Erlang's the server Haskell's the client.
- Pros: discoverable, flexible, readable, language agnostic.
- Cons: I don't really know how to use Haskell JSON libraries + which ones
are good, and good REST API design can be tricky.

For higher performance there are other options, but these are the ones I
like most. I used 1 to decent effect when using QuickCheck to test an Erlang
system.

On Fri, Oct 21, 2011 at 8:02 AM, Yves Parès limestr...@gmail.com wrote:

 That's interesting, have you ever worked on interfacing Erlang with
 Haskell?

 BTW, Twitter switched to Scala, so obviously their initial choice of Ruby
 end up invalidated.


 2011/10/21 Alex Kropivny alex.kropi...@gmail.com

 Let's look at this from a high, project management level. Twitter ran
 on... Ruby initially? Facebook ran on PHP.

 Immediately this tells me that programming language choice wasn't a factor
 in their success. One succeeded in building a large throughput system with a
 slow language, the other succeeded in building a massively popular website
 with a bad one.

 What hard problems did they have to solve?

 Twitter had to deal with scalability, distribution, and massive
 throughput. These are hard problems on their own, and are non-trivial even
 in languages tailor made to handle them. (Although using Erlang would make
 things a good deal easier.)

 Facebook is not a technical problem at all. There are interesting
 challenges hidden within (ad targeting and friend feed optimization) but
 they're tiny, isolated components. Rapid development and prototyping of
 features help Facebook, but if the features are easy CRUD stuff it's
 perfectly cost effective to hire a pile of PHP developers to do them.


 One has problems that are hard regardless of tool choice, the other has no
 hard problems at all. No Haskell needed, use whatever language you can
 outsource overseas.



 With that in mind. Using Haskell gives you an edge, for most problems,
 even the ones with poor libraries. If you can get the programmer manpower
 you need, it is a clear advantage over your competition.

 Your startup may not need that advantage - as Facebook retrospectively
 didn't - but you don't know that when just starting out. If Facebook went
 deep into user behaviour analysis and newsfeed optimization, the way OkCupid
 has with dating, Haskell would suddenly stand out.

 If you need every advantage you can get, you use the best tools for the
 job. Haskell is one of the best and shiniest - I personally would use Erlang
 for any embarrassingly parallel parts of the service and do the rest in
 Haskell.


 On Fri, Oct 21, 2011 at 1:00 AM, Matti Oinas matti.oi...@gmail.comwrote:

 I don't think I'm going to write next twitter or facebook but yes, it
 is on my TODO list. If such an applications can be written with
 languages like PHP then why not. Can't think of any language that is
 worse than PHP but still there are lots of web applications written
 with that. Even I have written many using PHP.

 Why I would use Haskell? To see if it is better option to that problem
 than other languages.

 I have allready installed Yesod but for now I don't have enough time
 to work on this project. After 6 months the situation should be
 different.

 2011/10/21 Michael Snoyman mich...@snoyman.com:
  This is clearly a job for node.js and the /dev/null data store, since
  they are so web scale~
 
  Less sarcasm: I think any of the main Haskell web frameworks (Yesod,
  Happstack, Snap) could scale better than Ruby or PHP, and would use
  any of those in a heartbeat for such a venture. I'd personally use
  Yesod.
 
  I think data store would be a trickier issue. I'd likely use one of
  the key/value stores out there, possibly Redis, though I'd really need
  to do more research to give a real answer.
 
  Michael
 
  On Fri, Oct 21, 2011 at 9:42 AM, Yves Parès limestr...@gmail.com
 wrote:
  Wow, controversial point I guess...
  I would add: and if yes, what would you use and why?
 
  2011/10/21 Goutam Tmv vo1d_poin...@live.com
 
  Would you ever see yourself write a web application like Twitter or
  Facebook in Haskell?
 
  ___
  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 mailing list
  Haskell-Cafe@haskell.org
  

Re: [Haskell-cafe] message passing style in Monad

2008-09-14 Thread Simon Richard Clarkstone

jinjing wrote:

I found that as I can do

  xs.map(+1).sort

by redefine . to be

  a . f = f a
  infixl 9 .


This looks rather like ($), but backwards.  I believe the F# name for 
this operator is (|), which is also a legal name for it in Haskell. 
Odd, since (|) alone isn't legal.  Calling it (.) will confuse the heck 
out of anyone who maintains your code though, and make any transfer of 
code between your projects and other people's liable to introduce bugs.



I can also do

  readFile readme.markdown . lines . length

by making

  a . b = a .liftM b
  infixl 9 .

Kinda annoying, but the option is there.


Now that looks more interesting.  Another name for it is (=^), since 
it is like (=) but lifts its right argument.  I know the Fudgets 
library uses ^ in operators for a similar lifting meaning.


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


Re: [Haskell-cafe] message passing style in Monad

2008-09-14 Thread Ketil Malde
Simon Richard Clarkstone [EMAIL PROTECTED] writes:

 I can also do

   readFile readme.markdown . lines . length

 by making

(.) = flip fmap

?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] message passing style in Monad

2008-09-10 Thread jinjing
I found that as I can do

  xs.map(+1).sort

by redefine . to be

  a . f = f a
  infixl 9 .

I can also do

  readFile readme.markdown . lines . length

by making

  a . b = a .liftM b
  infixl 9 .

Kinda annoying, but the option is there.

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


[Haskell-cafe] message-passing IPC for Haskell?

2008-07-31 Thread Galchin, Vasili
Hello,

 I have seen postings about work on message-passing IPCs for Haskell. I
like STM but want to keep an open mind ... I can't find those postings. Can
something remind of this work and where/how I can read about?

Very kind regards, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] message-passing IPC for Haskell?

2008-07-31 Thread Thomas M. DuBuisson

  I have seen postings about work on message-passing IPCs for
 Haskell. I like STM but want to keep an open mind ... I can't find
 those postings. Can something remind of this work and where/how I can
 read about?

I made a quick hack composing BSD sockets from Network.Socket for higher level 
IPC.  It was for a one use deal, but you're free to use and improve on the 
library - called 'ipc' on hackage.

Tom


Hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ipc

Basic homepage:
http://www.haskell.org/haskellwiki/IPC


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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-21 Thread Ian Lynagh
On Fri, Jun 20, 2008 at 07:57:58AM +0200, Ketil Malde wrote:
 Albert Y. C. Lai [EMAIL PROTECTED] writes:
 
  While we are kind of on this topic, what makes the characters ħ þ
  prefix operator by default, while º and most other odd ones infix?
 
  alphanumeric vs non-alphanumeric
 
 Testing this, I find that isAlpha is True also for 'º', but as the OP
 claims, Haskell will use it as a(n infix) symbol.

This is a bug in GHC. The characters = '\255' were done specially, but
incorrectly for many of those = '\128'. I'll fix it, probably by just
removing the specialisation for them.


Thanks
Ian

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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-21 Thread jinjing
After some fiddling with this style, here is what I came up with
for the 8 queens problem in the 99 problem set. It's quite entertaining ...
( note: it's brute force and requires a combination library )

queens2 n = n.permutations.filter all_satisfied where
  all_satisfied queens = queens.diff_col  queens.diff_diag
  diff_col queens = queens.unique.is queens
  diff_diag queens =
n .combinations 2
  .map (map (subtract 1))
  .map (id  flip cherry_pick queens)
  .any same_dist.not where
same_dist (row_pair, col_pair) =
  row_pair.foldl1 (-).abs == col_pair.foldl1 (-).abs

  -- generic helper
  cherry_pick ids xs = ids.map (xs !!)
  is a b = a == b
  unique xs = nub xs

Guess this can conclude this experiment :)

jinjing

On Sun, Jun 22, 2008 at 1:10 AM, Ian Lynagh [EMAIL PROTECTED] wrote:
 On Fri, Jun 20, 2008 at 07:57:58AM +0200, Ketil Malde wrote:
 Albert Y. C. Lai [EMAIL PROTECTED] writes:

  While we are kind of on this topic, what makes the characters ħ þ
  prefix operator by default, while º and most other odd ones infix?

  alphanumeric vs non-alphanumeric

 Testing this, I find that isAlpha is True also for 'º', but as the OP
 claims, Haskell will use it as a(n infix) symbol.

 This is a bug in GHC. The characters = '\255' were done specially, but
 incorrectly for many of those = '\128'. I'll fix it, probably by just
 removing the specialisation for them.


 Thanks
 Ian

 ___
 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] message passing style like in Haskell?

2008-06-19 Thread Ketil Malde
jinjing [EMAIL PROTECTED] writes:

 Any way here's the code:

 module Dot where
 import Prelude hiding ( (.) )

 (.) :: a - (a - b) - b
 a . f = f a

 infixl 9 .

Isn't this (roughly?) the same as flip ($)?

As a side note, may I advise you to use another symbol, and leave the
poor dot alone? Overloading it as a module separator is bad enough.
If you have a keyboard that allows greater-than-ascii input, there are
plenty of options: « » ¡ £ ¥ ł € ® ª...

 comparing:

 encode xs = map (\x - (length x,head x)) (group xs)

 encode xs = xs.group.map token where token x = (x.length, x.head)

To be fair, you could write the first line as:

   encode xs = map token (group xs) where token x = (length x, head x)

I'm not normally too enthusiastic about point-free style, but when the
left and right side of the = both end with the same term, there's
really no need to name them, so:

   encode = map token . group where token x = (length x, head x)
   -- using function composition (.), not your definition

I'm not sure that would work with left-to-right composition.

 I found starting with data and working my way to a solution seems to be
 easier to think with, or maybe it's just me ...

For monadic code, there default is = and  which pass things
forward.  There's also = which goes the other way - so I guess
opinions differ.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Duncan Coutts

On Thu, 2008-06-19 at 11:33 +0800, jinjing wrote:
 Hi guys,
 
 This is my second attempt to learn Haskell :)
 
 Any way here's the code:
 
 module Dot where
 import Prelude hiding ( (.) )
 
 (.) :: a - (a - b) - b
 a . f = f a
 
 infixl 9 .

Note that if you redefine (.) composition to be backward application
(flip ($)) then nobody will understand your programs. It's also quite
probably that after reading your own code for a while that you'll not
understand the code that everyone else writes either! :-)

If you want an operator like that, I suggest picking some other symbol.


Duncan

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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Gwern Branwen
On 2008.06.19 11:33:56 +0800, jinjing [EMAIL PROTECTED] scribbled 0.5K 
characters:
 Hi guys,

 This is my second attempt to learn Haskell :)

 Any way here's the code:

 module Dot where
 import Prelude hiding ( (.) )

 (.) :: a - (a - b) - b
 a . f = f a

 infixl 9 .

 So for example, 99 questions: Problem 10
 (*) Run-length encoding of a list.

 comparing:

 encode xs = map (\x - (length x,head x)) (group xs)

 to

 encode xs = xs.group.map token where token x = (x.length, x.head)

 I found starting with data and working my way to a solution seems to be
 easier to think with, or maybe it's just me ...

 What is your thought?

 Jinjing

http://cgi.cse.unsw.edu.au/~dons/blog/2007/07 sez:

encode = map (length  head) . group

decode = concatMap (uncurry replicate)

for a different twist on your approach using arrows.

--
gwern
Kerry W NAVSVS industrial Parvus NAVWAN ISM 8182 NRC Reno


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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Adam Vogt
* On Thursday, June 19 2008, Ketil Malde wrote:

As a side note, may I advise you to use another symbol, and leave the
poor dot alone? Overloading it as a module separator is bad enough.
If you have a keyboard that allows greater-than-ascii input, there are
plenty of options: « » ¡ £ ¥ ł € ® ª...

And even if you have a plain us layout in hardware, you can use 
us-international layout (or whatever it is called).

So we can make haskell sort of like apl...

While we are kind of on this topic, what makes the characters ħ þ prefix 
operator by default, while º and most other odd ones infix?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Chaddaï Fouché
2008/6/19 jinjing [EMAIL PROTECTED]:
 encode xs = xs.group.map token where token x = (x.length, x.head)

Working in this direction is a question of taste, but the choice of
the dot for the operator is a pretty bad idea...

On the other hand, my favourite would be :

encode = map (length  head) . group

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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Brent Yorgey
On Thu, Jun 19, 2008 at 3:35 AM, Ketil Malde [EMAIL PROTECTED] wrote:

 jinjing [EMAIL PROTECTED] writes:

  Any way here's the code:

  module Dot where
  import Prelude hiding ( (.) )

  (.) :: a - (a - b) - b
  a . f = f a

  infixl 9 .

 Isn't this (roughly?) the same as flip ($)?

 As a side note, may I advise you to use another symbol, and leave the
 poor dot alone? Overloading it as a module separator is bad enough.
 If you have a keyboard that allows greater-than-ascii input, there are
 plenty of options: « » ¡ £ ¥ ł € (R) ª...


Note that there already is a standard symbol for this, () from
Control.Arrow.  Well, actually () is more general than backwards function
composition, so maybe making your own symbol is still a good idea while
you're learning.

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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Albert Y. C. Lai

Adam Vogt wrote:
While we are kind of on this topic, what makes the characters ħ þ prefix 
operator by default, while º and most other odd ones infix?


alphanumeric vs non-alphanumeric


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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Derek Elkins
On Thu, 2008-06-19 at 15:24 -0400, Brent Yorgey wrote:
 
 On Thu, Jun 19, 2008 at 3:35 AM, Ketil Malde [EMAIL PROTECTED] wrote:
 jinjing [EMAIL PROTECTED] writes:
 
  Any way here's the code:
 
  module Dot where
  import Prelude hiding ( (.) )
 
  (.) :: a - (a - b) - b
  a . f = f a
 
  infixl 9 .
 
 
 Isn't this (roughly?) the same as flip ($)?
 
 As a side note, may I advise you to use another symbol, and
 leave the
 poor dot alone? Overloading it as a module separator is bad
 enough.
 If you have a keyboard that allows greater-than-ascii input,
 there are
 plenty of options: « » ¡ £ ¥ ł € ® ª...

 
 Note that there already is a standard symbol for this, () from
 Control.Arrow.  Well, actually () is more general than backwards
 function composition, so maybe making your own symbol is still a good
 idea while you're learning.

Application, not composition.  Cont's return would work if it weren't
for the wrapping.  Similarly, (=) for the Id monad.
 

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


Re: [Haskell-cafe] message passing style like in Haskell?

2008-06-19 Thread Ketil Malde
Albert Y. C. Lai [EMAIL PROTECTED] writes:

 While we are kind of on this topic, what makes the characters ħ þ
 prefix operator by default, while º and most other odd ones infix?

 alphanumeric vs non-alphanumeric

Testing this, I find that isAlpha is True also for 'º', but as the OP
claims, Haskell will use it as a(n infix) symbol.  Neither does
isSymbol (all False), isLetter (all True), isMark (False), nor
isPunctuation (Fals) help to separate these.

The HR defines 

uniSymbol-  any Unicode symbol or punctuation 

but I couldn't find any clear way to identify of these.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] message passing style like in Haskell?

2008-06-18 Thread jinjing
Hi guys,

This is my second attempt to learn Haskell :)

Any way here's the code:

module Dot where
import Prelude hiding ( (.) )

(.) :: a - (a - b) - b
a . f = f a

infixl 9 .


So for example, 99 questions: Problem 10
(*) Run-length encoding of a list.



comparing:

encode xs = map (\x - (length x,head x)) (group xs)

to

encode xs = xs.group.map token where token x = (x.length, x.head)




I found starting with data and working my way to a solution seems to be
easier to think with, or maybe it's just me ...

What is your thought?

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


[Haskell-cafe] Haskell-cafe message-length restriction

2004-11-23 Thread Graham Klyne
To the list Haskell-cafe admin...
May I suggest that the maximum message length for postings to the 
haskell-cafe list without moderation be raised from its current 5K 
limit?   It seems to me that a value of (say) 20K would reduce the 
moderator's workload without obviously allowing too many undesirables ... 
(though I allow the moderator surely knows more about what is thrown at the 
list that most of us don't see.)

Just a thought.
#g

Graham Klyne
For email:
http://www.ninebynine.org/#Contact
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe