[Haskell-cafe] ANNOUNCE: SourceGraph-0.6.0.2

2010-01-10 Thread Ivan Lazar Miljenovic
I've just uploaded a new version that works with haskell-src-exts-1.6.0
(all it needed was to increase the upper bound in the cabal file! \o/).

On another note, anyone know why Niklas Broberg hasn't been making any
release statements recently to say what the changes are, etc. for
haskell-src-exts?

Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes:

 I realised soon after I sent the announcement email that there was a bug
 in one of the new subtle features that I didn't list, namely the
 background shading of directories in import visualisation.  As such,
 SourceGraph 0.6.0.1 contains this fix.

 There were also two other features in 0.6.0.0 that I forgot to mention:

 * SourceGraph will (well, should; I haven't managed to come across a
   situation where it occurs anyway) no longer throw a fit if Graphviz
   throws an error when visualising a graph; instead it will just put an
   error message into the generated report.

 * The generated Dot code is also saved in the SourceGraph/graphs/
   subdirectory, so you can tweak the call graphs of your programs.

 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes:

 I'm pleased to announce the latest releases of SourceGraph [1] and
 Graphalyze [2].

 [1]: http://hackage.haskell.org/package/SourceGraph
 [2]: http://hackage.haskell.org/package/Graphalyze

 SourceGraph is a program that performs static code analysis on Haskell
 projects on the by applying graph theoretic techniques to the project's
 call graph.  Graphalyze is a library for analysing discrete data using
 graph theory, and as such performs the heavy lifting for SourceGraph.

 Sample analysis reports generated by SourceGraph are available at
 http://code.haskell.org/~ivanm/Sample_SourceGraph/SampleReports.html .
 I will also be demoing SourceGraph at PEPM [3] in Madrid on 19 January.

 [3]: http://www.program-transformation.org/PEPM10/

 Changes since the previous version include:

 * Now supports implicitly exported entities (as requested by Curt
   Sampson).  This includes instantiated class methods from other
   modules and functions, etc. that start with an underscore (see
   http://www.haskell.org/ghc/docs/latest/html/users_guide/options-sanity.html
   for more information).

 * All inaccessible entities are now reported, not just those that were
   root nodes in the call graph.

 * Edges are now colour-coded based upon whether they are part of a
   clique, cycle or a chain.

 * Level-based analyses: visualise how deep an entity is from those
   exported entities.

 * A re-done TODO that lists in detail what is planned for SourceGraph.

 * Lots of under-the-hood changes that don't sound as interesting as the
   above :-(

-- 
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] ANNOUNCE: SourceGraph-0.6.0.2

2010-01-10 Thread Niklas Broberg
 On another note, anyone know why Niklas Broberg hasn't been making any
 release statements recently to say what the changes are, etc. for
 haskell-src-exts?

Because it's been so many relatively small releases of late that I
haven't wanted to spam the lists. :-)

If you want to keep up to date, the changes can be found here:

http://code.haskell.org/haskell-src-exts/CHANGELOG

Cheers,

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


[Haskell-cafe] Hackage down

2010-01-10 Thread Neil Mitchell
Hi

Hackage is down:

http://downforeveryoneorjustme.com/hackage.haskell.org

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


Re: [Haskell-cafe] ANNOUNCE: SourceGraph-0.6.0.2

2010-01-10 Thread Ivan Lazar Miljenovic
Niklas Broberg niklas.brob...@gmail.com writes:
 Because it's been so many relatively small releases of late that I
 haven't wanted to spam the lists. :-)

I for one say spam away! Especially with a change like 1.5 - 1.6.

-- 
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


[Haskell-cafe] Re: FASTER primes

2010-01-10 Thread Will Ness
Daniel Fischer daniel.is.fischer at web.de writes:

 
 Am Freitag 08 Januar 2010 19:45:47 schrieb Will Ness:
  Daniel Fischer daniel.is.fischer at web.de writes:
 
  
   mergeSP :: Integral a = People a - People a - People a
   mergeSP p1@(P a _) p2 = P (a ++ vips mrgd) (dorks mrgd)
 where
   mrgd = spMerge (dorks p1) (vips p2) (dorks p2)
   spMerge l1 [] l3 = P [] (merge l1 l3)
   spMerge ~l1@(x:xs) l2@(y:ys) l3 = case compare x y of
   LT - celebrate x (spMerge xs l2 l3)
   EQ - celebrate x (spMerge xs ys l3)
   GT - celebrate y (spMerge l1 ys l3)
  
   --


Actually, the minimal edit that does the trick (of eliminating the space leak 
that you've identified) for my original code is just


  mergeSP (a,b) ~(c,d) = let (bc,bd) = spMerge b c d
 in (a ++ bc, bd) 
   where 
spMerge b [] d = ([] ,merge b d)
spMerge b@(x:xs) c@(y:ys) d = case compare x y of
LT -  (x:u,v)  where (u,v) = spMerge xs c  d
EQ -  (x:u,v)  where (u,v) = spMerge xs ys d
GT -  (y:u,v)  where (u,v) = spMerge b  ys d
spMerge [] c d = ([] ,merge c d)


which hardly looks at all different at the first glance. Just for reference, it 
was 

 {-
  mergeSP (a,b) ~(c,d) = let (bc,b') = spMerge b c
 in (a ++ bc, merge b' d) 
   where 
spMerge b@(x:xs) c@(y:ys) = case compare x y of
LT -  (x:u,v)  where (u,v) = spMerge xs c  
EQ -  (x:u,v)  where (u,v) = spMerge xs ys 
GT -  (y:u,v)  where (u,v) = spMerge b  ys 
spMerge b [] = ([] ,b)
spMerge [] c = ([] ,c)
 -}

spMerge of course is not tail recursive here in both versions if seen through 
the imperative eyes. But lazy evaluation makes it effectively so. The important 
thing is, when the final point is reached, there's no outstanding context - 
everything is present. There should be a name for such concept. This is very 
similar to late instantiation in Prolog (programming with holes), and I think 
this *would* pass as a tail-recursive function /there/.

Even in the new code the compiler could've internally held on to the original 
pair and only deconstructed the 'd' out of it at the final call to merge, 
recreating the space leak. It could just as well have recognized that 'd' isn't 
changed inside spMerge (we're pure in Haskell after all) and deconstructed the 
pair in the original code. Something is missing here.

 
 As it turns out, the important things are
 
 1. a feeder and separate lists of multiples for the feeder and the runner, 
 for the reasons detailed earlier (two-step feeding and larger wheel are 
 pleasing but minor optimisations).
 
 2. a strict pattern in tfold
 
 3. moving the merge inside spMerge 


  Is this the state of our _best_ Haskell compiler
 
 
 Yes. It's still a do what I tell you to compiler, even if a pretty slick 
 one, not a do what I mean compiler. Sometimes, what you tell the compiler 
 isn't what you wanted.
 It's easier to predict when you give detailed step by step instructions.
 




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


[Haskell-cafe] Haskell Weekly News: Issue 145 - January 10, 2010

2010-01-10 Thread jfredett

---
Haskell Weekly News
http://sequence.complete.org/hwn/20100110
Issue 145 - January 10, 2010
---
   Welcome to issue 145 of HWN, a newsletter covering developments in the
   [1]Haskell community.

   Welcome back Haskellers to the HWN! After a short hiatus we return with
   a megaedition covering the last three weeks of Haskell news and
   discussion. Needless to say, lots of new package and event
   announcements, as well as some really great discussions (the discussion
   about 'lawless' uninstances of Functors was particularly interesting)
   over the holiday break. Hopefully everyone had a safe and happy holiday
   season, and is back now steadily working off the winter-weight (in
   accordance with resolutions or no) by tapping steadily at the keyboard,
   producing wonderful new packages for me to place in this, your Haskell
   Weekly News!

Announcements

   Last CfP for TGC 2010: EXTENDED deadline Jan. 20 2010. Emilio Tuosto
   [2]announced an extension to the TGC'10 call for papers.

   SourceGraph-0.6.0.0 and Graphalyze-0.9.0.0. Ivan Lazar Miljenovic
   [3]announced new releases of the SourceGraph and Graphalyze packages.

   Streaming Component Combinators 0.4. Mario Blazevic [4]announced
   version 0.4 of Streaming Component Combinators (SCC).

   safer-file-handles-0.1. Bas van Dijk [5]announced a new member of the
   'monadic regions' family -- safer-file-handles. This package provides
   safety features on top of System.IO for handling file handles and
   operations.

   HOR 2010 1st CALL FOR ABSTRACTS. Frederic Blanqui [6]1f4e
   gmane.comp.lang.haskell.general/17710 announced the first call for
   abstracts for the Fifth International Workshop on Higher-Order
   Rewriting.

   vty-4.2.1.0. Corey O'Connor [7]announced a new version of the vty
   package.

   stm-io-hooks-0.6.0. Peter Robinson [8]announced a new version of
   stm-io-hooks. This version includes major interface changes, including
   the elimation of the 'onRetry' combinator.

   hecc-0.2. Marcel Fourne [9]announced the second release of his elliptic
   curve cryptography package, hecc. This release includes a license
   change to the BSD3 license, speed improvements, and new algorithms for
   point multiplication, as well as other changes.

   ghc-6.12.1 binary package for OpenSolaris. Michael Lee [10]announced a
   binary package availability of ghc-6.12 for OpenSolaris.

   Final Call for Participation: TLDI'10. Andrew Kennedy [11]announced the
   final call for participation in TLDI'10, the Workshop on Types in
   Language Design and Implementation.

   Haskell Web News: Looking back on 2009. Don Stewart [12]announced The
   Haskell Web News, a monthly summary of the hottest news about the
   Haskell programming language.

   hakyll-0.4. Jasper Van der Jeugt [13]announced the release of hakyll, a
   static site generator library.

   system-uuid-1.2.0. Jason Dusek [14]announced a new release of
   system-uuid.

   New versions of ALL the monadic regions packages. Bas van Dijk
   [15]announced a new version of all of the monadic regions packages,
   explanation of what this means is best left to the original post,
   linked previously.

   tuntap-0.0.1. John Van Enk [16]announced a new package, extracted from
   his in-progress VPN project. This package provides access to the
   TUN/TAP device in Linux.

   CPython / libpython bindings. John Millikin [17]announced a package
   providing bindings to the C API for CPython/libpython.

Discussion

   Typed Configuration Files. Sebastian Fischer [18]asked about whether
   there was an analogue to CmdArgs for config files.

   Review request for my permutations implementation. CK Kashyap [19]asked
   for a review of his implementation of a function for finding
   permutations -- in addition to a review he asked for earlier for code
   involving monads. The result is a nice pair of threads with
   introductory material about idiomatic, efficient Haskell code.

   lawless instances of Functor. Paul Brauner [20]asked about 'lawless'
   instances (Editor's Note: more so -- 'uninstances', since by
   definition, it cannot be a functor without satisfying the laws, even if
   it an instance can be written) of the `Functor` class. This is in an
   effort to better understand how Functors work in Haskell and in the
   wider theory.

Blog noise

   [21]Haskell news from the [22]blogosphere. Blog posts from people new
   to the Haskell community are marked with , be sure to welcome them!
 * Neil Mitchell: [23]Using .ghci files to run projects.
 * Tom Moertel: [24]A formal language for recipes: brain dump.
 * Mark Jason Dominus: [25]A monad for probability and provenance.
 * Alex Mason: [26]A small follow up.
 * Russell O'Connor: [27]Constructive Classical Completeness.
 * Galois, Inc: [28]GHC Nominated for Programming

[Haskell-cafe] Design question, HTML for GUIs?

2010-01-10 Thread Günther Schmidt

Hi everyone,

as probably most people I find the GUI part of any application to be the 
hardest part.


It just occurred to me that I *could* write my wxHaskell desktop 
application as a web app too.


When the app starts, a haskell web server start listening on localhost 
port 8080 for example and I fire up a browser to page localhost:8080 
without the user actually knowing too much about it.


Is that a totally stupid idea?
Which haskell web servers would make good candidates?
Are there any *continuation* based web server in haskell, something 
similar to Smalltalk's Seaside?

Is Hyena continuation-based?

Günther


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


Re: [Haskell-cafe] Design question, HTML for GUIs?

2010-01-10 Thread Gwern Branwen
2010/1/10 Günther Schmidt gue.schm...@web.de:
 Hi everyone,

 as probably most people I find the GUI part of any application to be the
 hardest part.

 It just occurred to me that I *could* write my wxHaskell desktop application
 as a web app too.

 When the app starts, a haskell web server start listening on localhost port
 8080 for example and I fire up a browser to page localhost:8080 without the
 user actually knowing too much about it.

 Is that a totally stupid idea?
 Which haskell web servers would make good candidates?

No; Happstack. See Gitit for an example - it is a wiki, but people use
it locally all the time, such as myself or Don Stewart.

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


Re: [Haskell-cafe] Design question, HTML for GUIs?

2010-01-10 Thread Jochem Berndsen
Günther Schmidt wrote:
 as probably most people I find the GUI part of any application to be the
 hardest part.
 
 It just occurred to me that I *could* write my wxHaskell desktop
 application as a web app too.
 
 When the app starts, a haskell web server start listening on localhost
 port 8080 for example and I fire up a browser to page localhost:8080
 without the user actually knowing too much about it.
 
 Is that a totally stupid idea?

No, this is not (necessarily) a stupid idea. In fact it might be a good
idea in a lot of cases.

A downside is, that you lose the functionality for user access control
provided by the OS on multi-user machines (i.e., other users working on
the same machine can connect to localhost:8080 too). This might or might
not be a concern for you.

Regards, Jochem
-- 
Jochem Berndsen | joc...@functor.nl | joc...@牛在田里.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Design question, HTML for GUIs?

2010-01-10 Thread John MacFarlane
+++ Günther Schmidt [Jan 10 10 19:38 ]:
 Hi everyone,
 
 as probably most people I find the GUI part of any application to be
 the hardest part.
 
 It just occurred to me that I *could* write my wxHaskell desktop
 application as a web app too.
 
 When the app starts, a haskell web server start listening on
 localhost port 8080 for example and I fire up a browser to page
 localhost:8080 without the user actually knowing too much about it.
 
 Is that a totally stupid idea?
 Which haskell web servers would make good candidates?
 Are there any *continuation* based web server in haskell, something
 similar to Smalltalk's Seaside?

Happstack is not continuation based, but Chris Eidhof shows how to use
Happstack with continuations here: http://gist.github.com/260052 

And Chris Smith has built a package:
http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/package/happstack-dlg-0.1.1

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


Re: [Haskell-cafe] Design question, HTML for GUIs?

2010-01-10 Thread Michael Snoyman
I wrote a package to turn Hack applications into standalone apps using
Webkit. The code is available at
http://github.com/snoyberg/hack-handler-webkit. However, it's currently
Linux-only. However, if I was going to write a desktop app based on an HTML
GUI, I would bundle Webkit like this. It fixes such annoyances as I closed
the window but the program is still running.

Michael

2010/1/10 Günther Schmidt gue.schm...@web.de

 Hi everyone,

 as probably most people I find the GUI part of any application to be the
 hardest part.

 It just occurred to me that I *could* write my wxHaskell desktop
 application as a web app too.

 When the app starts, a haskell web server start listening on localhost port
 8080 for example and I fire up a browser to page localhost:8080 without the
 user actually knowing too much about it.

 Is that a totally stupid idea?
 Which haskell web servers would make good candidates?
 Are there any *continuation* based web server in haskell, something similar
 to Smalltalk's Seaside?
 Is Hyena continuation-based?

 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] Typed Configuration Files

2010-01-10 Thread Sebastian Fischer

Is there something similar for parsing config files?


If you write one I most certainly will use it! ;)


You (we) can already start using the cmdargs package to parse config  
files.


Upon my feature request to add a function to the cmdargs package that  
allows to add default arguments, Neil pointed out that the function  
System.Environment.withArgs can be used to get the same effect without  
changes to the cmdargs package.


Here is a complete example:

{-# LANGUAGE DeriveDataTypeable #-}

import System.Environment
import System.Console.CmdArgs

data Conf = Conf { option :: Bool }
 deriving (Show,Data,Typeable)

myConf = mode $ Conf { option = enum False [True,False] }

main = print = getConfig my.conf My Program v0.0 myConf

getConfig configFileName welcomeMsg modeDesc =
  do originalArgs - getArgs
 argsFromFile - words `fmap` readFile configFileName
 withArgs (argsFromFile ++ originalArgs) (cmdArgs welcomeMsg  
[modeDesc])


If you save the String '--true' in the file 'my.conf', this program  
reads the config from the file and prints it:


# runhaskell typed-config.hs
Conf {option = True}

You can overwrite the default behaviour with command line arguments:

# runhaskell typed-config.hs --false
Conf {option = False}

After parsing a config file into command-line arguments, the parsing  
of the typed `Config` comes for free.


Sebastian

P.S.:

Instead of the `words` function one would use some smarter function  
that translates real config files into command-line arguments, but the  
fez-conf package (which provides such functionality) segfaults on my  
computer.


Depending on how one specifies the mode value, one may not be able to  
overwrite default options. For example, the usual translation of the  
boolean field above is a single flag --option that can be present or  
absent. I did not find a way to unset a set flag other than declaring  
it as an enum flag. This could be improved if flags without arguments  
would support optional arguments like '--option=yes/no' or similar.  
(Btw. the documentation of enum seems wrong, the given example does  
not typecheck).


--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



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


[Haskell-cafe] mtl and transformers

2010-01-10 Thread Günther Schmidt

Hi,

when I cabal-installed the iteratee package, the transformers package 
was also installed as a dependency.


Now when I run applications that import Control.Monad.Transformers I get 
this:


Could not find module `Control.Monad.Trans':
 it was found in multiple packages: transformers-0.1.4.0 mtl-1.1.0.2

What's the work around for situations like this?

Günther


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


Re: [Haskell-cafe] mtl and transformers

2010-01-10 Thread Ivan Lazar Miljenovic
Günther Schmidt gue.schm...@web.de writes:
 Could not find module `Control.Monad.Trans':
  it was found in multiple packages: transformers-0.1.4.0
  mtl-1.1.0.2

There's a way of specifying it at the top of whichever file you're
using, but so far my workaround in this situation is to use ghc-pkg
hide on whichever of those packages I don't use in my code.

-- 
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] mtl and transformers

2010-01-10 Thread Günther Schmidt

Hi Ivan,

ghc-pkg hide works fine, thanks!

Günther

Am 11.01.10 03:49, schrieb Ivan Lazar Miljenovic:

Günther Schmidtgue.schm...@web.de  writes:
   

 Could not find module `Control.Monad.Trans':
  it was found in multiple packages: transformers-0.1.4.0
  mtl-1.1.0.2
 

There's a way of specifying it at the top of whichever file you're
using, but so far my workaround in this situation is to use ghc-pkg
hide on whichever of those packages I don't use in my code.

   



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


Re: [Haskell-cafe] mtl and transformers

2010-01-10 Thread Valery V. Vorotyntsev
 Günther Schmidt:

 Could not find module `Control.Monad.Trans':
  it was found in multiple packages: transformers-0.1.4.0
  mtl-1.1.0.2

 Ivan Lazar Miljenovic:

 There's a way of specifying it at the top of whichever file you're
 using, but so far my workaround in this situation is to use ghc-pkg
 hide on whichever of those packages I don't use in my code.

Günther Schmidt:

 ghc-pkg hide works fine, thanks!

As an alternative, you can use `LANGUAGE PackageImports' pragma:

| {-# LANGUAGE PackageImports #-}
|
| import transformers Control.Monad.Trans

See
http://thread.gmane.org/gmane.comp.lang.haskell.libraries/12134/focus=12155

PS: Have fun with iteratees!

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