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

2010-02-28 Thread Thomas Hartman
As far as I can tell, stepcut was probably correct in his diagnosis before.

I was getting two processes started because of a stray cron job.

2010/2/26 Thomas Hartman tphya...@gmail.com:
 Indeed, the error occurs when two processes are running at the same
 time. One process isn't serving anything, and the other is just
 looping, reported that it can't stop because the port is taken, and
 repeating ad infinitum.

 The loop I have is

 ulimit -v 15
 while true; do
  echo starting patchtag: `date`
 ./dist/build/patchtagserver/patchtagserver --port=80 --
  echo patchtag exited: `date`
  echo patchtag exited: `date`  patch-tag.log
  rm -f _local/patchtagserver_state.lock

 The ulimit is so that it will die after consuming a reasonable amount
 of memory. (I seem to have a memory leak somewhere, but it takes many
 hours to get up to 150M.)

 Everything else looks pretty standard to me. It seems to work as
 designed most of the time, but occasionally will result in two
 processes. I'm baffled as to how this happens.

 If anybody has any idea, I would love to hear them.

 2010/2/26 Jeremy Shaw jer...@n-heptane.com:
 Hello,
 It will be interesting to see if that makes any difference -- it shouldn't.
 In happstack-server we use 'listenOn'. According to the documentation
 listenOn already sets ReuseAddr:
 http://hackage.haskell.org/packages/archive/network/2.2.1.7/doc/html/Network.html#v%3AlistenOn
 A quick look at the source code confirms it is calling:
    setSocketOption sock ReuseAddr 1
 It sounds to be like you are getting the socket in use error because you
 have 2 processes running. Seems like the first one hasn't really died, but
 the second one is started anyway. How is it that your loop starts a second
 server when the first one has not finished?
 - jeremy
 On Fri, Feb 26, 2010 at 1:43 PM, Thomas Hartman tphya...@gmail.com wrote:

 Thanks, I altered my top level request handler as follows

 mysmartserver conf h stateProxy = do
      socket - bindPort conf

       I added (setSocketOption socket ReuseAddr 1) here
       Should this be added in a comment, or even in function code,
 in Happstack.Server.SimpleHTTP? What are the tradeoffs, when would you
 *not* want ot use ReuseAddr?)

      webserverTid - forkIO $ simpleHTTPWithSocket socket conf h
      putStrLn . ( starting happs server ++ ) = time

      control - startSystemState stateProxy -- start the HAppS state
 system
      putStrLn . ( happs state started ++ ) = time

      waitForTermination
      killThread webserverTid
      stateShutdown control

 I can't replicate the error reliably so I won't know if it actually
 fixed the problem for a while, therefore just leaving this cookie
 crumb trail in case others may find it helpful.

 2010/2/26 Brandon S. Allbery KF8NH allb...@ece.cmu.edu:
  On Feb 26, 2010, at 04:28 , Thomas Hartman wrote:
 
  me: Like mightybyte, I run my app in a shell loop that will just
  restart it after a crash. But every once in a while it won't restart
  because of the busy socket and I need to do a manual restart, killing
  multiple processes (usually 2).
 
  the error I get is:
 
  bind: resource busy (Address already in use)
 
  This is on application restart?  It's not out of file descriptors, it's
  just
  the system keeping the socket around (netstat will show it in TIME_WAIT,
  or
  possibly in a shutdown negotiation state such as LAST_ACK, FIN_WAIT,
  etc.
   TCP lacks *reliable* socket shutdown negotiation).
 
  You want to configure the socket with SO_REUSEADDR before trying to bind
  it
  (setSocketOption socket ReuseAddr 1).
 
  As to the portable version of sendfile, it's because not all systems
  offer a
  sendfile() system call.  Linux and *BSD do, and can use the native
  implementation; the portable version emulates sendfile() when it doesn't
  exist, at the price of additional CPU usage/system load (sendfile()
  having
  been created specifically to reduce system load in the common case for
  web
  servers).
 
  --
  brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
  system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
  electrical and computer engineering, carnegie mellon university    KF8NH
 
 
 



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


Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-02-28 Thread Pavel Perikov
Did you really seen 100ms pauses?! I never did extensive research on this but 
my numbers are rather in microseconds range (below 1ms). What causes such a 
long garbage collection? Lots of allocated and long-living objects?

Pavel.

On 28.02.2010, at 8:20, Luke Palmer wrote:

 I have seen some proposals around here for SoC projects and other
 things to try to improve the latency of GHC's garbage collector.  I'm
 currently developing a game in Haskell, and even 100ms pauses are
 unacceptable for a real-time game.  I'm calling out to people who have
 seen or made such proposals, because I would be willing to contribute
 funding and/or mentor a project that would contribute to this goal.
 Also any ideas for reducing this latency in other ways would be very
 appreciated.
 
 Thanks,
 Luke
 ___
 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] Real-time garbage collection for Haskell

2010-02-28 Thread Neil Davies

My experience agrees with Pavel.

I've never observed ones that size. I have an application that runs in  
'rate equivalent real-time' (i.e. there may be some jitter in the  
exact time of events but it does not accumulate). It does have some  
visibility of likely time of future events and uses that to perform  
some speculative garbage collection. GC is pretty short and i've not  
seen an effect  1ms in those runs (all the usual caveats apply - my  
programs are not your programs etc).



Neil

On 28 Feb 2010, at 09:06, Pavel Perikov wrote:

Did you really seen 100ms pauses?! I never did extensive research on  
this but my numbers are rather in microseconds range (below 1ms).  
What causes such a long garbage collection? Lots of allocated and  
long-living objects?


Pavel.

On 28.02.2010, at 8:20, Luke Palmer wrote:


I have seen some proposals around here for SoC projects and other
things to try to improve the latency of GHC's garbage collector.  I'm
currently developing a game in Haskell, and even 100ms pauses are
unacceptable for a real-time game.  I'm calling out to people who  
have

seen or made such proposals, because I would be willing to contribute
funding and/or mentor a project that would contribute to this goal.
Also any ideas for reducing this latency in other ways would be very
appreciated.

Thanks,
Luke
___
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] listing mountpoints and getting their properties in Haskell

2010-02-28 Thread Matthias Kilian
On Sat, Feb 27, 2010 at 06:27:19PM -0500, Brandon S. Allbery KF8NH wrote:
 I don't know of any Haskell bindings offhand, but getmntent() and  
 friends are the standard library interface for identifying mountpoints  
 and statfs()/statvfs() are the interface for getting information about  
 them.  Be aware that the latter can be fairly system-dependent.

getmntent() isn't in any standard I know about. IMHO, getting
information about mounted filesystems will always be system dependent.

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


Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-02-28 Thread Andrew Coppin

Luke Palmer wrote:

I have seen some proposals around here for SoC projects and other
things to try to improve the latency of GHC's garbage collector.


I'm guessing making the GC concurrent (i.e., so you can perform GC 
without having to stop all Haskell threads) would probably help in the 
multithreaded case...


(I'm also guessing this is slightly nontrivial to implement. :-) )

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


[Haskell-cafe] Haskell version of Monad Transformers and Modular Interpreters

2010-02-28 Thread Günther Schmidt

Hello,

I come across the paper Monad Transformers and Modular Interpreters 
(http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.17.268) alas 
the code is in Gofer and I'm not certain how all of it translates to 
Haskell.


Are there other papers out there that translate this to Haskell?

Günther


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


Re: [Haskell-cafe] Haskell version of Monad Transformers and Modular Interpreters

2010-02-28 Thread Stephen Tetley
Hi Günther

Wolfram Kahl has a tech report 'A Modular Interpreter Built with Monad
Transformers' with a Haskell translation.


http://www.cas.mcmaster.ca/~kahl/FP/2003/Interpreter.pdf

Best wishes

Stephen

2010/2/28 Günther Schmidt gue.schm...@web.de:
 Hello,

 I come across the paper Monad Transformers and Modular Interpreters
 (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.17.268) alas the
 code is in Gofer and I'm not certain how all of it translates to Haskell.

 Are there other papers out there that translate this to Haskell?

 Günther


 ___
 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] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin

Daniel Fischer wrote:

Am Mittwoch 24 Februar 2010 23:17:46 schrieb Andrew Coppin:
  

Erlend Hamberg wrote:


if you open the software manager and go to configuration →
repositories, you should be able to add new software sources. i use
the following repository:

Server name: download.opensuse.org
Directory: /repositories/devel:/languages:/haskell/openSUSE_11.2/

This repository contains GHC 6.12, alex, happy, etc.
  

OK, I'll try that tomorrow and see where I get...



Or, go to http://software.opensuse.org/search/ , type ghc [alex, happy, 
...] in the search box, click the search button and 1-click-install.
  


This works - and adds all the Haskell stuff to the respositories list, 
apparently.


Amusingly, I installed the GHC package, and then discovered that while 
GHC runs, it won't compile anything. But if you (manually) install GCC 
as well, *then* it works. (Isn't that the package manager's job? WTF?)


Anyway, I'm currently attempting to get cabal-install to work...

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


[Haskell-cafe] Re: native threads vs. -threaded

2010-02-28 Thread Achim Schneider
Donn Cave d...@avvanta.com wrote:

 I imagine I'm at fault somewhere in this, since I am also responsible
 for the GHC port to Haiku, but just wondering if this suggests an
 obvious course of inquiry to anyone.  I assume it's not working as
 intended, as from the documentation I would rather have guessed that
 -thread would be required in this situation.
 
Could it be that Haiku is expecting BeOS threads but you give it UNIX
processes? It might be that all threads serving a GUI app must be part
of the same team.

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.


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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 13:23:11 schrieb Andrew Coppin:
 Daniel Fischer wrote:
  Or, go to http://software.opensuse.org/search/ , type ghc [alex,
  happy, ...] in the search box, click the search button and
  1-click-install.

 This works - and adds all the Haskell stuff to the respositories list,
 apparently.

 Amusingly, I installed the GHC package, and then discovered that while
 GHC runs, it won't compile anything. But if you (manually) install GCC
 as well, *then* it works. (Isn't that the package manager's job? WTF?)

Wait, what?
That must be the first Linux in history which didn't have gcc installed 
from the beginning. How on earth did you manage to do that?

Another thing, you will want the devel versions of many packages for the 
header files, so start YaST, search for devel in name, install all you are 
not almost sure that you don't want.


 Anyway, I'm currently attempting to get cabal-install to work...

What's the problem?
Downloading the .tar.gz from hackage, unpacking it and running bootstrap.sh 
*should* get you a working cabal-install with minimum fuss.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] listing mountpoints and getting their properties in Haskell

2010-02-28 Thread Brandon S. Allbery KF8NH

On Feb 28, 2010, at 05:17 , Matthias Kilian wrote:
On Sat, Feb 27, 2010 at 06:27:19PM -0500, Brandon S. Allbery KF8NH  
wrote:

I don't know of any Haskell bindings offhand, but getmntent() and
friends are the standard library interface for identifying  
mountpoints
and statfs()/statvfs() are the interface for getting information  
about

them.  Be aware that the latter can be fairly system-dependent.


getmntent() isn't in any standard I know about. IMHO, getting
information about mounted filesystems will always be system dependent.


It's more of a de-facto standard, inherited from System V but not part  
of SVID and successors.  Between Linux/glibc and Solaris you have a  
goodly chunk of the GHC-relevant world.


*BSD and Mac OS X should look at getmntinfo(); I suspect that'll be  
painful to get at via the FFI, though.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Cabal will not find HaXml

2010-02-28 Thread Mads Lindstrøm
Hi

When I do:

 cabal list --simple-output | grep -i HaXml 1.20

I get:

 HaXml 1.20
 HaXml 1.20.1
 HaXml 1.20.2

But when running:

 runhaskell Setup.hs configure

I get:

 Configuring XrcAccessors-0.0...
 Setup.hs: At least the following dependencies are missing:
 HaXml -any

My cabal file looks like:

snip
Executable XrcAccessors
  Main-is:   XrcAccessors.hs
  Build-Depends: base==3.0.*, pretty==1.0.*, HaXml
  hs-source-dirs:src
/snip

This is very confusing to me. Why will Cabal not find HaXml when running
Setup.hs, but do find it when running cabal list ?

My Setup.hs looks like:

 import Distribution.Simple
 main = defaultMain

I have tried reinstalling HaXml, but that do not help. I have noticed
one thing though, when doing:

 ghc-pkg

I get output like:

snip
/home/ghc6103/lib/ghc-6.10.3/./package.conf:
Cabal-1.6.0.3, HUnit-1.2.0.3, QuickCheck-1.2.0.0, array-0.2.0.0,
base-3.0.3.1, base-4.1.0.0, bytestring-0.9.1.4, containers-0.2.0.1,
directory-1.0.0.3, (dph-base-0.3), (dph-par-0.3),
/snip
snip
/home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf:
Cabal-1.6.0.2, Cabal-1.8.0.2, Diff-0.1.2, HDBC-2.1.1,
HDBC-odbc-1.1.6.0, HDBC-odbc-2.1.0.0, HTTP-4000.0.4, HUnit-1.2.2.1,
HaXml-1.20.2, MetaHDBC-0.1.0, QuickCheck-2.1.0.3, SQLLib-0.0,
/snip

That is, HaXml shows itself in
the /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf list, but not in
the /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf . Is this the
problem and how do I fix it?


Greetings,

Mads Lindstrøm



signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Cabal will not find HaXml

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 14:41:03 schrieb Mads Lindstrøm:
 Hi

 When I do:
  cabal list --simple-output | grep -i HaXml 1.20

 I get:
  HaXml 1.20
  HaXml 1.20.1
  HaXml 1.20.2

So there are versions HaXml 1.20* available on hackage


 But when running:
  runhaskell Setup.hs configure

For that, you must have one installed already, and unless you pass the --
user flag, that must be in the global package database.


 I get:
  Configuring XrcAccessors-0.0...
  Setup.hs: At least the following dependencies are missing:
  HaXml -any

  ghc-pkg

 I get output like:

 snip
 /home/ghc6103/lib/ghc-6.10.3/./package.conf:
 Cabal-1.6.0.3, HUnit-1.2.0.3, QuickCheck-1.2.0.0, array-0.2.0.0,
 base-3.0.3.1, base-4.1.0.0, bytestring-0.9.1.4, containers-0.2.0.1,
 directory-1.0.0.3, (dph-base-0.3), (dph-par-0.3),
 /snip

global package database, no HaXml

 snip
 /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf:
 Cabal-1.6.0.2, Cabal-1.8.0.2, Diff-0.1.2, HDBC-2.1.1,
 HDBC-odbc-1.1.6.0, HDBC-odbc-2.1.0.0, HTTP-4000.0.4, HUnit-1.2.2.1,
 HaXml-1.20.2, MetaHDBC-0.1.0, QuickCheck-2.1.0.3, SQLLib-0.0,
 /snip

user package database, HaXml present


 That is, HaXml shows itself in
 the /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf list, but not in
 the /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf . Is this the
 problem

Yes.

 and how do I fix it?

a) cabal install XrcAccessors, in contrast to the runghc ./setup.hs ... 
route, cabal install's default is user installs
b) pass the --user flag to runghc ./Setup.hs configure
c) (not recommended in general) make a global install of HaXml, either by 
runghc ./Setup... or cabal install --global HaXml



 Greetings,

 Mads Lindstrøm

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


[Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Yves Parès

Hello!

I have a class Drawable, and some datatypes which are instances of it, and I
would like to be able to draw them all at once!
drawMany window [image, text, otherImage]

I think the type of the function drawMany would be:
drawMany :: Window - [forall a. (Drawable a) = a] - IO ()

However it doesn't work.
I know one solution is to make a new datatype (e.g. DrawableObj) which will
be:
data DrawableObj = forall a (Drawable a) = 
  DrawableObj a

And then declare drawMany as:
drawMany :: Window - [DrawableObj] - IO ()

But to use it I have to wrap up myself every drawable in a DrawableObj:
drawMany window [DrawableObj image, DrawableObj text, DrawableObj
otherImage]

Is there another more suitable way to handle a list of drawables?

-
Yves Parès

Live long and prosper
-- 
View this message in context: 
http://old.nabble.com/Lists-of-Existential-DT-tp27735354p27735354.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

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


Re: [Haskell-cafe] Cabal will not find HaXml

2010-02-28 Thread Mads Lindstrøm
Hi

The --user flag did the trick. Thank you very much.

/Mads

Daniel Fischer wrote:
 Am Sonntag 28 Februar 2010 14:41:03 schrieb Mads Lindstrøm:
  Hi
 
  When I do:
   cabal list --simple-output | grep -i HaXml 1.20
 
  I get:
   HaXml 1.20
   HaXml 1.20.1
   HaXml 1.20.2
 
 So there are versions HaXml 1.20* available on hackage
 
 
  But when running:
   runhaskell Setup.hs configure
 
 For that, you must have one installed already, and unless you pass the --
 user flag, that must be in the global package database.
 
 
  I get:
   Configuring XrcAccessors-0.0...
   Setup.hs: At least the following dependencies are missing:
   HaXml -any
 
   ghc-pkg
 
  I get output like:
 
  snip
  /home/ghc6103/lib/ghc-6.10.3/./package.conf:
  Cabal-1.6.0.3, HUnit-1.2.0.3, QuickCheck-1.2.0.0, array-0.2.0.0,
  base-3.0.3.1, base-4.1.0.0, bytestring-0.9.1.4, containers-0.2.0.1,
  directory-1.0.0.3, (dph-base-0.3), (dph-par-0.3),
  /snip
 
 global package database, no HaXml
 
  snip
  /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf:
  Cabal-1.6.0.2, Cabal-1.8.0.2, Diff-0.1.2, HDBC-2.1.1,
  HDBC-odbc-1.1.6.0, HDBC-odbc-2.1.0.0, HTTP-4000.0.4, HUnit-1.2.2.1,
  HaXml-1.20.2, MetaHDBC-0.1.0, QuickCheck-2.1.0.3, SQLLib-0.0,
  /snip
 
 user package database, HaXml present
 
 
  That is, HaXml shows itself in
  the /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf list, but not in
  the /home/ghc6103/.ghc/x86_64-linux-6.10.3/package.conf . Is this the
  problem
 
 Yes.
 
  and how do I fix it?
 
 a) cabal install XrcAccessors, in contrast to the runghc ./setup.hs ... 
 route, cabal install's default is user installs
 b) pass the --user flag to runghc ./Setup.hs configure
 c) (not recommended in general) make a global install of HaXml, either by 
 runghc ./Setup... or cabal install --global HaXml
 
 
 
  Greetings,
 
  Mads Lindstrøm
 


signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Miguel Mitrofanov

Sorry, no luck with that.

But you can, probably, define some customized comma:

data DrawPair a b = DrawPair a b
(,) :: a - b - DrawPair a b
(,) = DrawPair
instance (Drawable a, Drawable b) = Drawable (DrawPair a b) where ...
drawMany :: Drawable a = Window - a - IO ()
...
drawMany window $ image , text , otherImage

On 28 Feb 2010, at 17:31, Yves Parès wrote:



Hello!

I have a class Drawable, and some datatypes which are instances of  
it, and I

would like to be able to draw them all at once!
drawMany window [image, text, otherImage]

I think the type of the function drawMany would be:
drawMany :: Window - [forall a. (Drawable a) = a] - IO ()

However it doesn't work.
I know one solution is to make a new datatype (e.g. DrawableObj)  
which will

be:
data DrawableObj = forall a (Drawable a) =
 DrawableObj a

And then declare drawMany as:
drawMany :: Window - [DrawableObj] - IO ()

But to use it I have to wrap up myself every drawable in a  
DrawableObj:

drawMany window [DrawableObj image, DrawableObj text, DrawableObj
otherImage]

Is there another more suitable way to handle a list of drawables?

-
Yves Parès

Live long and prosper
--
View this message in context: 
http://old.nabble.com/Lists-of-Existential-DT-tp27735354p27735354.html
Sent from the Haskell - Haskell-Cafe mailing list archive at  
Nabble.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] Re: Real-time garbage collection for Haskell

2010-02-28 Thread Heinrich Apfelmus
Luke Palmer wrote:
 I have seen some proposals around here for SoC projects and other
 things to try to improve the latency of GHC's garbage collector.  I'm
 currently developing a game in Haskell, and even 100ms pauses are
 unacceptable for a real-time game.  I'm calling out to people who have
 seen or made such proposals, because I would be willing to contribute
 funding and/or mentor a project that would contribute to this goal.

 Also any ideas for reducing this latency in other ways would be very
 appreciated.

Overly long garbage collection might also be a sign of space leaks.

But there are many other things that can go wrong in a real time system
and might explain your delays. For example, you might need to avoid
amortized time data structures like  Data.Sequence . Or for physics
simulations, you'd need to fix the time step ∆t, as described in

   http://gafferongames.com/game-physics/fix-your-timestep/

or numerical integration will deteriorate rather quickly.


Regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com

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


Re: [Haskell-cafe] Re: native threads vs. -threaded

2010-02-28 Thread Donn Cave
Quoth Achim Schneider bars...@web.de,
 Donn Cave d...@avvanta.com wrote:

 I imagine I'm at fault somewhere in this, since I am also responsible
 for the GHC port to Haiku, but just wondering if this suggests an
 obvious course of inquiry to anyone.  I assume it's not working as
 intended, as from the documentation I would rather have guessed that
 -thread would be required in this situation.

 Could it be that Haiku is expecting BeOS threads but you give it UNIX
 processes? It might be that all threads serving a GUI app must be part
 of the same team.

No, I'm not creating any other threads or processes, other than the
window thread that's implicitly created by the window API.  If it
helps, a coarse outline of the API:

   class W : public BWindow {
W(...params...): BWindow(...params...) {
... initialize graphic elements
}
void MessageReceived(BMessage *msg) {
... respond to event by calling Haskell function
// will lead to thread abort if linked -threaded.
}
   };

main thread:
   W *w = W(...params...);
   w-Show();   // thread spawned by this member function.


I haven't written any code to support the above - BWindow::Show()
was provided by the platform.  I did of course have to do a lot
of hacking around with FFI stuff.  The BWindow-derived object
stores a table of foreign wrapper pointers to callback functions
that take a StablePtr, etc., and I wouldn't know where to start
thinking about that works with garbage collection.

Donn Cave, d...@avvanta.com

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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin

Daniel Fischer wrote:

Am Sonntag 28 Februar 2010 13:23:11 schrieb Andrew Coppin:
  

Amusingly, I installed the GHC package, and then discovered that while
GHC runs, it won't compile anything. But if you (manually) install GCC
as well, *then* it works. (Isn't that the package manager's job? WTF?)



Wait, what?
That must be the first Linux in history which didn't have gcc installed 
from the beginning. How on earth did you manage to do that?
  


It's the default install of OpenSUSE 11.2. Nothing special there.

What *does* surprise me is that GCC isn't a dependency of the GHC 
package, given that GHC doesn't appear to work properly without it.



Anyway, I'm currently attempting to get cabal-install to work...


What's the problem?
Downloading the .tar.gz from hackage, unpacking it and running bootstrap.sh 
*should* get you a working cabal-install with minimum fuss.
  


No problem, I just haven't finished it yet. Or at least, I hadn't when 
I posted that message; I've got it going now. Once GHC was actually 
working, the only additional thing I had to do was install zlib-devel.


It also puts the binary in a strange place, but I guess I can live with 
that...


Now, hypothetically, I should have a Linux Haskell system, so I can 
actually compile *anything* that's on Hackage.


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


[Haskell-cafe] using haskell to serve with apache

2010-02-28 Thread brad clawsie
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


hi

i'm currently doing some work on a personal site and was considering
giving a haskell web tool a spin. i have a fairly complex apache
configuration, so i don't want to try to replace it with a native
haskell server, but instead use haskell via an interface to apache
(i.e. something like wsgi, plack, etc).

some searching shows hyena and yesod in various states of development,
but i can't figure out if they are appropriate or ready for use. anyone have
experiences using haskell behind apache? should i just try out something
based on fastcgi? any anecdotes welcome

thanks
brad
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkuKoJEACgkQxRg3RkRK91PVJwCdFD4dS47KjJuMcNVZmPkYXKyU
ItsAnRoYBE39XtXyXDluh+pHSxzP+Qcd
=91Ql
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 17:52:19 schrieb Andrew Coppin:
 It also puts the binary in a strange place, but I guess I can live with
 that...

Which strange place? By default, it should go to ~/.cabal/bin, I think.
Anyway, you should add that to your path, put something like


if [ -z `/bin/echo ${PATH} | /usr/bin/grep cabal` ]
then
export PATH=/home/andrew/.cabal/bin:$PATH
fi

in your .bashrc

 Now, hypothetically, I should have a Linux Haskell system, so I can
 actually compile *anything* that's on Hackage.

Not really, you'll need to install external libraries (C stuff, mostly) for 
many packages. But it should be a lot easier than on Windows.

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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin

Daniel Fischer wrote:

Am Sonntag 28 Februar 2010 17:52:19 schrieb Andrew Coppin:
  

It also puts the binary in a strange place, but I guess I can live with
that...



Which strange place? By default, it should go to ~/.cabal/bin, I think.
  


Indeed. You'd expect it to be in some system-wide location, but 
apparently not.



Anyway, you should add that to your path, put something like


if [ -z `/bin/echo ${PATH} | /usr/bin/grep cabal` ]
then
export PATH=/home/andrew/.cabal/bin:$PATH
fi

in your .bashrc
  


Uh... what?


Now, hypothetically, I should have a Linux Haskell system, so I can
actually compile *anything* that's on Hackage.



Not really, you'll need to install external libraries (C stuff, mostly) for 
many packages. But it should be a lot easier than on Windows.
  


On Linux, it seems you install the development package, rerun Cabal, and 
it it somehow knows that the library is installed and how to find in.


On Windows... well, forget it. It'll never work, so you might as well 
not bother trying.


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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread David Virebayre
On Sun, Feb 28, 2010 at 6:30 PM, Andrew Coppin
andrewcop...@btinternet.comwrote:

 Daniel Fischer wrote:



 if [ -z `/bin/echo ${PATH} | /usr/bin/grep cabal` ]

 then
export PATH=/home/andrew/.cabal/bin:$PATH
 fi

 in your .bashrc



 Uh... what?


that snippet supposes you have cabal installed in your home directory under
the directory .cabal. The binary file would be in the bin subdirectory of
.cabal
Names that start with a . are hidden files/directories on linux, by the way.
So the first line checks if you have cabal in your path list. If not, on
the 3rd line it supposes your home directory is /home/andrew and adds the
cabal binary directory to your path list.

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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 18:30:59 schrieb Andrew Coppin:
 Daniel Fischer wrote:
  Am Sonntag 28 Februar 2010 17:52:19 schrieb Andrew Coppin:
  It also puts the binary in a strange place, but I guess I can live
  with that...
 
  Which strange place? By default, it should go to ~/.cabal/bin, I
  think.

 Indeed. You'd expect it to be in some system-wide location, but
 apparently not.


Why? It could only be in a system-wide location if you installed as root. 
Not everybody who wants to install cabal is root/can sudo, so the natural 
default is ~/.cabal/bin or ~/bin. Since there are advantages to keep all 
cabal stuff in one place separate from whatever, ~/.cabal is preferable.

But if you want to have it system-wide (why would you, with a user cabal, 
you don't have to make a complete reinstall if you bork your installation), 
you can run

$ ./bootstrap.sh --global

  Anyway, you should add that to your path, put something like
 
 
  if [ -z `/bin/echo ${PATH} | /usr/bin/grep cabal` ]
  then
  export PATH=/home/andrew/.cabal/bin:$PATH
  fi
 
  in your .bashrc

 Uh... what?


If the pattern cabal is not in your path, prepend ~/.cabal/bin to your 
path and export it. Then you can invoke executables in that directory 
without giving the path on the command line.

But yes, if you're new to shell-scripting, it all looks geek to you :)

  Now, hypothetically, I should have a Linux Haskell system, so I can
  actually compile *anything* that's on Hackage.
 
  Not really, you'll need to install external libraries (C stuff,
  mostly) for many packages. But it should be a lot easier than on
  Windows.

 On Linux, it seems you install the development package, rerun Cabal, and
 it it somehow knows that the library is installed and how to find in.

Mostly - there are a few standard locations for headers and libraries where 
configure looks, but stuff for some packages must be queried for by 
pkg-config, only some packages where that's necessary don't come with a .pc 
file, oops.


 On Windows... well, forget it. It'll never work, so you might as well
 not bother trying.

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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin



Anyway, I'm currently attempting to get cabal-install to work...


What's the problem?
Downloading the .tar.gz from hackage, unpacking it and running 
bootstrap.sh *should* get you a working cabal-install with minimum fuss.
  


No problem, I just haven't finished it yet.


I just retried this and stumbled over a problem. I did a Google search 
and managed to navigate to here:


http://www.haskell.org/cabal/download.html

But this gives a download link for cabal-install 0.6.2, which doesn't work.

Performing a second Google search and finding the *latest* cabal-install 
works. (But... why is this page not linking to the latest one? Or to 
Hackage, where the latest stable version lives...)


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


[Haskell-cafe] jQuery is a monad

2010-02-28 Thread Graham Klyne

Nice blog post:

http://importantshock.wordpress.com/2009/01/18/jquery-is-a-monad/

#g

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


Re: [Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Eugene Kirpichov
Or like this, with the benefit of using lists.
data DrawableObj a = forall a.Drawable a = DrawableObj a
a , b = DrawableObj a : b
drawMany (a,b,c,[])

2010/2/28 Miguel Mitrofanov miguelim...@yandex.ru:
 Sorry, no luck with that.

 But you can, probably, define some customized comma:

 data DrawPair a b = DrawPair a b
 (,) :: a - b - DrawPair a b
 (,) = DrawPair
 instance (Drawable a, Drawable b) = Drawable (DrawPair a b) where ...
 drawMany :: Drawable a = Window - a - IO ()
 ...
 drawMany window $ image , text , otherImage

 On 28 Feb 2010, at 17:31, Yves Parès wrote:


 Hello!

 I have a class Drawable, and some datatypes which are instances of it, and
 I
 would like to be able to draw them all at once!
 drawMany window [image, text, otherImage]

 I think the type of the function drawMany would be:
 drawMany :: Window - [forall a. (Drawable a) = a] - IO ()

 However it doesn't work.
 I know one solution is to make a new datatype (e.g. DrawableObj) which
 will
 be:
 data DrawableObj = forall a (Drawable a) =
                             DrawableObj a

 And then declare drawMany as:
 drawMany :: Window - [DrawableObj] - IO ()

 But to use it I have to wrap up myself every drawable in a DrawableObj:
 drawMany window [DrawableObj image, DrawableObj text, DrawableObj
 otherImage]

 Is there another more suitable way to handle a list of drawables?

 -
 Yves Parès

 Live long and prosper
 --
 View this message in context:
 http://old.nabble.com/Lists-of-Existential-DT-tp27735354p27735354.html
 Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.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




-- 
Eugene Kirpichov
Senior Developer, JetBrains
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Real-time garbage collection for Haskell

2010-02-28 Thread Derek Elkins
On Sun, Feb 28, 2010 at 10:03 AM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
 Luke Palmer wrote:
 I have seen some proposals around here for SoC projects and other
 things to try to improve the latency of GHC's garbage collector.  I'm
 currently developing a game in Haskell, and even 100ms pauses are
 unacceptable for a real-time game.  I'm calling out to people who have
 seen or made such proposals, because I would be willing to contribute
 funding and/or mentor a project that would contribute to this goal.

 Also any ideas for reducing this latency in other ways would be very
 appreciated.

 Overly long garbage collection might also be a sign of space leaks.

 But there are many other things that can go wrong in a real time system
 and might explain your delays. For example, you might need to avoid
 amortized time data structures like  Data.Sequence . Or for physics
 simulations, you'd need to fix the time step ∆t, as described in

   http://gafferongames.com/game-physics/fix-your-timestep/

 or numerical integration will deteriorate rather quickly.

Incidentally, what's described there is a simplified version of the
frequency locked loops described in Massalin's thesis on Synthesis OS,
and it is used there for about the same purpose in a soft real-time
context.

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.29.4871
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Yves Parès


jkff wrote:
 
 Or like this, with the benefit of using lists.
 data DrawableObj a = forall a.Drawable a = DrawableObj a
 a , b = DrawableObj a : b
 drawMany (a,b,c,[])
 

I like this solution, but it's a pity I think that Haskell doesn't provide a
way to use types like [forall a. (Drawable a) = a], which obligates you to
declare an extra datatype...

-
Yves Parès

Live long and prosper
-- 
View this message in context: 
http://old.nabble.com/Lists-of-Existential-DT-tp27735354p27737144.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

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


Re: [Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Daniel Peebles
You can actually write that type with impredicative polymorphism, but it
doesn't do what you seem to want: it makes a list of polymorphic values
(i.e., universally quantified ones, not existentially).

But that's going away soon, anyway...

On Sun, Feb 28, 2010 at 1:49 PM, Yves Parès limestr...@gmail.com wrote:



 jkff wrote:
 
  Or like this, with the benefit of using lists.
  data DrawableObj a = forall a.Drawable a = DrawableObj a
  a , b = DrawableObj a : b
  drawMany (a,b,c,[])
 

 I like this solution, but it's a pity I think that Haskell doesn't provide
 a
 way to use types like [forall a. (Drawable a) = a], which obligates you to
 declare an extra datatype...

 -
 Yves Parès

 Live long and prosper
 --
 View this message in context:
 http://old.nabble.com/Lists-of-Existential-DT-tp27735354p27737144.html
 Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin

David Virebayre wrote:
On Sun, Feb 28, 2010 at 6:30 PM, Andrew Coppin 
andrewcop...@btinternet.com mailto:andrewcop...@btinternet.com wrote:


Daniel Fischer wrote:

 


if [ -z `/bin/echo ${PATH} | /usr/bin/grep cabal` ]

then
   export PATH=/home/andrew/.cabal/bin:$PATH
fi

in your .bashrc
 



Uh... what?


that snippet supposes you have cabal installed in your home directory 
under the directory .cabal. The binary file would be in the bin 
subdirectory of .cabal
Names that start with a . are hidden files/directories on linux, by 
the way.
So the first line checks if you have cabal in your path list. If 
not, on the 3rd line it supposes your home directory is /home/andrew 
and adds the cabal binary directory to your path list.


Oh, right. So it's checking whether it's already in the search path 
before adding it. I would have just added it. ;-) [And by the looks of 
it, I would have got even that wrong...]


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


Re: [Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Ryan Ingram
drawMany is just sequence dressed up a bit:

I assume you have this class:

class Drawable a where
draw :: Drawable a = a - Window - IO ()

So, the key is to remember that functions and IO actions are first-class values!

data Box = ...
instance Drawable Box where ...
box :: Box
box = ...

data Circle = ...
instance Drawable Circle where ...
circle :: Circle
circle = ...

instance Drawable String where ...

with :: b - [b - a] - [a]
with w = map ($ w)

manyWith :: Monad m = w - [w - m a] - m ()
manyWith w = sequence . with w

sample :: Window - IO ()
sample w =
manyWith w $ [draw box, draw circle, draw hello]


On Sun, Feb 28, 2010 at 6:31 AM, Yves Parès limestr...@gmail.com wrote:

 Hello!

 I have a class Drawable, and some datatypes which are instances of it, and I
 would like to be able to draw them all at once!
 drawMany window [image, text, otherImage]

 I think the type of the function drawMany would be:
 drawMany :: Window - [forall a. (Drawable a) = a] - IO ()

 However it doesn't work.
 I know one solution is to make a new datatype (e.g. DrawableObj) which will
 be:
 data DrawableObj = forall a (Drawable a) =
                              DrawableObj a

 And then declare drawMany as:
 drawMany :: Window - [DrawableObj] - IO ()

 But to use it I have to wrap up myself every drawable in a DrawableObj:
 drawMany window [DrawableObj image, DrawableObj text, DrawableObj
 otherImage]

 Is there another more suitable way to handle a list of drawables?

 -
 Yves Parès

 Live long and prosper
 --
 View this message in context: 
 http://old.nabble.com/Lists-of-Existential-DT-tp27735354p27735354.html
 Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 20:07:28 schrieb Andrew Coppin:

 Oh, right. So it's checking whether it's already in the search path
 before adding it.

Right.

 I would have just added it. ;-)

That wouldn't do much harm, you'd just have it several times in your $PATH 
(which means it'll take a little longer to find things in the places listed 
after because ~/.cabal/bin is searched multiple times).

 [And by the looks of
 it, I would have got even that wrong...]


Let me guess, you'd have tried ';' as the path-separator?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin

Daniel Fischer wrote:

Let me guess, you'd have tried ';' as the path-separator?
  


I didn't know you have to use export for this to work...

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


[Haskell-cafe] Re: using haskell to serve with apache

2010-02-28 Thread Ertugrul Soeylemez
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160

Hello Brad,

I can't provide an anecdote, but you can run a native Haskell server
like Happstack behind Apache and use mod_proxy to pass all requests to a
certain vhost and/or path to it.


Greets
Ertugrul


brad clawsie claw...@fastmail.fm wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 hi
 
 i'm currently doing some work on a personal site and was considering
 giving a haskell web tool a spin. i have a fairly complex apache
 configuration, so i don't want to try to replace it with a native
 haskell server, but instead use haskell via an interface to apache
 (i.e. something like wsgi, plack, etc).
 
 some searching shows hyena and yesod in various states of development,
 but i can't figure out if they are appropriate or ready for use. anyone have
 experiences using haskell behind apache? should i just try out something
 based on fastcgi? any anecdotes welcome
 
 thanks
 brad
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (FreeBSD)
 
 iEYEARECAAYFAkuKoJEACgkQxRg3RkRK91PVJwCdFD4dS47KjJuMcNVZmPkYXKyU
 ItsAnRoYBE39XtXyXDluh+pHSxzP+Qcd
 =91Ql
 -END PGP SIGNATURE-



- -- 
nightmare = unsafePerformIO (getWrongWife = sex)
http://blog.ertes.de/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (GNU/Linux)

iQIcBAEBAwAGBQJLitCzAAoJENVqN/rl3Y0RgYYP/ivOySp2UG1nMTt3eXi6bhFH
gdrx6fkc+iHxAoOEHiBLHCnMpxVGd0OmE6AOjZJZACJzK2K+EKQnBB/J7ZhOmDVH
ZPcYyc48fZmCgZ67CC31at67TIAVJcpc/ixiiVH3yN1TtwFOuWsk4VtW4tRITXtL
1rgjq0hB8vogmSZCbHDuoRsAteXorBRnm7NfYxLCqT8okQSEESgmiEXGseS9GznC
Q1QfFScgSqGEMNGN5USQd9xyvGudTF72VmBl9TAFZcJ3YE14EunY1W9RSCvuFNMn
xXf5rvPutJP2Fzo3LQagCBtWS/1PgjBrKMecfXBXi6vTEIhx9u70WaaXWBtENdGf
G8UwykQfcw3l/gUs2pJdlNWDRYripEG1HrnXE+BiQSdwiMEFRcK54BPgGtXHFJWN
6e6LaYUJCx0cmNVj8g71IX6qqmygi6QrIPfWJEPbR0VDyjRZKNFf+ZOqSQ7brR1f
aJTw3XIvZAJVta6hfVWFnqrl7fm3xB8wIb5Ilvjv5LcSTkWCHy6kthuB8D/2MybQ
u9F3CQ2iXY+EXsDDC8lV0kwOLhBDasGd65V6x/PS2nG/7smYH1FUDi58ns2BwUxH
YGAMWHOmVeNF7j3uIuZngoqgd8ppFvmoyORyGdLAga2LQV7/nibki54aeoq0tFjN
ZS4x1/jh/nYXANajezT2
=zOei
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 20:40:15 schrieb Andrew Coppin:
 Daniel Fischer wrote:
  Let me guess, you'd have tried ';' as the path-separator?

 I didn't know you have to use export for this to work...


You probably wouldn't need export in SUSE, there $HOME/.bashrc is sourced 
in /etc/profile (I don't expect they changed that from 11.1 to 11.2) and 
PATH is exported afterwards, so you'd have ~/.cabal/bin in the path of 
every shell started from the first bash on (and without the test if it's 
already there, the n-th shell would have n copies of ~/.cabal/bin in its 
path). But in other setups, without export ~/.cabal/bin might not be in the 
path of non-bash subshells.

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


Re: [Haskell-cafe] Lists of Existential DT

2010-02-28 Thread Jason Dagit
On Sun, Feb 28, 2010 at 6:31 AM, Yves Parès limestr...@gmail.com wrote:


 Hello!

 I have a class Drawable, and some datatypes which are instances of it, and
 I
 would like to be able to draw them all at once!
 drawMany window [image, text, otherImage]

 I think the type of the function drawMany would be:
 drawMany :: Window - [forall a. (Drawable a) = a] - IO ()

 However it doesn't work.
 I know one solution is to make a new datatype (e.g. DrawableObj) which will
 be:
 data DrawableObj = forall a (Drawable a) =
  DrawableObj a

 And then declare drawMany as:
 drawMany :: Window - [DrawableObj] - IO ()

 But to use it I have to wrap up myself every drawable in a DrawableObj:
 drawMany window [DrawableObj image, DrawableObj text, DrawableObj
 otherImage]

 Is there another more suitable way to handle a list of drawables?


Luke Palmer has an article on his blog that proposes a different solution to
the problem that I believe you're trying to solve:
http://lukepalmer.wordpress.com/2010/01/24/haskell-antipattern-existential-typeclass/

You might give his approach a try and see if it's simpler and easier to work
with.

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


Re: [Haskell-cafe] OpenSUSE 11.2

2010-02-28 Thread Andrew Coppin

Andrew Coppin wrote:
Now, hypothetically, I should have a Linux Haskell system, so I can 
actually compile *anything* that's on Hackage.


Heh, I forgot how much fun building Gtk2hs is. ;-) The only library I've 
ever seen that takes more than 11 seconds to build... (Currently at 10 
*minutes* and counting!)


Oh, and it seems to not want to build with GHC 6.12.1. Is that normal, 
or did I do something wrong? (It seems to be building just fine with GHC 
6.10.4...)


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


Re: [Haskell-cafe] using haskell to serve with apache

2010-02-28 Thread Jeremy Shaw
I just run a happstack server on an alternative port, and then use mod_proxy
to forward requests to the alternative port.

For example, happstack.com is hosted at:

http://src.seereason.com:9021/

but apache on that machine has a happstack.com config that looks like:


VirtualHost *:80
ServerAdmin u...@example.org
ServerName www.happstack.com
ServerAlias happstack.com

ErrorLog /var/log/apache2/happstack.com/error.log
CustomLog /var/log/apache2/happstack.com/access.log combined

ProxyRequests Off

Proxy *
AddDefaultCharset off
Order deny,allow
 Deny from all
   /Proxy

Proxy http://127.0.0.1:9021/*
AddDefaultCharset off
Order deny,allow
Allow from all
/Proxy

ProxyPass / http://127.0.0.1:9021/
ProxyPassReverse / http://127.0.0.1:9021/
/VirtualHost
-

So users can just visit http://happstack.com/

Hopefully I have not done something horribly insecure (easy to do with
apache), but I believe this is correct.

- jeremy


On Sun, Feb 28, 2010 at 10:57 AM, brad clawsie claw...@fastmail.fm wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 hi

 i'm currently doing some work on a personal site and was considering
 giving a haskell web tool a spin. i have a fairly complex apache
 configuration, so i don't want to try to replace it with a native
 haskell server, but instead use haskell via an interface to apache
 (i.e. something like wsgi, plack, etc).

 some searching shows hyena and yesod in various states of development,
 but i can't figure out if they are appropriate or ready for use. anyone
 have
 experiences using haskell behind apache? should i just try out something
 based on fastcgi? any anecdotes welcome

 thanks
 brad
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (FreeBSD)

 iEYEARECAAYFAkuKoJEACgkQxRg3RkRK91PVJwCdFD4dS47KjJuMcNVZmPkYXKyU
 ItsAnRoYBE39XtXyXDluh+pHSxzP+Qcd
 =91Ql
 -END PGP SIGNATURE-
 ___
 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] Has Try Haskell! An interactive tutorial in your browser been announced yet?

2010-02-28 Thread Benjamin L. Russell
There is a link to Try Haskell! -- an interactive, online Haskell
interpreter (see http://tryhaskell.org/) under February 2010 under 1
Headlines on the Haskell - HaskellWIki Web page (see
http://www.haskell.org/).

While I could be mistaken, there do not seem to be any announcements for 
February 2010 concerning this interactive tutorial on either the Haskell
or Haskell-Cafe mailing lists.  Has it been announced yet?  If not, can
I go ahead and announce it on the Haskell mailing list?

-- Benjamin L. Russell
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
Furuike ya, kawazu tobikomu mizu no oto. -- Matsuo Basho^ 

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


Re: [Haskell-cafe] Cabal pre-compiled packages

2010-02-28 Thread Ivan Miljenovic
On 28 February 2010 01:55, Diego Souza dso...@bitforest.org wrote:
 currently when one install a cabal package it compiles it and then install
 generated binaries. I wonder whether or not it would be useful to have
 pre-compiled binaries as many package managers usually do (e.g. apt). I
 often think that would save some time on the expense of a busier hackage
 server capable of generating packages for many different platforms.
 I'm particularly thinking on the following scenario: suppose that you have
 code that is ready for production. If cabal supported pre-compiled binaries,
 there is no need to install ghc or eventually any other compiler, just
 runtime environment and eventually cabal. I must say that I have no
 experience in doing this in Haskell (just personal/small projects), so I
 suppose one have to generate binaries and use other sort of package manager
 to deploy code to production (which sounds reasonable as well). Thus, if the
 assumption is correct, cabal is a development tool, not something one could
 to only deploy runtime-only packages.

So, you need a binary for each version of GHC available (IIRC, Duncan
is still testing new releases of Cabal for versions of GHC as old as
6.4) with and without profiling, with different possible optimization
flags and for different architectures and operating systems...

To me, that sounds like too much work.

/me really wishes people stopped thinking of Cabal as a package manager

-- 
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] OpenSUSE 11.2

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 22:57:05 schrieb Andrew Coppin:
 Andrew Coppin wrote:
  Now, hypothetically, I should have a Linux Haskell system, so I can
  actually compile *anything* that's on Hackage.

 Heh, I forgot how much fun building Gtk2hs is. ;-)

But that's not yet on hackage :)

 The only library I've
 ever seen that takes more than 11 seconds to build... (Currently at 10
 *minutes* and counting!)

 Oh, and it seems to not want to build with GHC 6.12.1. Is that normal,

Yes, as far as I know, there's no gtk2hs release for 6.12 yet.

 or did I do something wrong? (It seems to be building just fine with GHC
 6.10.4...)

There's a version for 6.10.4, so that ought to build indeed.

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


Re: [Haskell-cafe] Has Try Haskell! An interactive tutorial in your browser been announced yet?

2010-02-28 Thread Andrew Coppin

Benjamin L. Russell wrote:

There is a link to Try Haskell! -- an interactive, online Haskell
interpreter (see http://tryhaskell.org/) under February 2010 under 1
Headlines on the Haskell - HaskellWIki Web page (see
http://www.haskell.org/).

While I could be mistaken, there do not seem to be any announcements for 
February 2010 concerning this interactive tutorial on either the Haskell

or Haskell-Cafe mailing lists.  Has it been announced yet?  If not, can
I go ahead and announce it on the Haskell mailing list?
  


I discovered this approximately 17 seconds ago, and I was just about to 
ask the exact same thing... This should *definitely* make it into the 
HWN. ;-)


The tutorial is quite nice too, although rather incomplete.

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


Re: [Haskell-cafe] View patterns

2010-02-28 Thread Ivan Miljenovic
On 28 February 2010 05:55, Andrew Coppin andrewcop...@btinternet.com wrote:
 It won't work for arbitrarily complex structures, however. My main point was
 that if you make the constructors abstract and provide functions to query
 the structure, now you can't pattern match against it.

We do, however, have guards which helps reduce the boiler plate
(nested if statements, etc.).

-- 
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] Has Try Haskell! An interactive tutorial in your browser been announced yet?

2010-02-28 Thread Don Stewart
DekuDekuplex:
 There is a link to Try Haskell! -- an interactive, online Haskell
 interpreter (see http://tryhaskell.org/) under February 2010 under 1
 Headlines on the Haskell - HaskellWIki Web page (see
 http://www.haskell.org/).
 
 While I could be mistaken, there do not seem to be any announcements for 
 February 2010 concerning this interactive tutorial on either the Haskell
 or Haskell-Cafe mailing lists.  Has it been announced yet?  If not, can
 I go ahead and announce it on the Haskell mailing list?
 

The author says it is work in progress


http://www.reddit.com/r/haskell/comments/b7dil/try_haskell_now_with_t_and_wip_interactive/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Has Try Haskell! An interactive tutorial in your browser been announced yet?

2010-02-28 Thread Benjamin L. Russell
Andrew Coppin andrewcop...@btinternet.com writes:

 Benjamin L. Russell wrote:
 There is a link to Try Haskell! -- an interactive, online Haskell
 interpreter (see http://tryhaskell.org/) under February 2010 under 1
 Headlines on the Haskell - HaskellWIki Web page (see
 http://www.haskell.org/).

 While I could be mistaken, there do not seem to be any announcements
 for February 2010 concerning this interactive tutorial on either the
 Haskell
 or Haskell-Cafe mailing lists.  Has it been announced yet?  If not, can
 I go ahead and announce it on the Haskell mailing list?
   

 I discovered this approximately 17 seconds ago, and I was just about
 to ask the exact same thing... This should *definitely* make it into
 the HWN. ;-)

 The tutorial is quite nice too, although rather incomplete.

Then I'll go ahead and announce this on the Haskell mailing list.

-- Benjamin L. Russell
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
Furuike ya, kawazu tobikomu mizu no oto. -- Matsuo Basho^ 

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


Re: [Haskell-cafe] Cabal pre-compiled packages

2010-02-28 Thread Daniel Fischer
Am Sonntag 28 Februar 2010 23:20:00 schrieb Ivan Miljenovic:
 /me really wishes people stopped thinking of Cabal as a package manager

/me really wishes there were package managers as useful and easy as Cabal 
for things other than Haskell :D
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Linear programming in Haskell

2010-02-28 Thread Henning Thielemann

Louis Wasserman schrieb:

Yo,

Man, I'd never used FFI before, but it's really not as scary as I'd 
feared.


I've implemented a more comprehensive interface to GLPK's simplex 
solver and -- rather importantly, for my own needs -- its MIP solver.  
This doesn't depend on hmatrix, and in fact, it doesn't require any 
matrix or vector manipulation at all -- linear functions are specified 
as a straight-up Data.Map from an arbitrary variable type to their 
coefficients.


The library is now available as glpk-hs on hackage.

Example:

import Data.LinearProgram.LPMonad
import Data.LinearProgram
import Data.LinearProgram.GLPK

objFun :: LinFunc String Int
objFun = linCombination [(10, x1), (6, x2), (4, x3)]

lp :: LP String Int
lp = execLPM $ dosetDirection Max
setObjective objFun
leqTo (varSum [x1, x2, x3]) 100
leqTo (10 *^ var x1 ^+^ 4 * x2 ^+^ 5 *^ var x3) 600
-- c *^ var v, c * v, and linCombination [(c, v)] are all equivalent.
-- ^+^ is the addition operation on linear functions.
leqTo (linCombination [(2, x1), (2, x2), (6, x3)]) 300
varGeq x1 0
varBds x2 0 50
varGeq x3 0
setVarKind x1 IntVar
setVarKind x2 ContVar
Using strings for variable names you cannot check for undefined 
variables. How about adding a function for generating new variables to 
your LP monad?

The example may then look like

do
  setDirection Max
  setObjective objFun
  x1 - newVariable
  x2 - newVariable
  x3 - newVariable
  leqTo (varSum [x1,x2,x3]) 100
  ...


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


Re: [Haskell-cafe] Linear programming in Haskell

2010-02-28 Thread Louis Wasserman
For reference: any Ord type can be used as a variable.  (It's pretty sweet.)

However, you have a good point.  I just uploaded the newest version, which
provides a newVariables monad operation for Enums.  (This makes a key
assumption that any element of [v..] will compare as greater than or equal
to v, and that only the first element is equal to v...but that's true for
most Enum implementors, and certainly most of the ones you'd be using as
variables.)

Now, your method would look like

[x1, x2, x3] - newVariables 3

Alternately,

(x1:x2:x3:_) - newVariables' -- returns an infinite list

It's an expensive operation, though -- since I don't track the set of all
variables as the LP is built, I need to construct the set of all variables
before generating new ones -- so it's recommended that you get all the
variables you need in one or two passes.

(The new version has a few other neat features, like exporting/importing
from CPLEX LP files.  I've kind of been overdoing the Haskell lately...)

Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis


On Sun, Feb 28, 2010 at 5:24 PM, Henning Thielemann 
schlepp...@henning-thielemann.de wrote:

 Louis Wasserman schrieb:

  Yo,

 Man, I'd never used FFI before, but it's really not as scary as I'd
 feared.

 I've implemented a more comprehensive interface to GLPK's simplex solver
 and -- rather importantly, for my own needs -- its MIP solver.  This doesn't
 depend on hmatrix, and in fact, it doesn't require any matrix or vector
 manipulation at all -- linear functions are specified as a straight-up
 Data.Map from an arbitrary variable type to their coefficients.

 The library is now available as glpk-hs on hackage.

 Example:

 import Data.LinearProgram.LPMonad
 import Data.LinearProgram
 import Data.LinearProgram.GLPK

 objFun :: LinFunc String Int
 objFun = linCombination [(10, x1), (6, x2), (4, x3)]

 lp :: LP String Int
 lp = execLPM $ dosetDirection Max
setObjective objFun
leqTo (varSum [x1, x2, x3]) 100
leqTo (10 *^ var x1 ^+^ 4 * x2 ^+^ 5 *^ var x3) 600
 -- c *^ var v, c * v, and linCombination [(c, v)] are all equivalent.
 -- ^+^ is the addition operation on linear functions.
leqTo (linCombination [(2, x1), (2, x2), (6, x3)]) 300
varGeq x1 0
varBds x2 0 50
varGeq x3 0
setVarKind x1 IntVar
setVarKind x2 ContVar

 Using strings for variable names you cannot check for undefined variables.
 How about adding a function for generating new variables to your LP monad?
 The example may then look like


 do
  setDirection Max
  setObjective objFun
  x1 - newVariable
  x2 - newVariable
  x3 - newVariable

  leqTo (varSum [x1,x2,x3]) 100
  ...



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


Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-02-28 Thread Luke Palmer
On Sun, Feb 28, 2010 at 2:06 AM, Pavel Perikov peri...@gmail.com wrote:
 Did you really seen 100ms pauses?! I never did extensive research on this but 
 my numbers are rather in microseconds range (below 1ms). What causes such a 
 long garbage collection? Lots of allocated and long-living objects?

This is all hypothetical right now.  I heard some horror stories in
which people had to switch to the main game loop in C++ and only do
the AI logic in Haskell because of pauses.  I would rather not do
that, especially because this project is *about* proving Haskell as a
viable game development platform.  So I am trying to be prepared if I
do see something like that, so that it doesn't put the show on hold
for a few months.

Presumably large, long-living objects would cause the generation 0
collections to take a long time.  I am not sure if we will have any
said objects, but we can't rule it out...

Thanks for the positive reassurances, at least.  I'd like to hear from
people with the opposite experience, if there are any.

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


[Haskell-cafe] ANNOUNCE: jhc-0.7.3

2010-02-28 Thread John Meacham
It's been a long time coming, but jhc-0.7.3 is here. If you have been
following the darcs repository, there are not a whole lot of new
changes, but there have been substantial fixes since 0.7.2 for those
that use the tarballs or rpms.

  http://repetae.net/computer/jhc/

One of the most important ones is I have begun the process of
standardizing on YAML for all external interfaces that may be useful to
automation, this should make interfacing jhc with external tools written
in any language much easier, and it will prevent me from spending time
trying to invent proprietary formats every time I think of something new
to spit out. right now it is used in 3 places:

 - dumping dependency info with --deps
 - library dumping with --list-libraries -v
 - annotating source code, for inputting to documentation generators via
   --annotate-source

The main place it isn't used yet that I desire too is to replace the
'cabal' library description format with a true YAML file. jhc cabal
files were never quite compatible with cabal ones anyway and naming them
the same thing has been a source of connfusion.


some of the other changes have been:


features:
  - a lot more regression tests, many user submitted bugs are now
regressions (or fixed)
  - support for using 'mock' to build rpms
  - System.Exit, System.Cmd added to base
  - better compatibility with ghc in some library functions
  - ui improvements in showing progress and errors
  - extended --list-libraries info
  - --deps dependency dumping
  - more francise compatible thanks to patches from droundy
  - more instances for bigger tuples added
  - uses editline if readline not available
  - select libraries by hash as well as version
  - add System.IO.Pipe
  - detect version of gcc needed for cross compiling to windows

performance:
  - storage analysis - a very basic region inference enabled by default
  - deadcode analysis can see through partial applications now
  - profiled and sped up some library routines that were producing
inellegant core.
  - figure out when top level grin functions call themselves recursively
and turn them into explicit loops.

bug fixes:
  - do expression in infix
  - fix strict newtype bug
  - U2U bug fixed
  - desugaring inside of list comprehensions fix
  - c generator doesn't mess up on unknown values
  - the compiler version is stored in the cache files, so multiple
versions of jhc don't clobber each others cache entries
  - Ord instance for lists fixed
  - recursive type synonyms detected properly
  - make sure errno.h is included when errno is referenced
  - don't give a parse error when seeing ghc extensions to INLINE
  - qualified method names fix

John


-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Haskell Weekly News: Issue 151 - February 28, 2010

2010-02-28 Thread jfredett

---
Haskell Weekly News
http://sequence.complete.org/hwn/20100228
Issue 151 - February 28, 2010
---
   Welcome to issue 151 of HWN, a newsletter covering developments in the
   [1]Haskell community.

   A light HWN this week, some interesting discussion about view patterns
   and free monads. Also announced this week was [2]TryHaskell a
   work-in-progress online interactive haskell interpreter and tutorial.
   The author (based on his reddit post) has asked us not to post this to
   proggit yet, but I don't think he'll mind a plug here. So after you're
   done reading, give it a try! Until next week, haskellers, your Haskell
   Weekly News.

Announcements

   wxHaskell for ghc-6.12.1. Daniel Fischer [3]announced a new release of
   wxHaskell.

   concurrent-extra-0.2. Roel van Dijk [4]announced a new release of
   concurrent-extra

   jhc-0.7.3. John Meacham [5]announced a new version of jhc, including
   many bug fixes.

   Try Haskell! An interactive tutorial in your browser. Benjamin L.
   Russell [6]told us about the TryHaskell Project, available at
   [7]TryHaskell.org. TryHaskell is an interactive, online Haskell
   interpreter and tutorial.

   MSFP: Call for Papers. Venanzio Capretta [8]announced a call for papers
   for the Third Workshop on Mathematically Structured Functional
   Programming.

   HLedger 0.8. Simon Michael [9]announced a new version of hledger last
   week, but it slipped through my radar. This release includes bug fixes,
   some refactoring, and High-Res Graphical Chart generation capability.

Discussion

   View patterns. Andrew Coppin [10]asked about making view patterns
   polymorphic.

   What are 'free' Monads? Guenther Schmidt [11]asked what exactly it
   meant to be a 'free monad'

   Multiple Interpretations for a monad? Guenther Schmidt [12]asked about
   monads which can have multiple levels of meaning and interpretation.

Blog noise

   [13]Haskell news from the [14]blogosphere. Blog posts from people new
   to the Haskell community are marked with , be sure to welcome them!
 * Joachim Breitner: [15]Exploiting sharing in arbtt.
 * Martijn van Steenbergen: [16]Colors in GHCi.
 * Don Stewart (dons): [17]Evaluation strategies and synchronization:
   things to watch for.
 * Don Stewart (dons): [18]Fusion makes functional programming fun!.
 * Michael Snoyman: [19]Simpler is Better.
 * Kevin Reid (kpreid): [20]Hvm.hs: an exercise in Haskell golf.
 * Bryn Keller: [21]Why Isn't Cabal Installed with GHC?.
 * Don Stewart (dons): [22]Modern Benchmarking in Haskell.

Quotes of the Week

 * roconnor: sounds like you need a zygohistomorphic prepromorphism
 * copumpkin: These are not the monads you are looking for.
 * noggle: this language is like having programming super powers

About the Haskell Weekly News

   New editions are posted to [23]the Haskell mailing list as well as to
   [24]the Haskell Sequence and [25]Planet Haskell. [26]RSS is also
   available, and headlines appear on [27]haskell.org.

   To help create new editions of this newsletter, please see the
   information on [28]how to contribute. Send stories to jfredett . at .
   gmail . dot . com. The darcs repository is available at darcs get
   [29]http://patch-tag.com/r/jfredett/HWN2/pullrepo HWN2 .

References

   1. http://haskell.org/
   2. http://tryhaskell.org/
   3. http://article.gmane.org/gmane.comp.lang.haskell.cafe/70857
   4. http://article.gmane.org/gmane.comp.lang.haskell.cafe/70689
   5. http://article.gmane.org/gmane.comp.lang.haskell.cafe/70961
   6. http://article.gmane.org/gmane.comp.lang.haskell.general/17819
   7. http://tryhaskell.org/
   8. http://article.gmane.org/gmane.comp.lang.haskell.general/17818
   9. http://www.haskell.org/pipermail/haskell-cafe/2010-February/073185.html
  10. http://article.gmane.org/gmane.comp.lang.haskell.cafe/70895
  11. http://article.gmane.org/gmane.comp.lang.haskell.cafe/70874
  12. http://article.gmane.org/gmane.comp.lang.haskell.cafe/70800
  13. http://planet.haskell.org/
  14. http://haskell.org/haskellwiki/Blog_articles
  15. 
https://www.joachim-breitner.de/blog/archives/381-Exploiting-sharing-in-arbtt.html
  16. http://martijn.van.steenbergen.nl/journal/2010/02/27/colors-in-ghci/
  17. 
http://donsbot.wordpress.com/2010/02/26/evaluation-strategies-and-synchronization-things-to-watch-for/
  18. 
http://donsbot.wordpress.com/2010/02/26/fusion-makes-functional-programming-fun/
  19. http://snoyberg.wordpress.com/2010/02/26/simpler-is-better/
  20. http://kpreid.livejournal.com/23060.html
  21. http://www.xoltar.org/?p=33
  22. http://donsbot.wordpress.com/2010/02/23/modern-benchmarking-in-haskell/
  23. http://www.haskell.org/mailman/listinfo/haskell
  24. http://sequence.complete.org/
  25. http://planet.haskell.org/
  26. http://sequence.complete.org/node/feed
  27

[Haskell-cafe] Is the Summer of Code TRAC relevant for this years SoC?

2010-02-28 Thread Nathan Hunter
Hello.

I was looking into the possibility of doing Summer of Code as a student,
when I found Haskell.org's
TRAChttp://hackage.haskell.org/trac/summer-of-code/report/1.
I was particularly interested in Efficient Maps using Generalised Trees and
the New Purely Functional Data Structures/Containers Library. I'd love to
work on either of those, but are they or any of the projects listed on the
TRAC still relevant, or are they just the leftovers from SoC 2009?

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


[Haskell-cafe] Computer Graphics and Haskell - Radiosity Methods

2010-02-28 Thread Hector Guilarte
Hello cafe,

While I was studying for my computer graphics test I have tomorrow I
realized that maybe some of the major problems I've read so far about
Radiosity Rendering Algorithms may be reduced significantly if it was
implemented in Haskell and taking advantage of the lazy evaluation so that
only what can be seen from the viewer's perspective point of view is
calculated, and the rest of the scene just remains as thunks waiting for
them to be calculated in case they are needed.

I guess that probably most of the people on this list doesn't really work on
the computer graphics area, but if anybody out there actually does I'd
really like if he or she could explain me more of why what I'm saying could
be really useful and what has already been done (or why I'm so lost that I'm
probably gonna fail my exam tomorrow hahaha)...

One of the things I'm studying is the Monte Carlo Radiosity Methods which
takes advantages of non-determinism to create stochastic algorithms, I guess
this is more difficult to implement in Haskell, please if you know any of
this Monte Carlo Methods for Radiosity Algorithms share that knowledge with
me (and the list).

Thank you,

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


Re: [Haskell-cafe] Is the Summer of Code TRAC relevant for this years SoC?

2010-02-28 Thread Don Stewart
enferris:
 Hello.
 
 I was looking into the possibility of doing Summer of Code as a student, when 
 I
 found Haskell.org's TRAC. I was particularly interested in Efficient Maps 
 using
 Generalised Trees and the New Purely Functional Data Structures/Containers
 Library. I'd love to work on either of those, but are they or any of the
 projects listed on the TRAC still relevant, or are they just the leftovers 
 from
 SoC 2009?

We'll set it up for 2010. 

Also look at the haskell-proposals reddit for ideas people in the
community have recently proposed.

The key is to find something relevant to lots of people.

http://www.reddit.com/r/haskell_proposals

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


Re: [Haskell-cafe] Computer Graphics and Haskell - Radiosity Methods

2010-02-28 Thread John Lask

you could have a look at these ...

bjpop-ray - search on web
hray - http://users.elis.ugent.be/~kehoste/Haskell/HRay/



Hello cafe,

While I was studying for my computer graphics test I have tomorrow I 
realized that maybe some of the major problems I've read so far about 
Radiosity Rendering Algorithms may be reduced significantly if it was 
implemented in Haskell and taking advantage of the lazy evaluation so 
that only what can be seen from the viewer's perspective point of view 
is calculated, and the rest of the scene just remains as thunks waiting 
for them to be calculated in case they are needed.


I guess that probably most of the people on this list doesn't really 
work on the computer graphics area, but if anybody out there actually 
does I'd really like if he or she could explain me more of why what I'm 
saying could be really useful and what has already been done (or why I'm 
so lost that I'm probably gonna fail my exam tomorrow hahaha)...


One of the things I'm studying is the Monte Carlo Radiosity Methods 
which takes advantages of non-determinism to create stochastic 
algorithms, I guess this is more difficult to implement in Haskell, 
please if you know any of this Monte Carlo Methods for Radiosity 
Algorithms share that knowledge with me (and the list).


Thank you,

Hector Guilarte




___
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