[Haskell-cafe] universal algebra support in Haskell?

2008-10-23 Thread Galchin, Vasili
Hello,

 I see that there is a Monoid class from Data.Monoid. What other
algebras like Group, Ring, etc. have support in Haskell?

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


[Haskell-cafe] the Haskell notion of class vis-a-vis universal algebra?

2008-10-23 Thread Galchin, Vasili
Hello,

   What is the relationship of a Haskell class to universal algebra? (a
refresher ... http://en.wikipedia.org/wiki/Universal_algebra) ... it seems
that all types that belong to a class are models? E.g. all monads have to
satisfy the monad laws stated in the Monad class, i.e. equational axioms!

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


[Haskell-cafe] Re: universal algebra support in Haskell?

2008-10-23 Thread DavidA
Num is basically Ring, but is spoiled by the inclusion of abs and signum, 
which of course mainly only make sense for subrings of C.

 Hello, I see that there is a Monoid class from Data.Monoid. What other 
algebras like Group, Ring, etc. have support in Haskell?Thanks, Vasili




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


[Haskell-cafe] Re: Help converting Perl to Haskell

2008-10-23 Thread Achim Schneider
Jason Dagit [EMAIL PROTECTED] wrote:

 I'm not very perl literate, but I want to convert a perl script to
 Haskell.  This bit of perl is part of darcs' test suite.  I was hoping
 to make it more portable by writing it in Haskell.  By more portable
 I mean, works in windows without cygwin/mingw/msys and avoids the need
 for perl also.  Depending on a Haskell compiler seems reasonable since
 darcs is written in Haskell :)
 
Erm... since it seems to be metaprogramming week, why don't you just use
parrot?

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


[Haskell-cafe] Re: the Haskell notion of class vis-a-vis universal algebra?

2008-10-23 Thread Achim Schneider
Galchin, Vasili [EMAIL PROTECTED] wrote:

 Hello,
 
What is the relationship of a Haskell class to universal
 algebra? (a refresher ...
 http://en.wikipedia.org/wiki/Universal_algebra) ... it seems that all
 types that belong to a class are models? E.g. all monads have to
 satisfy the monad laws stated in the Monad class, i.e. equational
 axioms!
 
Nah, Haskell isn't that strong, it only ensures type integrity, not the
laws themselves. Doing that isn't decidable in the genaral case as
it'd require source analysis, at least with the current state of types.

I better not attempt to answer the rest as I'm way to far off my home
turf. Ask Jonathan.


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


[Haskell-cafe] building c2hs on Mac

2008-10-23 Thread John Lato
Hello,

I've been trying to build c2hs-0.15.1 on an Intel Mac (10.4), and am
having some difficulty.  It has dependencies on happy and alex, which
would be fine, except that alex itself seems to require alex (using
alex 2.2).  Does anyone have any suggestions for how to get around
this?  I have ghc-6.8.3 and ghc-6.10 RC, and could use either.

Last time I tried to build c2hs on a mac I think I used macports,
which worked fine, except that's not an option this time because the
computer in question isn't (and won't be) online.  I'd have to rebuild
ghc anyway, which I don't want to do.

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


[Haskell-cafe] Hackage Improvement Ideas

2008-10-23 Thread Jason Dagit
Hello,

I was thinking of fun little projects people could work on to improve Hackage:
1) Popularity statistics -- like debian's popcon, gives stats on how
many people have which packages from hackage installed
2) Per package ratings and feedback listed on the page for each package
3) A way to mark a package as should be removed
4) All the hackage pages should be wiki editable -- for example, the
intro page refers to cabal-install as experimental but I think it's
moved beyond that point but I'm not sure how to edit that sentence.

What else should hackage do?

Who wants to claim one of the above earn some serious karma?

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


Re: [Haskell-cafe] building c2hs on Mac

2008-10-23 Thread Svein Ove Aas
On Thu, Oct 23, 2008 at 12:38 PM, John Lato [EMAIL PROTECTED] wrote:
 Hello,

 I've been trying to build c2hs-0.15.1 on an Intel Mac (10.4), and am
 having some difficulty.  It has dependencies on happy and alex, which
 would be fine, except that alex itself seems to require alex (using
 alex 2.2).  Does anyone have any suggestions for how to get around
 this?  I have ghc-6.8.3 and ghc-6.10 RC, and could use either.

That sounds familiar - happy depends on happy too, at least in the
latest version.

The general solution is to preprocess the alex files on another
machine, that does have alex installed. Ideally they'd come bundled.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Hackage Improvement Ideas

2008-10-23 Thread José Pedro Magalhães
I think at least some sort of statistics of visits and downloads of a
package would be very useful, also for the developers to have an idea of how
many people are using the package.


Pedro

On Thu, Oct 23, 2008 at 13:12, Jason Dagit [EMAIL PROTECTED] wrote:

 Hello,

 I was thinking of fun little projects people could work on to improve
 Hackage:
 1) Popularity statistics -- like debian's popcon, gives stats on how
 many people have which packages from hackage installed
 2) Per package ratings and feedback listed on the page for each package
 3) A way to mark a package as should be removed
 4) All the hackage pages should be wiki editable -- for example, the
 intro page refers to cabal-install as experimental but I think it's
 moved beyond that point but I'm not sure how to edit that sentence.

 What else should hackage do?

 Who wants to claim one of the above earn some serious karma?

 Jason
 ___
 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] building c2hs on Mac

2008-10-23 Thread Sean Leather
 except that alex itself seems to require alex (using
 alex 2.2).


Is this also true for the Hackage package? I seem to remember using the alex
and happy packages for some reason.

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


[Haskell-cafe] Call for Papers: Workshop on Language Descriptions, Tools and Applications 2008

2008-10-23 Thread Jurgen Vinju
LDTA: Workshop on Language Descriptions Tools and Applications

===Call For Papers 2009===

This is the Call For Papers for the Ninth Workshop on Language
Descriptions, Tools and Applications (LDTA 2009)

LDTA is a two-day satellite event of ETAPS which takes on the 28th and
29th of March 2009 in York, England.

==Scope==

LDTA is an application and tool oriented forum on meta programming in
a broad sense. A meta program is a program that takes other programs
as input or output. The focus of LDTA is on generated or otherwise
efficiently implemented meta programs, possibly using high level
descriptions of programming languages. Tools and techniques presented
at LDTA are usually applicable in the context of Language
Workbenches or Meta Programming Systems or simply as parts of
advanced programming environments or IDEs. The applications areas
include, but are not limited to:
* Program analysis, transformation, generation and verification
* Implementation of Domain Specific Languages (both visual and textual)
* Reverse engineering and reengineering
* Refactoring and other source-to-source transformations
* Application modelling (MDE, MDA, Software Factories, Software product lines)
* Grammar engineering / Grammarware
* Language definition and language prototyping
* Debugging, profiling and testing
* IDE construction
* Compiler construction

LDTA is a well-established workshop next to other conferences and
workshops on (programming) language engineering topics such as SLE and
GPCE.LDTA is traditionally a forum where computer science theories are
put to the test of real-world software engineering issues, for example
by applying:

* context-free grammars to parser generation for real programming languages,
* attribute grammars to static analyzer and compiler generation,
* term rewriting to source-to-source transformation,
* action semantics to programming language implementation,
* model checking to software verification.

Note that LDTA solicits submissions from any technological or
theoretical domain, as long as the paper is within the application
scope.

==Submission Procedure and Publication==

Submissions in the following categories are admissible:
* research papers,
* tool papers,
* experience papers

The final versions of accepted papers will probably(*) be published in
Electronic Notes in Theoretical Computer Science (ENTCS), Elsevier
Science, and will be made available during the workshop. (*)Due to
organizational changes at Elsevier, publication by ENTCS publication
is provisional; another comparable venue will be found otherwise.

Each submission must:
* clearly and unambiguously state in which of the three categories it falls
* be original, i.e. not published or submitted elsewhere,
* contain a clear motivation,
* contain a thorough analysis of the claimed contributions (for
example by comparing to related work),
* be written in less than 15 pages (research papers and experience
reports), or less than 10 pages (tool papers)
* use the ENTCS style.

The authors of each submission are required to give a presentation at
LDTA 2009. The authors of the tool papers are required to include an
interactive demonstration in their presentations.

The authors of the best papers will be invited to write a journal
version of their paper which will be separately reviewed and, assuming
acceptance, be published in journal form. As in past years, this will
be done in a special issue devoted to LDTA 2009 of the journal Science
of Computer Programming (Elsevier Science).

The authors of the best tool papers will be invited to write a paper
and submit the source of code of their tool, which will both be
separately reviewed and, assuming acceptance, be published in the
special issue on Experimental Software and Toolkits (EST) of the
journal Science of Computer Programming (Elsevier Science).

Please submit your abstract and paper using
http://www.easychair.org/conferences/?conf=ldta2009

==Program Committee==

Jurgen Vinju, CWI, Amsterdam (co-chair)
Torbjörn Ekman, Oxford, UK (co-chair)
Erik Meijer, Microsoft, Redmond, USA
Walid Taha, Rice University, Houston USA
Bob Fuhrer, IBM TJ Watson, USA
Susan Eisenbach, Imperial College, UK
Jean-Marie Jacquet, FUNDP, Namur, Belgium
Sibylle Schuppe, Chalmers, Sweden
Elizabeth Scott, RHUL, UK
Robert Grimm, NYU, USA
Judith Bishop, Pretoria, South Africa
Tudor Girba, Univ of Berne, Switzerland
Marjan Mernik, University of Maribor, Slovenia
Thomas Dean, Fondazione Bruno Kessler - IRST, Italy
Martin Bravenboer, Univ. of Oregon, USA
Pierre-Etienne Moreau, INRIA-LORIA, France
Gabi Taentzer, Philipps-Universität Marburg, Germany
Joao Saraiva, Universidade do Minho, Braga, Portugal
Tijs van der Storm, CWI, The Netherlands
Stephen Edwards, Columbia University, USA
Peter Thiemann, Universität Freiburg, Germany

==Important Dates==

Abstract submission deadline:Friday November 28th, 2008
Paper submission deadline:Friday December 5th, 2008
Notification of acceptance:Friday February 6th, 2009

[Haskell-cafe] Re: Plans for new System.Process?

2008-10-23 Thread Simon Marlow

Stephen Hicks wrote:


I've been trying out the new System.Process and have found it to be
very useful.  I was wondering what the plans for it were - I'd rather
not give up support for older versions of ghc just because I want to
use createProcess.  Are there plans of releasing process-1.0.1 so that
it's compatible with older compilers too?  Or does it depend on
something internally that makes this impossible?


Hmm, I hadn't thought about doing that, good idea.  I'm fixing it now, will 
upload later.


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


Re: [Haskell-cafe] Re: universal algebra support in Haskell?

2008-10-23 Thread Nathan Bloomfield
This question is relevant to a project I'm working on. I've been putting
together an abstract algebra library for handling computations inside group
rings, polynomial rings, and rings with adjoined elements. Once I've got it
cleaned up a little I'll upload it to an appropriate place.

(I forgot to cc haskell-cafe- sorry DavidA!)

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


Re: [Haskell-cafe] building c2hs on Mac

2008-10-23 Thread John Lato
On Thu, Oct 23, 2008 at 1:00 PM, Svein Ove Aas [EMAIL PROTECTED] wrote:
 On Thu, Oct 23, 2008 at 12:38 PM, John Lato [EMAIL PROTECTED] wrote:
 Hello,

 I've been trying to build c2hs-0.15.1 on an Intel Mac (10.4), and am
 having some difficulty.  It has dependencies on happy and alex, which
 would be fine, except that alex itself seems to require alex (using
 alex 2.2).  Does anyone have any suggestions for how to get around
 this?  I have ghc-6.8.3 and ghc-6.10 RC, and could use either.

 That sounds familiar - happy depends on happy too, at least in the
 latest version.

Maybe it was happy and not alex; I could be misremembering.

 The general solution is to preprocess the alex files on another
 machine, that does have alex installed. Ideally they'd come bundled.


Thanks, I should be able to get this to work somehow.

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


Re: [Haskell-cafe] building c2hs on Mac

2008-10-23 Thread John Lato
I don't know; I'll look into this.

John

On Thu, Oct 23, 2008 at 2:16 PM, Sean Leather [EMAIL PROTECTED] wrote:

 except that alex itself seems to require alex (using
 alex 2.2).

 Is this also true for the Hackage package? I seem to remember using the alex
 and happy packages for some reason.

 Regards,
 Sean

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


Re: [Haskell-cafe] Hackage Improvement Ideas

2008-10-23 Thread Thomas M. DuBuisson

 1) Popularity statistics -- like debian's popcon, gives stats on how
 many people have which packages from hackage installed

Popularity has been suggested for some time.  I think any new features
should be going into the happs version of Hackage
( http://code.haskell.org/hackage-server )
Though it seems not to have seen patches in recent weeks.

It also might interest you to know hackage has a trac:
http://hackage.haskell.org/trac/hackage/

Tom

 What else should hackage do?
Automate HPC, and quickChecks.
Automatic package dep graph.
Decentralize and distributed file serving (packages would need signed).
Package signing.

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


Re: [Haskell-cafe] Hackage Improvement Ideas

2008-10-23 Thread Jason Dagit
On Thu, Oct 23, 2008 at 11:40 AM, Thomas M. DuBuisson
[EMAIL PROTECTED] wrote:

 What else should hackage do?
 Automate HPC, and quickChecks.

These two make it sound like we'd almost be providing a 'buildbot'-like service.

 Automatic package dep graph.

Dep. graph would be cool.

 Decentralize and distributed file serving (packages would need signed).

This decentralized storage sounds like a good use of Tahoe:
http://allmydata.org/~warner/pycon-tahoe.html

I'm CC'ing Zooko (he works on Tahoe) hoping he will comment.

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


Re: [Haskell-cafe] universal algebra support in Haskell?

2008-10-23 Thread Henning Thielemann


On Thu, 23 Oct 2008, Galchin, Vasili wrote:


I see that there is a Monoid class from Data.Monoid. What other
algebras like Group, Ring, etc. have support in Haskell?


http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] External Sort: Sort a 10-million integer file with just 256M of ram.

2008-10-23 Thread Thomas Hartman
Now on hackage: cabal install external-sort

demo (included in distribution):

[EMAIL PROTECTED]:~/external-sortcat demo.hs
{-# LANGUAGE PatternSignatures #-}
import Algorithms.ExternalSort
import Data.List
import System.IO
import System.Environment (getArgs)
import System.Time
import HSH


-- to do: compare speed against unix sort util on a 10 million line file.

-- pure in-memory prelude sort will crash your computer when the list
gets over a million elements or so
-- externalsort caches the sublists used in the sort algorithm on your
hard drive, so you can sort a much larger list.
{-

The behavior below was on a demo executable, compiled. (In ghci, even
last on a 10 million element list
caused an out of memory error.) The test computer had 256M physical
ram and was ulimited to 256M cache.

*Main:! ulimit -v
262144

For 10 million element list:
*Main :! time ./demo preludesort 7
demo: out of memory (requested 1048576 bytes)
Command exited with non-zero status 1
4.88user 0.68system 0:21.11elapsed 26%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+64817minor)pagefaults 0swaps
*Main :! time ./demo externalsort 7
1000
73.87user 1.96system 1:24.25elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
792inputs+156280outputs (6major+16739minor)pagefaults 0swaps
./demo unixsort 7
wrote bigfile, time: Mon Oct 20 15:25:26 CEST 2008
demo: out of memory (requested 1048576 bytes)

For 100 million element list, external sort failed. Can it be made to
work? maybe in some future version.
time ./demo externalsort 8
demo: out of memory (requested 1048576 bytes)

real10m14.061s
user8m26.712s
sys 0m11.793s
[EMAIL PROTECTED]:~/external-sortls -lh ExternalSort.bin
-rw-r--r-- 1 thartman thartman 764M Oct 20 15:50 ExternalSort.bin

The problem is not fitting a 10^8 element list in memory, the
following works fine
 (when compiled, though not in ghci):
t = putStrLn . show . last $ [1..10^8::Int]

Maybe think about this more later.

-}

main = do
  [s,e] - getArgs
  let exp = read e
  case s of
preludesort - sortwith exp $ return . sort
externalsort - sortwith exp externalSort
unixsort - unixsort exp
_ - let msg = usage: ./demo preludesort 7 or ./demo externalsort
7 or ./demo unixsort 7 \
\(sort 10 million element list)
 in  fail msg

sortwith exp s = putStrLn = return . show . last = s ([1..10^exp ::Int])

unixsort exp = do
  let fn = bigfile
  withFile fn AppendMode (\h - (mapM_ (hPutStrLn h . show)
([1..10^exp::Int]) ) )
  putStrLn . ( (wrote  ++ fn ++ , time: ) ++ ) . show = getClockTime
  run $ time tail -n1 | sort  ++fn :: IO String
  return ()

t = putStrLn . show . last $ [1..10^8::Int]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: A heretic question

2008-10-23 Thread Albert Y. C. Lai

Benjamin L.Russell wrote:

On Tue, 21 Oct 2008 01:46:00 -0400, [EMAIL PROTECTED] wrote:


A paintbrush is easy to use, but hard to use well.


An interesting analogy.  Then, in the style of a verbal analogy exam
question:

C++ : paintbrush :: Haskell : ?


C++ : paintbrush :: Haskell : gimp or photoshop ?

(A twist on what paintbrush refers to. :) You can get gimp and 
photoshop to do wonder once you become computer-literate. You can get 
Haskell to do wonder once you become category-literate.)


C++ : paintbrush :: Haskell : OpenGL ?

(OpenGL has combinators for affine transformations. Plus, it has one 
more dimension than paintbrush painting!)


C++ : paintbrush :: Haskell : graphics software used for the Lord of the 
Rings movies?


(Real artists swear by the paintbrush. The rest of us need automation 
in rendering things, postponing evaluation, and freeing memory!)


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


Re: [Haskell-cafe] any idea why cabal install cabal-install cant update itself in windows?

2008-10-23 Thread Anatoly Yakovenko
On Wed, Oct 22, 2008 at 8:48 PM, Austin Seipp [EMAIL PROTECTED] wrote:
 Windows will not let you modify/delete binaries if they're running as a
 process, and it won't let you delete .DLL files that're in use by
 applications either (mapped to shared memory, that is.) So cabal
 install cannot overwrite the cabal.exe binary after it builds it,
 because it's already running.

looks like i just needed to fix my paths.  I had the default ghc bin
directory before the directory where cabal installs its binaries.  But
after i fixed that, i ran into the windows problem, which i fixed by
just copying the binary to a temporary location.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] External Sort: Sort a 10-million integer file with just 256M of ram.

2008-10-23 Thread Bulat Ziganshin
Hello Thomas,

Thursday, October 23, 2008, 8:41:04 PM, you wrote:

 The problem is not fitting a 10^8 element list in memory, the
 following works fine
  (when compiled, though not in ghci):
 t = putStrLn . show . last $ [1..10^8::Int]

this runs in 1k space, thanks to lazy evaluation. 10^8-length list
needs ~3gb of memory, it was discussed just a few days ago


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


[Haskell-cafe] Crash!

2008-10-23 Thread Andrew Coppin
Well what do you know? I have actually managed to write a pure Haskell 
program that generates an actual access violation when run! o_O


I was under the impression that this is impossible, so I'm now slightly 
worried.


The weird thing is, I spent 4 hours using the program without issue. 
However, when you feed it one specific input, it crashes. And I'm really 
not sure why. However, it appears to crash while asking GTK to save a 
PNG file. (??) That doesn't make a lot of sense, obviously. I do have 
some calls to unsafe array functions, but that doesn't appear to be 
where the crash is happening.


Does anybody have any clue where I start with trying to diagnose this? 
I'm out of my depth...


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread J. Garrett Morris
On Thu, Oct 23, 2008 at 11:00 AM, Andrew Coppin
[EMAIL PROTECTED] wrote:
 I was under the impression that this is impossible, so I'm now slightly
 worried.

I'm not sure why you'd think that:

import Foreign

fail :: IO Int
fail = peek nullPtr

main = fail = print

 /g

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


Re: [Haskell-cafe] Re: A heretic question

2008-10-23 Thread Luke Palmer
On Thu, Oct 23, 2008 at 11:21 AM, Albert Y. C. Lai [EMAIL PROTECTED] wrote:
 Benjamin L.Russell wrote:
 C++ : paintbrush :: Haskell : ?

 C++ : paintbrush :: Haskell : gimp or photoshop ?
 [...]
 C++ : paintbrush :: Haskell : OpenGL ?
 [...]
 C++ : paintbrush :: Haskell : graphics software used for the Lord of the
 Rings movies?

Nah, I'd say it's:

 C++ : paintbrush :: Haskell : category theory

:-)

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


Re: [Haskell-cafe] any idea why cabal install cabal-install cant update itself in windows?

2008-10-23 Thread Duncan Coutts
On Wed, 2008-10-22 at 19:56 -0700, Anatoly Yakovenko wrote:
 C:\Documents and Settings\anatolyycabal install cabal-install
 Resolving dependencies...
 'cabal-install-0.6.0' is cached.
 Configuring cabal-install-0.6.0...
 Preprocessing executables for cabal-install-0.6.0...
 Building cabal-install-0.6.0...
 ...
 Linking dist\build\cabal\cabal.exe ...
 Installing: C:\Documents and Settings\anatolyy\Application Data\cabal\bin
 
 C:\Documents and Settings\anatolyycabal --version
 cabal-install version 0.5.2
 using version 1.4.0.2 of the Cabal library

Right, the problem as you discovered is exe search paths.

This is because deciding where we should install exes by default seems
to be a controversial issue. So we have not made a good decision yet.

http://hackage.haskell.org/trac/hackage/ticket/289

The current state is well known to be sub-optimal (installing by default
into a dir that is not on the path by default) but trying to get
agreement on the Right Thingtm is tricky.

This is currently one of the most frequent issues tripping people up so
we'll try and come up with a reasonable compromise.

Duncan

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


Re: [Haskell-cafe] Re: A heretic question

2008-10-23 Thread Dan Weston
For the record, C++ (and a crippled scripting language call MEL that 
makes C look good) were used in the Maya 3D graphics software used for 
the Lord of the Rings movies [1]:


Weta Digital utilized Maya® as the core 3D animation software 
technology throughout the process of creating digital characters and 
effects for the Lord of the Rings™ films -- Lord of the Rings: The 
Fellowship of the Ring ™, Lord of the Rings: The Two Towers™, and Lord 
of the Rings: The Return of the King™.


[1] 
http://usa.autodesk.com/adsk/servlet/item?siteID=123112id=6878908linkID=7679654


Maya provided at that time (as now) a C++ API for plugins, with a 
data-structure poor MEL scripting language. Now (but not at that time), 
Python can also be used for both scripting and plugins.


There is (as yet) no Haskell API (anyone up for writing one?). Sorry to 
burst y'alls delusions of grandeur. I love Haskell greatly over C++, but 
the claims I've been reading about its use in industry are a still a wee 
bit premature.


Dan


Luke Palmer wrote:

On Thu, Oct 23, 2008 at 11:21 AM, Albert Y. C. Lai [EMAIL PROTECTED] wrote:

Benjamin L.Russell wrote:

C++ : paintbrush :: Haskell : ?

C++ : paintbrush :: Haskell : gimp or photoshop ?
[...]
C++ : paintbrush :: Haskell : OpenGL ?
[...]
C++ : paintbrush :: Haskell : graphics software used for the Lord of the
Rings movies?


Nah, I'd say it's:

 C++ : paintbrush :: Haskell : category theory

:-)

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] Crash!

2008-10-23 Thread Andrew Coppin

J. Garrett Morris wrote:

On Thu, Oct 23, 2008 at 11:00 AM, Andrew Coppin
[EMAIL PROTECTED] wrote:
  

I was under the impression that this is impossible, so I'm now slightly
worried.



I'm not sure why you'd think that:

import Foreign
  


Well yeah, if you directly access low-level stuff, it's quite easy to 
make your program crash.


The point is... I'm not doing that. Gtk2hs is, but that's a well-tested 
library, so I very much doubt it's the source of the bug.


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread wman

 Well yeah, if you directly access low-level stuff, it's quite easy to make
 your program crash.

 The point is... I'm not doing that. Gtk2hs is, but that's a well-tested
 library, so I very much doubt it's the source of the bug.


so how would a bug in GTK or in libpng demonstrate itself ? i'm wondering,
wouldn't it be a segfault ?
does just wrapping them in some fancy haskell typed functions turn every
library into a safe, typed haskell code ?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Thomas DuBuisson
 The point is... I'm not doing that. Gtk2hs is, but that's a well-tested
 library, so I very much doubt it's the source of the bug.


 so how would a bug in GTK or in libpng demonstrate itself ? i'm wondering,
 wouldn't it be a segfault ?
 does just wrapping them in some fancy haskell typed functions turn every
 library into a safe, typed haskell code ?


Sure it would, but the type system helps prevent programmers from misusing
the (hopefully correctly implemented) functions and thus triggering an error
due to bad input (ex: a pointer freed memory).  And as Andrew said, GTK and
its bindings are well tested so he is doubting that as the cause.  I
wouldn't rule it out so fast, but GHC has compiled pure code and crashed for
me before, so its shouldn't be surprising either way.

As for fixing this problem, is there a bit more detailed error you could
provide, Andrew?

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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Brandon S. Allbery KF8NH

On Oct 23, 2008, at 14:31 , Andrew Coppin wrote:
The point is... I'm not doing that. Gtk2hs is, but that's a well- 
tested library, so I very much doubt it's the source of the bug.



Gtk+, on the other hand, can be quite buggy.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Andrew Coppin

Brandon S. Allbery KF8NH wrote:

On Oct 23, 2008, at 14:31 , Andrew Coppin wrote:
The point is... I'm not doing that. Gtk2hs is, but that's a 
well-tested library, so I very much doubt it's the source of the bug.



Gtk+, on the other hand, can be quite buggy.


Gtk+ buggy?

Are we talking about the same Gtk+ that runs on the desktop of 50% of 
all the Linux machines on the plannet?


Well, I've never noticed any problems with it... ;-)

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


Re: [Haskell-cafe] Detecting unused read handles? (was: File handles and pipes)

2008-10-23 Thread Thomas Hartman
 Specifically I'm trying to concatenate the output of two system calls
 into the input of a third.  The following code does not get the job

Can the left-fold enumerator described by oleg in

http://okmij.org/ftp/Haskell/fold-stream.lhs

and with more references at http://okmij.org/ftp/Haskell/

be adapted for reading the output from arbitrary system calls? I.e.,
to deal with pipes? My intuition says yes but I'm still trying to wrap
my head around the whole left fold enumerator approach to io.

The text around We can now test reading from two streams with
interleaving: in the first reference seemed particularly promising to
me.




 2008/10/19 Stephen Hicks [EMAIL PROTECTED]:
 On Sun, Oct 19, 2008 at 1:44 AM, Brandon S. Allbery KF8NH
 [EMAIL PROTECTED] wrote:
 On 2008 Oct 19, at 1:37, Stephen Hicks wrote:

 I'm trying to understand how to get pipes working in Haskell, in
 particular with the revamped System.Process (though I've tried similar
 experiments with System.Posix.IO and Control.Concurrent).
 Specifically I'm trying to concatenate the output of two system calls
 into the input of a third.  The following code does not get the job
 done:

 Pipes are perhaps a bit misnamed:  if you want to combine the output of two
 pipes and funnel it into a third you can't simply plumb them together, you
 need to provide code which reads from the output pipes and writes into the
 input pipe.  If you don't care about order, forkIO a thread for each output
 pipe which reads from the output pipe it's passed and writes to the input
 pipe.  If order is significant, use mapM/forM to run the output-to-input
 code on each handle in turn.

 Thanks a lot - that seems to work very well, and even scales to large
 amounts of data nicely (and quickly, with Lazy ByteStrings).

 I've got one more question now.  Suppose I want to do the same thing
 on the other side, with two processes *receiving* the data.  Is there
 a way to tell whether the first process wants input, and if not, wait
 for the second process to do anything?

 That is, suppose I have something like

 do (Just inh1, _, _, p1) - createProcess (shell echo 1) { std_in = 
 CreatePipe }
-- wait for p1, possibly feeding it some input?
(Just inh2, _, _, p2) - createProcess (shell cat) { std_in = 
 CreatePipe }

 Is there a way to figure out that the echo 1 process never wanted
 any input, and therefore not give it any?  I looked through all of
 System.IO and everything seemed to indicate that inh1 was open, even
 after the process ended.  The only indication otherwise was that
 hflush inh1 failed with resource vanished.  I guess what I'm
 asking is I want to wait until the process p1 is waiting for input
 and/or terminates, and if it's the latter, move on to the next
 process in line, before actually doing any hPutStr into the read
 handles.  Is that possible?

 Thanks,
 steve
 ___
 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] Crash!

2008-10-23 Thread Brandon S. Allbery KF8NH

On Oct 23, 2008, at 15:35 , Andrew Coppin wrote:

Brandon S. Allbery KF8NH wrote:

On Oct 23, 2008, at 14:31 , Andrew Coppin wrote:
The point is... I'm not doing that. Gtk2hs is, but that's a well- 
tested library, so I very much doubt it's the source of the bug.



Gtk+, on the other hand, can be quite buggy.


Gtk+ buggy?

Are we talking about the same Gtk+ that runs on the desktop of 50%  
of all the Linux machines on the plannet?


Well, I've never noticed any problems with it... ;-)



I've found it fairly easy to crash on multiple Linux distributions  
(never mind the non-Linux ones).  Run it with all defaults, it's  
*probably* okay... don't try to configure it.  (I used to crash the  
control center all the time just by trying to look at all the  
available themes, before I gave up and switched to KDE.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Andrew Coppin

Thomas DuBuisson wrote:


The point is... I'm not doing that. Gtk2hs is, but that's a
well-tested library, so I very much doubt it's the source of
the bug.


so how would a bug in GTK or in libpng demonstrate itself ? i'm
wondering, wouldn't it be a segfault ?
does just wrapping them in some fancy haskell typed functions turn
every library into a safe, typed haskell code ?


Sure it would, but the type system helps prevent programmers from 
misusing the (hopefully correctly implemented) functions and thus 
triggering an error due to bad input (ex: a pointer freed memory).  
And as Andrew said, GTK and its bindings are well tested so he is 
doubting that as the cause.  I wouldn't rule it out so fast, but GHC 
has compiled pure code and crashed for me before, so its shouldn't be 
surprising either way.


This is the first time I've ever seen a Haskell program crash. (Unless 
you purposely do something Very Bad to it - e.g., it crashes pretty good 
if you try to run it without the GTK+ DLLs available, or run it on an 
ancient version of Windows or something.)


As for fixing this problem, is there a bit more detailed error you 
could provide, Andrew?


The problem arives inside a large, complicated program. The program 
draws some stuff into an IOUArray, runs a convolution over it, and then 
uses the GDK to write into a Pixbuf, which it then saves to a PNG file. 
The IOUArray stuff is done using unsafeWrite, but that's the only 
unsafe function used in the program. Usually the program works 
flawlessly. However, if you ask it to draw to a certain combination of 
coordinates, the program crashes. It's output indicates that it's drawn 
to the IOUArray, it's run the convolution, and it's trying to save the 
PNG file... but then a message pops up saying the generated code caused 
an access violation and the program stops. (And sure enough, an 
incomplete PNG file exists in the filesystem - so it really has crashed 
part-way through writing it.)


Theoretically, feeding invalid coordinates to the program might make it 
run off the end of the IOUArray (or maybe off the beginning of it), but 
I don't see what that has to do with GTK+...


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Ross Mellgren
In my experience it's pretty common for crashes to occur well after the 
original violation, if you stray off the path far enough into the stack 
or other fixed data structures.


Have you tried reformulating without using unsafeWrite, but using the 
safe writeArray alternative, to ensure that it's not an accidental stack 
smash or other uncouth behavior?


-Ross

Andrew Coppin wrote:

Thomas DuBuisson wrote:


The point is... I'm not doing that. Gtk2hs is, but that's a
well-tested library, so I very much doubt it's the source of
the bug.


so how would a bug in GTK or in libpng demonstrate itself ? i'm
wondering, wouldn't it be a segfault ?
does just wrapping them in some fancy haskell typed functions turn
every library into a safe, typed haskell code ?


Sure it would, but the type system helps prevent programmers from 
misusing the (hopefully correctly implemented) functions and thus 
triggering an error due to bad input (ex: a pointer freed memory).  
And as Andrew said, GTK and its bindings are well tested so he is 
doubting that as the cause.  I wouldn't rule it out so fast, but GHC 
has compiled pure code and crashed for me before, so its shouldn't be 
surprising either way.


This is the first time I've ever seen a Haskell program crash. (Unless 
you purposely do something Very Bad to it - e.g., it crashes pretty 
good if you try to run it without the GTK+ DLLs available, or run it 
on an ancient version of Windows or something.)


As for fixing this problem, is there a bit more detailed error you 
could provide, Andrew?


The problem arives inside a large, complicated program. The program 
draws some stuff into an IOUArray, runs a convolution over it, and 
then uses the GDK to write into a Pixbuf, which it then saves to a PNG 
file. The IOUArray stuff is done using unsafeWrite, but that's the 
only unsafe function used in the program. Usually the program works 
flawlessly. However, if you ask it to draw to a certain combination of 
coordinates, the program crashes. It's output indicates that it's 
drawn to the IOUArray, it's run the convolution, and it's trying to 
save the PNG file... but then a message pops up saying the generated 
code caused an access violation and the program stops. (And sure 
enough, an incomplete PNG file exists in the filesystem - so it really 
has crashed part-way through writing it.)


Theoretically, feeding invalid coordinates to the program might make 
it run off the end of the IOUArray (or maybe off the beginning of it), 
but I don't see what that has to do with GTK+...


___
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] Fwd: enhancing type classes with properties

2008-10-23 Thread Alberto G. Corona
It seems that some of the goals are not so hard. here I publised my
progress.

http://docs.google.com/Doc?id=dd5rm7qq_165rshp74gfpli=1

I show how to define a Ring, such a  mathematical structure in Haskell, how
to instantiate the class Num as a Ring , how to (possibly in other moment of
space-time) instantiate a new class as Num and how to test the axioms for
the new class.

All of then is something like a sophisticated assert mechanism, but , I
think, much more flexible and elegant.

2008/10/22 Alberto G. Corona [EMAIL PROTECTED]

 I guess that the namespace thing is not necesary. Maybe it can be done in
 template haskell. I never used TH however. it is a matter of inserting code
 here and there and rewrite rules somewhere at compile time.   It´s a nice
 project.  I´ll try.


 2008/10/22 Mitchell, Neil [EMAIL PROTECTED]

  Hi Alberta,

 It's a lot of work, but I wish you luck :-)  Many of the underlying tools
 exist, but there definately needs more integration.

 Thanks

 Neil


 This material is sales and trading commentary and does not constitute
 investment research. Please follow the attached hyperlink to an important
 disclaimer
 *www.credit-suisse.com/emea/legal*


  --
 *From:* Alberto G. Corona [mailto:[EMAIL PROTECTED]
 *Sent:* 22 October 2008 4:23 pm
 *To:* Mitchell, Neil
 *Subject:* Re: [Haskell-cafe] Fwd: enhancing type classes with properties

   Hi Neil,

 I see the contract type mechanism  and safety check techniques reflected
 in the above paper are a good step, But I think that something more
 general would be better. What I propose is to integrate directly in the
 language some concepts and developments that are already well know  to
 solve  some common needs that I thing can not be solved without this
 integration:

 To make use of:

-Quickcheck style validation. By the way, Don Steward recommend to add
 quckcheck rules close to the class definitions just for better
 documentation

- Implicit class properties defined everywhere in the documentation but
 impossible to reflect in the code (for example the famous monad rules:
 return x = f == f x etc )

  - The superb ghc rewrite rule mechanism (perhaps with enhancements)

  - object style namespaces, depending on class names.

 To solve problems like

  - code optimization

  - code verification.  regression tests for free!!

   - The need for safe overloading of methods and operators (making the
 namespaces dependent not only on module name  but also in class names) . Why
 I can not overload the  operator +  in the context of a DSL for
 JavaScript  generation if my operator does what + does?

  -  strict and meaningful rules for class instances.
  -  to make the rewrite rule mechanism visible to everyone



 2008/10/22 Mitchell, Neil [EMAIL PROTECTED]

  Hi Alberto,

 Take a look at ESC/Haskell and Sound Haskell, which provide mechanisms
 for doing some of the things you want. I don't think they integrate with
 type classes in the way you mention, but I think that is just a question of
 syntax.

 http://www.cl.cam.ac.uk/~nx200/ http://www.cl.cam.ac.uk/%7Enx200/

 Thanks

 Neil


 This material is sales and trading commentary and does not constitute
 investment research. Please follow the attached hyperlink to an important
 disclaimer
 *www.credit-suisse.com/emea/legal*


  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Alberto G. Corona
 *Sent:* 22 October 2008 1:43 pm
 *To:* haskell-cafe@haskell.org
 *Subject:* [Haskell-cafe] Fwd: enhancing type classes with properties

   I´m just thinking aloud, but, because incorporating deeper mathematics
 concepts has proven to be the best solution for better and more flexible
 programming languages with fewer errors, I wonder if raising the type
 classes incorporating axioms can solve additional problems.

 At first sight it does:


 class Abelian a  where
 (+) :: a - a - a
 property ((+))= a+b == b+a



 this permits:
1- safer polimorphism:   I can safely reuse the operator + if the type
 and the property is obeyed. The lack of ability to redefine operators is a
 problem for DSLs that must use wreid symbols combinations with unknow
 meanings. To use common operators with fixed properties is very good. the
 same aplies for method names.

2- the compiler can use the axions as rewrite rules.

   3- in debugging mode, it is possible to verify the axiom for each
 value a generated during execution. Thus, a generator  is not needed  like
 in quickcheck. The logic to quickcheck can be incorporated in the debugging
 executable.

 3 guaranties  that 1 and 2 are safe.





 a type class can express a relation between types,  but it is not
 possible to define relation between relations.

 ==
 Please access the attached hyperlink for an important electronic 
 communications disclaimer:
 

Re: [Haskell-cafe] Detecting unused read handles? (was: File handles and pipes)

2008-10-23 Thread Jason Dagit
On Thu, Oct 23, 2008 at 12:38 PM, Thomas Hartman [EMAIL PROTECTED] wrote:
 Specifically I'm trying to concatenate the output of two system calls
 into the input of a third.  The following code does not get the job

 Can the left-fold enumerator described by oleg in

 http://okmij.org/ftp/Haskell/fold-stream.lhs

 and with more references at http://okmij.org/ftp/Haskell/

 be adapted for reading the output from arbitrary system calls? I.e.,
 to deal with pipes? My intuition says yes but I'm still trying to wrap
 my head around the whole left fold enumerator approach to io.

I found his slides w/notes from defun to be insightful.

http://okmij.org/ftp/Streams.html#iteratee

grab the talk notes pdf.

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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Andrew Coppin

Thomas DuBuisson wrote:
So if you have such a specific portion of the code you think is to 
blame, perhaps you could simple comment that out (return () instead of 
write the file) and see if it crashes?  I understand people avoidance 
of brute force guess problem-compile-test cycles, but it seems you 
have good evidence supporting this guess.


Yeah, I can try different optimisation levels and so forth.

I'm actually wondering if my code is writing off the end of an array and 
this just happens to hit some data structure used by GTK+? (In which 
case, minute changes in linkage, etc., would disturb the bug.)


Does anybody know of any tools for definitely pinning down stuff like 
this? Surely C programmers have their code crash several hundred times a 
day due to bugs like this...


Also, be sure the thunks are evaluated  - if the writing of the file 
is what is forcing the evaluation (and thus triggering the condition) 
then you need to separate these two cases.


That's the fun part about Haskell, eh? ;-)

However, in this instance, there's that much explicit mutation in the 
I/O monad on unboxed (and therefore strict) arrays that I'm pretty sure 
that isn't the problem. By the time the save-PNG function is called, the 
data already exists in the address space managed by GTK+. It has to, or 
GTK+ wouldn't be able to save it.


Unless my *pure* code is somehow generating an access violation - which 
would surely indicate an actual compiler *bug*... (This seems laughably 
unlikely.)


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Andrew Coppin

Brandon S. Allbery KF8NH wrote:

On Oct 23, 2008, at 15:35 , Andrew Coppin wrote:

Gtk+ buggy?

Are we talking about the same Gtk+ that runs on the desktop of 50% of 
all the Linux machines on the plannet?


Well, I've never noticed any problems with it... ;-)



I've found it fairly easy to crash on multiple Linux distributions 
(never mind the non-Linux ones).  Run it with all defaults, it's 
*probably* okay... don't try to configure it.  (I used to crash the 
control center all the time just by trying to look at all the 
available themes, before I gave up and switched to KDE.)


Really? Well I've never ever seen GNOME crash. Hell, I run a GNOME 
desktop on a 0.01 GHz Amiga 1200 and it works! (Sure, it's slower than 
MS Vista on an 8086, but technically it works... just absurdly 
slowly...) And that's not even an Intel system.


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Andrew Coppin

D.V. wrote:

On Thu, Oct 23, 2008 at 10:30 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
  

Really? Well I've never ever seen GNOME crash. Hell, I run a GNOME desktop
on a 0.01 GHz Amiga 1200 and it works! (Sure, it's slower than MS Vista on



Now that's cool. I wish my Amiga still worked.
  


Hint: If you ever get it to work again... don't install Debian.

Or rather, don't install Debian if you enjoy programs that open on the 
same calendar day as you click the icon. o_O


It's really neat that you can make Linux run on anything, but that 
doesn't necessarily mean you _should_...


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


Re: [Haskell-cafe] Crash!

2008-10-23 Thread Dan Piponi
On Thu, Oct 23, 2008 at 1:26 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
 Does anybody know of any tools for definitely pinning down stuff like this?
 Surely C programmers have their code crash several hundred times a day due
 to bugs like this...

Curiously, the tool I often use with C/C++ to track down things like
overrunning past the end of arrays was written by a GHC developer.
It's valgrind. If the problem is happening in a foreign C/C++
function, and the executable has debugging information pointing to
valid source for those functions, then valgrind might help with
Haskell too. Even without source, testing with the 'fail' example
earlier in this thread, it at least tells me the problem was trying to
read from memory location zero, more information than just
Segmentation Fault.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Fwd: enhancing type classes with properties

2008-10-23 Thread Alberto G. Corona
Also in my weblog:
http://haskell-web.blogspot.com/2008/10/axioms-properties-for-haskell-classes.html

2008/10/23 Alberto G. Corona [EMAIL PROTECTED]

 It seems that some of the goals are not so hard. here I publised my
 progress.

 http://docs.google.com/Doc?id=dd5rm7qq_165rshp74gfpli=1

 I show how to define a Ring, such a  mathematical structure in Haskell, how
 to instantiate the class Num as a Ring , how to (possibly in other moment of
 space-time) instantiate a new class as Num and how to test the axioms for
 the new class.

 All of then is something like a sophisticated assert mechanism, but , I
 think, much more flexible and elegant.

 2008/10/22 Alberto G. Corona [EMAIL PROTECTED]

 I guess that the namespace thing is not necesary. Maybe it can be done in
 template haskell. I never used TH however. it is a matter of inserting code
 here and there and rewrite rules somewhere at compile time.   It´s a nice
 project.  I´ll try.


 2008/10/22 Mitchell, Neil [EMAIL PROTECTED]

  Hi Alberta,

 It's a lot of work, but I wish you luck :-)  Many of the underlying tools
 exist, but there definately needs more integration.

 Thanks

 Neil


 This material is sales and trading commentary and does not constitute
 investment research. Please follow the attached hyperlink to an important
 disclaimer
 *www.credit-suisse.com/emea/legal*


  --
 *From:* Alberto G. Corona [mailto:[EMAIL PROTECTED]
 *Sent:* 22 October 2008 4:23 pm
 *To:* Mitchell, Neil
 *Subject:* Re: [Haskell-cafe] Fwd: enhancing type classes with
 properties

   Hi Neil,

 I see the contract type mechanism  and safety check techniques reflected
 in the above paper are a good step, But I think that something more
 general would be better. What I propose is to integrate directly in the
 language some concepts and developments that are already well know  to
 solve  some common needs that I thing can not be solved without this
 integration:

 To make use of:

-Quickcheck style validation. By the way, Don Steward recommend to add
 quckcheck rules close to the class definitions just for better
 documentation

- Implicit class properties defined everywhere in the documentation
 but impossible to reflect in the code (for example the famous monad rules:
 return x = f == f x etc )

  - The superb ghc rewrite rule mechanism (perhaps with enhancements)

  - object style namespaces, depending on class names.

 To solve problems like

  - code optimization

  - code verification.  regression tests for free!!

   - The need for safe overloading of methods and operators (making the
 namespaces dependent not only on module name  but also in class names) . Why
 I can not overload the  operator +  in the context of a DSL for
 JavaScript  generation if my operator does what + does?

  -  strict and meaningful rules for class instances.
  -  to make the rewrite rule mechanism visible to everyone



 2008/10/22 Mitchell, Neil [EMAIL PROTECTED]

  Hi Alberto,

 Take a look at ESC/Haskell and Sound Haskell, which provide mechanisms
 for doing some of the things you want. I don't think they integrate with
 type classes in the way you mention, but I think that is just a question of
 syntax.

 http://www.cl.cam.ac.uk/~nx200/ http://www.cl.cam.ac.uk/%7Enx200/

 Thanks

 Neil


 This material is sales and trading commentary and does not constitute
 investment research. Please follow the attached hyperlink to an important
 disclaimer
 *www.credit-suisse.com/emea/legal*


  --
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] *On Behalf Of *Alberto G. Corona
 *Sent:* 22 October 2008 1:43 pm
 *To:* haskell-cafe@haskell.org
 *Subject:* [Haskell-cafe] Fwd: enhancing type classes with properties

   I´m just thinking aloud, but, because incorporating deeper
 mathematics concepts has proven to be the best solution for better and more
 flexible programming languages with fewer errors, I wonder if raising the
 type classes incorporating axioms can solve additional problems.

 At first sight it does:


 class Abelian a  where
 (+) :: a - a - a
 property ((+))= a+b == b+a



 this permits:
1- safer polimorphism:   I can safely reuse the operator + if the
 type and the property is obeyed. The lack of ability to redefine operators
 is a problem for DSLs that must use wreid symbols combinations with unknow
 meanings. To use common operators with fixed properties is very good. the
 same aplies for method names.

2- the compiler can use the axions as rewrite rules.

   3- in debugging mode, it is possible to verify the axiom for each
 value a generated during execution. Thus, a generator  is not needed  like
 in quickcheck. The logic to quickcheck can be incorporated in the debugging
 executable.

 3 guaranties  that 1 and 2 are safe.





 a type class can express a relation between types,  but it is not
 possible to define relation between relations.

 

Re[2]: [Haskell-cafe] Crash!

2008-10-23 Thread Bulat Ziganshin
Hello Andrew,

Thursday, October 23, 2008, 11:42:04 PM, you wrote:

 Theoretically, feeding invalid coordinates to the program might make it
 run off the end of the IOUArray (or maybe off the beginning of it), but
 I don't see what that has to do with GTK+...

replace unsafe writes with simple ones and try again


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


[Haskell-cafe] Re: External Sort: Sort a 10-million integer file with just 256M of ram.

2008-10-23 Thread Ben
the problem with the current externalSort is that it is not recursive
-- it tries to do everything in one pass.  basically instead of
attempting to merge all of the chunks together it should only merge
chunksize chunks together, producing a new list of chunks.  then those
get merged, etcthere is a discussion of this in knuth i think.  it
shouldn't be hard to make this work, i just didn't have time when i
wrote it.

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


[Haskell-cafe] Re: [Haskell] ANNOUNCE: colour 0.0.0

2008-10-23 Thread Henk-Jan van Tuyl

On Wed, 22 Oct 2008 02:12:05 +0200, [EMAIL PROTECTED] wrote:


http://hackage.haskell.org/cgi-bin/hackage-scripts/package/colour-0.0.0

I hope for this library to become the standard colour library for  
Haskell. Most software does not properly blend colours because they fail  
to gamma-correct the colours before blending.  Hopefully by using this  
library, Haskell programs dealing with colour blending will avoid this  
problem.


I am making an early release of my colour library to get some feedback.  
I am especially interested in getting feedback on the interfaces: should  
functions be renamed, should functions be moved, etc. Should I put black  
and white colours into Data.Colour?  Which is better form making a  
colour: (sRGB r g b) or (sRGB (r,g,b))?


Bug reports and any patches are also welcome.  Be warned, I haven't  
extensively tested this library yet.




I think it would be nice to have conversion functions for wxHaskell and  
the like, to convert between the different color representations.


--
Regards,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--


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


Re: [Haskell-cafe] Re: Pandoc questions

2008-10-23 Thread Andy Smith
2008/10/17 Andrew Coppin [EMAIL PROTECTED]:
 It strikes me that perhaps using LaTeX to enter mathematical markup is
 rather against the spirit of Markdown. Surely there should be an option to
 include raw LaTeX, but a more natural encoding that covers most
 mathematics would be nice also. Of course, that means somebody has to design
 it first...

Here's something along those lines, which I found recently on the W3C
MathML software page:

http://www1.chapman.edu/~jipsen/asciimath.html

It's a converter from an ASCII syntax to Presentation MathML, written
in JavaScript to allow mathematical notation on web pages to be
converted to MathML in browsers that support it, or kept as ASCII in
browsers that don't. There's a specification of the ASCII syntax which
would be a good starting point if you want to write another
implementation:

http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.html

Presumably this can't express everything that MathML can (and it
doesn't deal with Content MathML), so it would be useful to support
MathML in the source, like Markdown allows inline HTML, or LaTeX.

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


Re: [Haskell-cafe] Monadic Floating Point [was: Linking and unsafePerformIO]

2008-10-23 Thread Sterling Clover
I'd like to direct folks' attention to the IEEE-utils package on hackage
[1], which Matt Morrow started and I have made a few additions to. There are
bindings to set and check the rounding mode, as well as check and clear the
exception register. On top of that I've built a very experimental monadic
wrapper (so experimental that I just noticed a typo in the documentation).
The monad is essentially a newtype over IO, which enforces a single IEEE
state using an MVar propagated through the program as an implicit parameter
(as opposed to created with top-level unsafePerfomIO). Strictness could
probably be enforced in a more thoroughgoing fashion, but now is explicitly
introduced with calculate which is a lifted evaluate.
The perturb function is pretty neat -- it uses polymorphism to prevent
 memoization, such that the same pure calculation can be performed over
different rounding modes, to test for numeric stability. I couldn't think of
a sane way to deal with fancier traps to the IEEE registers, but obviously a
slower but sane implementation of exception traps could be built on top of
the existing machinery. With a bit of duct-tape, perturb could no doubt be
combined with quickcheck to prove some relatively interesting properties.
Matt and I did this mainly out of curiosity and to fill a gap, as neither of
us has a real need for this sort of control over IEEE state at the moment.
As such, I don't have a good idea of what is good or bad in the API or could
be more convenient. However, I'd urge folks with an itch to scratch to give
this all a try and maybe provide some feedback, use-cases, implementations
of algorithms that need this sort of thing, of course patches, etc.
[1]
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ieee-utils-0.4.0

Cheers,
Sterl.

On Fri, Oct 17, 2008 at 11:19 AM, Ariel J. Birnbaum [EMAIL PROTECTED] wrote:

  It is an interesting question: can IEEE floating point be done purely
  while preserving the essential features. I've not looked very far so I
  don't know how far people have looked into this before.
 Not sure. My doubts are mainly on interference between threads. If a thread
 can keep its FP state changes 'local' then maybe it could be done. I still
 think FP operations should be combined in a monad though --- after all,
 they
 depend on the evaluation order.

  Haskell currently only supports a subset of the IEEE FP api. One can
  assume that that's mainly because the native api for the extended
  features is imperative. But need it be so?
 
  Rounding modes sound to me like an implicit parameter. Traps and
  exception bits sound like the implementation mechanism of a couple
  standard exception handling strategies. The interesting thing here is
  that the exception handling strategy is actually an input parameter.
 Reader? =)

  So part of the issue is a functional model of the FP api but the other
  part is what compiler support would be needed to make a functional api
  efficient. For example if the rounding mode is an implicit parameter to
  each operation like + - * etc then we need some mechanism to make sure
  that we don't have to actually set the FP rounding mode before each FP
  instruction, but only at points where we know it can change, like
  passing a new value for the implicit parameter, or calling into a thunk
  that uses FP instructions.
 This one seems like a tough one to figure. Again, I'd vouch for a solution
 like STM --- composition of FP operations is allowed at a certain level
 (maybe enforcing some settings to remain constant here), while it takes a
 stronger level to connect them to their surroundings.

  There's also the issue that if the Float/Double operations take an
  implicit parameter, can they actually be instances of Num? Is that
  allowed? I don't know.
 Technically I guess they could, just like (Num a) = (b-a) can be made
 an instance. It would look more like State though, IMO. Or Cont. Doesn't
 even
 look like Oleg-fu is needed.

 Should they? That's a horse of a different colour. There are certain
 properties most programmers come to expect of such instances (regardless of
 whether the Report demands them or not), such as associativity of (+) and
 (==) being an equivalence that break miserably for floating point.

 Floating point is a hairy area for programing in general, but I think it's
 also one where Haskell can shine with an elegant, typesafe model.

 --
 Ariel J. Birnbaum
 ___
 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] universal algebra support in Haskell?

2008-10-23 Thread Galchin, Vasili
Hi Henning,

 Do you have any examples of say instance Lattice?

Vasili

On Thu, Oct 23, 2008 at 11:14 AM, Henning Thielemann 
[EMAIL PROTECTED] wrote:


 On Thu, 23 Oct 2008, Galchin, Vasili wrote:

 I see that there is a Monoid class from Data.Monoid. What other
 algebras like Group, Ring, etc. have support in Haskell?


 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude/

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


Re: [Haskell-cafe] universal algebra support in Haskell?

2008-10-23 Thread Galchin, Vasili
oops .. I see C Bool and C Integer on
http://cvs.haskell.org/darcs/numericprelude/docs/html/Algebra-Lattice.html.
..



On Thu, Oct 23, 2008 at 10:56 PM, Galchin, Vasili [EMAIL PROTECTED]wrote:

 Hi Henning,

  Do you have any examples of say instance Lattice?

 Vasili


 On Thu, Oct 23, 2008 at 11:14 AM, Henning Thielemann 
 [EMAIL PROTECTED] wrote:


 On Thu, 23 Oct 2008, Galchin, Vasili wrote:

 I see that there is a Monoid class from Data.Monoid. What other
 algebras like Group, Ring, etc. have support in Haskell?



 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude/



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


[Haskell-cafe] Re: universal algebra support in Haskell?

2008-10-23 Thread Benjamin L . Russell
On Thu, 23 Oct 2008 22:56:32 -0500, Galchin, Vasili
[EMAIL PROTECTED] wrote:

Hi Henning,

 Do you have any examples of say instance Lattice?

I would be interested in an instance Lattice as well.  Such an
example could be related to a complete partial ordering in domain
theory.

-- Benjamin L. Russell

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


[Haskell-cafe] Re: universal algebra support in Haskell?

2008-10-23 Thread Benjamin L . Russell
On Fri, 24 Oct 2008 13:50:47 +0900, Benjamin L.Russell
[EMAIL PROTECTED] wrote:

On Thu, 23 Oct 2008 22:56:32 -0500, Galchin, Vasili
[EMAIL PROTECTED] wrote:

Hi Henning,

 Do you have any examples of say instance Lattice?

I would be interested in an instance Lattice as well.  Such an
example could be related to a complete partial ordering in domain
theory.

Whoops!  At the following site:

HackageDB: numeric-prelude-0.0.5
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude/

I just found a reference to the following page:

Algebra.Lattice
http://hackage.haskell.org/packages/archive/numeric-prelude/0.0.5/doc/html/Algebra-Lattice.html

This could be an answer.

-- Benjamin L. Russell

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


[Haskell-cafe] Functional MetaPost in 5 Steps

2008-10-23 Thread Jared Updike
I'm interested in using Functional MetaPost on Mac OS X (or FreeBSD).
I'm looking for a tutorial like:

  http://haskell.org/haskellwiki/Haskell_in_5_steps

but for FMP. I can't even get a simple example to show up in a PDF file:
---
import FMP
... (see full code below)
myPicture = text Hello World
main = do
   print $ emit $ metaPost 1 myPicture params
--
When run, this emits MetaPost, which, after running through my shell
script, below, won't show up in my PDF... (this same TeX file will
show an .eps figure I made with PyX, the Python equivalent of FMP,
when I change includegraphics to use that file instead of test.1)

What am I missing? If I can get this working I will gladly write the
FMP 5 Step Tutorial. I like the idea of using FMP but I can't for the
life of me understand why running a toy example is so non-trivial.
(Not to mention undocumented... the manual and tutorials are very
compelling but they don't mention how to get a viewable PDF out of any
of the otherwise enticing examples.)

  Jared.

Relevant almost working code:

Test.hs:
---

import FMP

params = Parameters {
  prolog = verbatimtex\n\
 \\\documentclass{article}\n\
 \\\begin{document}\n\
 \etex\n\n\
 \input boxes\n\
 \input FuncMP\n\n,
  epilog= \n\n\\end,

  defaultDX= 3,
  defaultDY= 3,
  textDX= 2,
  textDY= 2,

  newmp= True,

  funcmpRTS= IGNORE, --+RTS -H40m -K3M -RTS,
  funcmpBin= IGNORE, -- ~/FuncMP-1.2/FuncMP,

   mpBin= IGNORE -- MPINPUTS=:~/FuncMP-1.2 TEX=latex mpost 
}

myPicture = text blah

main = do
   print $ emit $ metaPost 1 myPicture params

--

test.tex:
---
\documentclass[12pt]{article}
\usepackage[dvipdfm]{graphicx}

\begin{document}

\section*{Heading}

\begin{figure}

\begin{center}
\includegraphics{test.1}
\end{center}

\end{figure}

\end{document}
---

shell script:
--
#!/bin/sh

ghc --make Test.hs  \
  ./Test  test.mp  \
  mpost test.mp  \
  latex test.tex  \
  latex test.tex  \
  dvipdfm test.dvi  \
  open test.pdf   # MacOS X runs my pdf in preview
---
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Crash!

2008-10-23 Thread Achim Schneider
Andrew Coppin [EMAIL PROTECTED] wrote:

 Well what do you know? I have actually managed to write a pure
 Haskell program that generates an actual access violation when run!
 o_O
 
Did you already make a decision on the colour of the frame? I think I
would pick blue.

-- 
(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] universal algebra support in Haskell?

2008-10-23 Thread Galchin, Vasili
I cabal installed numeric-prelude .. however, unlike other packages(e.g.
Sqlite3), I am unable to :m numeric-prelude in a ghci session.??

Vasili

On Thu, Oct 23, 2008 at 11:14 AM, Henning Thielemann 
[EMAIL PROTECTED] wrote:


 On Thu, 23 Oct 2008, Galchin, Vasili wrote:

 I see that there is a Monoid class from Data.Monoid. What other
 algebras like Group, Ring, etc. have support in Haskell?


 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/numeric-prelude/

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


[Haskell-cafe] Sorry, but I'm in the mood (again)

2008-10-23 Thread Achim Schneider
http://www.haskell.org/haskellwiki/?title=Special:Categories

What are the mathematical properties of those Categories? Do they share
common axioms? 

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