Re: [GHC] #1434: Slow conversion from Double to Int

2009-07-14 Thread GHC
#1434: Slow conversion from Double to Int
--+-
Reporter:  g...@henning-thielemann.de  |Owner:  dons   
Type:  task   |   Status:  new
Priority:  normal |Milestone:  6.12.1 
   Component:  libraries/base |  Version:  6.4.1  
Severity:  normal |   Resolution: 
Keywords:  rules  |   Difficulty:  Unknown
Testcase: |   Os:  Linux  
Architecture:  Unknown/Multiple   |  
--+-
Changes (by Khudyakov):

 * cc: alexey.sklad...@gmail.com (added)

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/1434#comment:12
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2271: floor, ceiling, round :: Double - Int are awesomely slow

2009-07-14 Thread GHC
#2271: floor, ceiling, round :: Double - Int are awesomely slow
--+-
Reporter:  dons   |Owner:  d...@galois.com 
Type:  bug|   Status:  new 
Priority:  normal |Milestone:  6.12.1  
   Component:  libraries/base |  Version:  6.8.2   
Severity:  normal |   Resolution:  
Keywords:  performance, math, double  |   Difficulty:  Unknown 
Testcase: |   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple   |  
--+-
Changes (by Khudyakov):

 * cc: alexey.sklad...@gmail.com (added)

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2271#comment:9
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3368: Deriving Foldable doesn't work

2009-07-14 Thread GHC
#3368: Deriving Foldable doesn't work
-+--
Reporter:  cmcq  |Owner:  igloo   
Type:  bug   |   Status:  closed  
Priority:  normal|Milestone:  6.12.1  
   Component:  Compiler  |  Version:  6.11
Severity:  normal|   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by igloo):

  * status:  new = closed
  * resolution:  = fixed

Comment:

 Patches applied, thanks!

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3368#comment:2
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3347: Add flag to prevent generation of import libraries on Windows

2009-07-14 Thread GHC
#3347: Add flag to prevent generation of import libraries on Windows
-+--
Reporter:  batterseapower|Owner:  igloo   
Type:  feature request   |   Status:  closed  
Priority:  normal|Milestone:  6.12.1  
   Component:  Compiler  |  Version:  6.10.2  
Severity:  normal|   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by igloo):

  * status:  new = closed
  * resolution:  = fixed

Comment:

 Patch applied (rerecorded to avoid conflict); thanks!

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3347#comment:3
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3263: Warnings for monadic values not used

2009-07-14 Thread GHC
#3263: Warnings for monadic values not used
-+--
Reporter:  NeilMitchell  |Owner:  igloo   
Type:  feature request   |   Status:  closed  
Priority:  normal|Milestone:  6.12.1  
   Component:  Compiler  |  Version:  6.10.2  
Severity:  normal|   Resolution:  fixed   
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by igloo):

  * status:  new = closed
  * resolution:  = fixed

Comment:

 Warnings in the GHC build now all fixed.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3263#comment:11
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2998: Expose the internals of the network library to make it more extensible

2009-07-14 Thread GHC
#2998: Expose the internals of the network library to make it more extensible
--+-
Reporter:  tibbe  |Owner:  igloo   
Type:  proposal   |   Status:  closed  
Priority:  normal |Milestone:  Not GHC 
   Component:  libraries (other)  |  Version:  6.10.1  
Severity:  normal |   Resolution:  fixed   
Keywords: |   Difficulty:  Unknown 
Testcase: |   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple   |  
--+-
Changes (by igloo):

  * status:  new = closed
  * resolution:  = fixed

Comment:

 tibbe says that this has been done now, with `.Internal`.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2998#comment:8
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #3121: readline package does not respect Cabal --extra-{include, lib}-dirs flags

2009-07-14 Thread GHC
#3121: readline package does not respect Cabal --extra-{include,lib}-dirs flags
--+-
Reporter:  duncan |Owner: 
Type:  bug|   Status:  new
Priority:  normal |Milestone:  Not GHC
   Component:  libraries (other)  |  Version:  6.10.1 
Severity:  normal |   Resolution: 
Keywords: |   Difficulty:  Unknown
Testcase: |   Os:  MacOS X
Architecture:  x86|  
--+-
Changes (by igloo):

  * owner:  igloo =

Comment:

 If it doesn't work with cabal-install then we should probably look for a
 solution that does.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3121#comment:3
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #2281: properFraction implemented with modf primitive?

2009-07-14 Thread GHC
#2281: properFraction implemented with modf primitive?
-+--
Reporter:  guest |Owner:  igloo   
Type:  bug   |   Status:  new 
Priority:  normal|Milestone:  6.12.1  
   Component:  libraries/base|  Version:  6.8.2   
Severity:  normal|   Resolution:  
Keywords:|   Difficulty:  Unknown 
Testcase:|   Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
-+--
Changes (by igloo):

  * type:  proposal = bug

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2281#comment:8
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3372: Allow for multiple linker instances

2009-07-14 Thread GHC
#3372: Allow for multiple linker instances
-+--
Reporter:  jcpetruzza|  Owner:  
Type:  feature request   | Status:  new 
Priority:  normal|  Component:  Compiler
 Version:|   Severity:  normal  
Keywords:|   Testcase:  
  Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-+--
 Right now there is only one RTS linker with a single symbol table.This
 means, for example, that one cannot have multiple instances of the GHC
 interpreter in the same process running simultaneously.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3372
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3373: GHC API is not thread safe

2009-07-14 Thread GHC
#3373: GHC API is not thread safe
-+--
Reporter:  jcpetruzza|  Owner:  
Type:  feature request   | Status:  new 
Priority:  normal|  Component:  GHC API 
 Version:|   Severity:  normal  
Keywords:|   Testcase:  
  Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-+--
 There are some items of global state (the {{{NameCache}}} and the
 {{{PackageInterfaceTable}}}) that should be protected. One can workaround
 this by using a mutex and only invoking GHC API operations in one thread
 at a time.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3373
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


[GHC] #3374: Profiling libraries are not installed

2009-07-14 Thread GHC
#3374: Profiling libraries are not installed
+---
Reporter:  scsibug  |  Owner:
Type:  bug  | Status:  new   
Priority:  normal   |  Component:  Build System  
 Version:  6.11 |   Severity:  normal
Keywords:   |   Testcase:
  Os:  MacOS X  |   Architecture:  x86_64 (amd64)
+---
 When building GHC from source, profiling libraries are created as
 requested, but are not installed.

 I followed the README's instructions, doing sh boot; ./configure; make;
 make install.  No custom build.mk was used.

 Attempting to compile programs with the -prof option fails, with a
 message like:

 Could not find module `System.Random':
   Perhaps you haven't installed the profiling libraries for package
 `random-1.0.0.1'?
   Use -v to see a list of the files searched for.

 When using the inplace/bin/ghc-stage2 compiler, instead of the installed
 version, profiled applications can be built without error.

 Running make show VALUE=GhcLibWays in the build directory confirms that
 it is set to v p.  Inspection of the library directory confirms that
 _p.a library files exist.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/3374
GHC http://www.haskell.org/ghc/
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: ANNOUNCE: GHC 6.10.4 Release Candidate 1

2009-07-14 Thread Gregory Wright
Good rc1 build on OS X 10.5.7 (Leopard/intel). Couldn't run the 6.10.3 
testsuite all the way through. Failed with things like


= getGroupEntryForName(normal)
cd ../../../libraries/unix/tests  
'/opt/local/var/macports/build/_Users_gwright_src_macports-trunk_dports_lang_ghc-beta/work/ghc-6.10.3.20090628/ghc/stage2-inplace/ghc' 
-fforce-recomp -dcore-lint -dcmm-lint  -dno-debug-output -o 
getGroupEntryForName getGroupEntryForName.hs  -package unix  

getGroupEntryForName.comp.stderr 21
cd ../../../libraries/unix/tests  ./getGroupEntryForName/dev/null 

getGroupEntryForName.run.stdout 2getGroupEntryForName.run.stderr

Wrong exit code (expected 0 , actual 1 )
Stdout:

Stderr:
getGroupEntryForName: thisIsNotMeantToExist: getGroupEntryForName: does 
not exist (no group name)



Should I be running a different version of the tests?

Best Wishes,
Greg

--
Gregory Wright
Antiope Associates LLC
18 Clay Street
Fair Haven, New Jersey 07704
USA

gwri...@antiope.com

+1 (732) 924-4549
+1 (732) 345-8378 [fax]



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: ghci debugger: showing function argumetns when stopped at its definition

2009-07-14 Thread Simon Marlow

Peter Hercek wrote:

Simon Marlow wrote:

On 10/07/2009 15:31, Peter Hercek wrote:

Hi,

It would be cool if ghci debugger could grab not only the free variables
in the selected expression but in one case a bit more. The case is when
we stop at a function definition the first time (when just entering it).


The problem is that functions can be defined with multiple equations, 
each giving different names for the arguments. e.g. in


f x 0 = x
f 0 x = x

when we stop at f, what do you want to see?


Right, I did not realize this problem. But your idea of using _arxN 
naming in case of more equations seems best to me. I would still like to 
have it available.


So it looks doable without bad consequences. Now, the question is: Is 
there any support for it except me?


No objections here.

Cheers,
Simon

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


HPC gives spurious results if sources are compiled with -cpp

2009-07-14 Thread Dominic Steinitz
Trac doesn't seem to work for us so I'm sending this bug report by email.

ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.1

ghc.exe -fhpc -cpp --make CommonHPC.hs -o CommonHPC

commonHPC

hpc markup CommonHPC --fun-entry-count

This gives no entry counts for fact in Common.hs. With more complex modules, 
you get spurious red, yellow and green over expressions.

Dominic.

CommonHPC.hs:

module Main (main) where

import Common

main = do
  test
  test

test = do
  putStrLn $ show $ fact 4
  putStrLn $ show $ fact 5

Common.hs:

module Common (
   fact
)
where

fact 0 = 1
fact n = n * fact (n-1)



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Using the ghc-api to run more than one instance of ghc simultaneously

2009-07-14 Thread Daniel Gorín


On Jul 13, 2009, at 10:53 PM, Marc Weber wrote:


Yes, it is a known limitation.  It ought to be documented somewhere.

There are two problems:

 1. GHC is not thread-safe.  [...]

 2. There is only one RTS linker with a single symbol table.  [...]


Are there already bug tracker items for these two problems?
I've tried finding them but didn't succeed. This would be a fast way  
to

document this issue even if its unlikely to be fixed soon.

Marc Weber


For the record, now there are:

http://hackage.haskell.org/trac/ghc/ticket/3372
http://hackage.haskell.org/trac/ghc/ticket/3373

Daniel
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


buildFdSets: file descriptor out of range

2009-07-14 Thread 山本和彦
Hello,

If this is not a right place to ask this question, please tell me
another place to ask.

I'm developing a mail server with GHC 6.10.3 on Linux. The server is
running well at the beginning. But after several hours, it receives an
error, buildFdSets: file descriptor out of range.

Please tell me what happened? And please suggest me how to fix this
problem.

Here is brief description of the server.

- linked with ADNS.
- complied with the -threaded option since ADNS requires it.
- uses forkIO to produce threads.
- does not use deamonize of System.Posix.Daemonize since it uses
  forkProcess. I execute my server as foreground process.
- Because there are so many nasty SMTP clients, most SMTP
  connections are time out. Handles of the SMTP connections
  disappear, so I cannot use hClose to close the handles.
- pushes the limit of file descriptors to 65536 with setResourceLimit.

--Kazu


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: buildFdSets: file descriptor out of range

2009-07-14 Thread Brandon S. Allbery KF8NH

On Jul 14, 2009, at 21:48 , Kazu Yamamoto (山本和彦) wrote:

running well at the beginning. But after several hours, it receives an
error, buildFdSets: file descriptor out of range.


I believe the runtime uses select(), which has a hard limit (enforced  
by the kernel) that the maximum file descriptor id be 1023.  (select()  
uses bitmasks and there is a limit on the size of a bitmask; see  
FD_SETSIZE.)



- pushes the limit of file descriptors to 65536 with setResourceLimit.



Reduce this to 1024, otherwise the runtime will eventually find itself  
dealing with file descriptors beyond the select() limit mentioned  
above.  Someone with more knowledge of the Haskell runtime will have  
to advise as to possible ways around it if you really need more than  
1024 file descriptors.


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




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


Re: buildFdSets: file descriptor out of range

2009-07-14 Thread 山本和彦
 I believe the runtime uses select(), which has a hard limit (enforced
 by the kernel) that the maximum file descriptor id be 1023.  (select()
 uses bitmasks and there is a limit on the size of a bitmask; see
 FD_SETSIZE.)

I understand. Thank you.

 Reduce this to 1024, otherwise the runtime will eventually find itself
 dealing with file descriptors beyond the select() limit mentioned
 above.  Someone with more knowledge of the Haskell runtime will have
 to advise as to possible ways around it if you really need more than
 1024 file descriptors.

I used to execute my server with the limit of 1024 since this is the
default limit of my machine. At that time, I suffered from the
following errors:

rpf: user error (Cannot create OS thread.)
rpf: accept: resource exhausted (Too many open files)

So, I pushed the limit to 65536.

I don't believe my server receives 1024 connections at once. So, I guess
file descriptors leak.

Does anyone know what happens when a TCP connection is reset by the
peer and its handle disappears. Does the file descriptor bound to the
handle leak?

--Kazu
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] Re: 20 years ago

2009-07-14 Thread Benjamin L . Russell
On Mon, 13 Jul 2009 16:35:06 +0400, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:

The first widespead OOP system was a Turbo Pascal 5.5, released 1989.

Just for the record, Turbo Pascal was preceded by a *pure*
object-oriented language, Smalltalk [1], as described below:

The Smalltalk language, which was developed at Xerox PARC (by Alan Kay 
and others) in the 1970s, introduced the term object-oriented 
programming to represent the pervasive use of objects and messages as 
the basis for computation Smalltalk and with it OOP were introduced to 
a wider audience by the August 1981 issue of Byte magazine.

The difference between a pure object-oriented programming language and
an impure one is that in the former, there is no difference between
values which are objects and values which are primitive types, as
explained below [2]:

Smalltalk is a pure object-oriented programming language, meaning 
that, unlike Java and C++, there is no difference between values which 
are objects and values which are primitive types. In Smalltalk, primitive 
values such as integers, booleans and characters are also objects, in the 
sense that they are instances of corresponding classes, and operations 
on them are invoked by sending messages. A programmer can change 
the classes that implement primitive values, so that new behavior can 
be defined for their instances--for example, to implement new control 
structures--or even so that their existing behavior will be changed. 
This fact is summarised in the commonly heard phrase In Smalltalk 
everything is an object (which would more accurately be expressed as 
all values are objects, as variables aren't).

Most currently widespread programming languages that are termed
object-oriented aren't really object-oriented, but are really
procedural with object-oriented extensions.  For example, this is true
of such languages as C++ and Java.

Incidentally, there is an interesting paper [3] by Matthias Felleisen
presenting the thesis, as described in the synopsis [4], that good
object-oriented programming heavily ``borrows'' from functional
programming and that the future of object-oriented programming is to
study functional programming and language design even more.

-- Benjamin L. Russell

[1] Object-oriented programming - Wikipedia, the free encyclopedia.
_Wikipedia, the free encyclopedia._ 13 July 2009. 14 July 2009.
http://en.wikipedia.org/wiki/Object-oriented_programming.

[2] Smalltalk - Wikipedia, the free encyclopedia. _Wikipedia, the
free encyclopedia._ 3 July 2009. 14 July 2009.
http://en.wikipedia.org/wiki/Smalltalk.

[3] Felleisen, Matthias. Functional Objects, Functional Classes.
Invited talk at 18th European Conference on Object-Oriented
Programming, Oslo, Norway, 14-18 June 2004. 16 June 2004.
http://www.ccs.neu.edu/home/matthias/Presentations/ecoop2004.pdf.

[4] Felleisen, Matthias. Functional Objects, Functional Classes.
College of Computer and Information Science, Northeastern University.
4 Aug. 2004. 14 July 2009.
http://www.ccs.neu.edu/home/matthias/Presentations/ecoop2004.html.
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
Furuike ya, kawazu tobikomu mizu no oto. 
-- Matsuo Basho^ 

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


Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Bulat Ziganshin
Hello Benjamin,

Tuesday, July 14, 2009, 10:14:44 AM, you wrote:

The first widespead OOP system was a Turbo Pascal 5.5, released 1989.

 Just for the record, Turbo Pascal was preceded by a *pure*

TP was a first OOP system sold in hundreds of thousands of copies. it
was OOP for the masses and its manual reflects what masses thought
about OOP those times - just the same that they think about FP now.
you can replace OOP with FP in the manual text i cited and read it as
modern text :)


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Bulat Ziganshin
Hello Benjamin,

Tuesday, July 14, 2009, 2:23:11 PM, you wrote:

you can replace OOP with FP in the manual text i cited and read it as
modern text :)

 Mostly, perhaps.  But how about the following portions (see page 16)

i meant only the ideology portion i cited, not that you can replace
s/OOP/FP/ in turbo pascal book and sell it as Haskell one :)


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


[Haskell] Re: 20 years ago

2009-07-14 Thread Benjamin L . Russell
On Tue, 14 Jul 2009 15:00:03 +0400, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:

Hello Benjamin,

Tuesday, July 14, 2009, 2:23:11 PM, you wrote:

you can replace OOP with FP in the manual text i cited and read it as
modern text :)

 Mostly, perhaps.  But how about the following portions (see page 16)

i meant only the ideology portion i cited, not that you can replace
s/OOP/FP/ in turbo pascal book and sell it as Haskell one :)

At the risk of getting off-topic, incidentally, do you know how to
install the programming language for the manual text that you had
cited on Windows XP Professional, Service Pack 3, in order to try out
the examples in the text?

Out of curiosity, I tried downloading [1] and installing it, but every
time I ran INSTALL.EXE, the program wouldn't seem to proceed past
looking for a floppy disk in my A: drive.

-- Benjamin L. Russell

[1] Intersimone, David. Antique Software: Turbo Pascal v5.5.
_Database Tools and Developer Software | Embarcadero Technologies_.
2009. Embarcadero Technologies, Inc. 14 July 2009.
http://edn.embarcadero.com/article/20803.
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
Furuike ya, kawazu tobikomu mizu no oto. 
-- Matsuo Basho^ 

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


[Haskell] ANNOUNCE: StateVar 1.0.0.0

2009-07-14 Thread Sven Panne
To further modularize the OpenGL/OpenAL packages, a new StateVar package has 
been released to Hackage. It contains state variables, which are references in 
the IO monad, like IORefs or parts of the OpenGL state.

Cheers,
   S.

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


[Haskell] ANNOUNCE: ObjectName 1.0.0.0

2009-07-14 Thread Sven Panne
A new (tiny) ObjectName package has been released to Hackage. It contains the 
class ObjectName, which corresponds to the general notion of explicitly 
handled identifiers for API objects, e.g. a texture object name in OpenGL or a 
buffer object name in OpenAL.

Cheers,
   S.

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


[Haskell] ANNOUNCE: OpenGLRaw 1.0.1.0

2009-07-14 Thread Sven Panne
A new version of the OpenGLRaw package has been uploaded to Hackage. Support 
for the following OpenGL extensions has been added:

   GL_NV_texture_shader2
   GL_NV_depth_clamp
   GL_NV_primitive_restart
   GL_NV_vertex_array_range2
   GL_NV_occlusion_query
   GL_NV_fence
   GL_NV_light_max_exponent
   GL_NV_texture_env_combine4
   GL_NV_fog_distance
   GL_NV_register_combiners2
   GL_NV_register_combiners
   GL_NV_light_max_exponent
   GL_NV_multisample_filter_hint
   GL_NV_texture_shader
   GL_NV_vertex_array_range
   GL_NV_texgen_emboss
   GL_NV_copy_depth_to_color

Cheers,
   S.

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


[Haskell] ANNOUNCE: GLURaw 1.0.0.0

2009-07-14 Thread Sven Panne
A new GLURaw package has been uploaded to Hackage. It contains full support 
for all GLU functionality and is similar in spirit to the OpenGLRaw package, 
i.e. it is a 1:1 mapping of the C interface, no libraries or headers are 
needed at build time, and the GLU API entries are resolved dynamically at 
runtime.

Cheers,
   S.

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


Re[2]: Haskell 2010: libraries

2009-07-14 Thread Bulat Ziganshin
Hello Ganesh,

Tuesday, July 14, 2009, 10:48:36 AM, you wrote:

 I don't have any strong opinion about whether there should be a library
 standard or not, but if there is a standard, how about putting the
 entire thing (perhaps including the Prelude) under the prefix
 Haskell2010. or similar? Most of it could be implemented by just
 re-exporting things from the real libraries.

we already have PvP mechanism for these things


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


Re[2]: Haskell 2010: libraries

2009-07-14 Thread Bulat Ziganshin
Hello Ian,

Tuesday, July 14, 2009, 3:20:42 AM, you wrote:

 We've been fortunate recently that, because the hierarchical modules
 haven't been in the standard, we've been able to extend and improve them
 without breaking compatibility with the language definition.

but breaking compatibility with existing programs. i hate situation
when we need to reupload entire hackage every year



-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


Re: Proposal: change to qualified operator syntax

2009-07-14 Thread Malcolm Wallace

   left section  right section   prefix
unqualified  (+ 1) (1 +)   (+)
Haskell 98   (M.+ 1)   (1 M.+) (M.+)
proposed (`M.(+)` 1)   (1 `M.(+)`) M.(+)
 or(*) (M.(+) 1) (flip M.(+) 1)


The last line is not correct.  (M.(+) 1) captures the first argument  
of the function, not the second like all the other entries in that  
column.  Likewise the flip variant captures the second arg, where all  
the others capture the first.


Regards,
Malcolm

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


Re[4]: Haskell 2010: libraries

2009-07-14 Thread Bulat Ziganshin
Hello Ganesh,

Tuesday, July 14, 2009, 11:59:00 AM, you wrote:

 I don't have any strong opinion about whether there should be a
 library standard or not, but if there is a standard, how about
 putting the entire thing (perhaps including the Prelude) under the
 prefix Haskell2010. or similar? Most of it could be implemented by
 just re-exporting things from the real libraries.
 
 we already have PvP mechanism for these things

 The PvP isn't (proposed as) part of the standard, and without package
 qualified imports as implemented by GHC, it wouldn't help anyway.

but package versioning implemented by ghc, hugs and probably other
compilers. with your idea we will have two things that address the
same problem, and these will be miltiplied - i.e. we will carry
several versions of base package, each having Haskell2010.*,
Haskell2011.* and so on modules


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


Re: Haskell 2010: libraries

2009-07-14 Thread Malcolm Wallace
A natural language consists of a vocabulary of words, as well as a  
grammar for stringing them together.  If we omit the common basic  
libraries from the language definition, then are we implicitly  
reducing the common vocabulary, and encouraging dialects to appear?   
If I see the function scanr in a module, should I expect that it has  
the semantics of Data.List.scanr?  Or is it OK for someone to define  
their own Data.List with different semantics?



Keep the commonly used and uncontroversial (mostly pure) modules and
rename them to use the new hierarchical module names.


I would largely concur with this policy, with the caveat that  
additions to the API might appear in future.  Also, the hierarchical  
versions of the FFI libraries are essential.



3. Numeric  keep as Numeric (?)


I think we could take the opportunity to rename it to Text.Numeric.   
Why Text?  Because it only defines ReadS and ShowS things (with the  
exception of fromRat, and floatToDigits, sigh, which should be moved  
elsewhere).


It'd be nice to have a clear dividing line of keeping the pure stuff  
and
dropping the bits for interacting with the system ... The bits for  
interacting with the system are of course exactly the bits that are  
most prone to change and are most in need of improvement.


In some ways, it is _more_ important to standardise the difficult  
bits, i.e. interacting with the system, because otherwise it is  
desparately difficult to write portable programs.  But I agree that  
the choices made in H'98 and earlier to abstract over the underlying  
OS were probably rather poor and inflexible, and it is probably  
unrealistic to be able to propose a new stable API for a couple of  
years yet.  I do think we should set it as a goal for the future  
however.


Regards,
Malcolm

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


RE: Re[4]: Haskell 2010: libraries

2009-07-14 Thread Sittampalam, Ganesh
Bulat Ziganshin wrote:
 Hello Ganesh,
 
 Tuesday, July 14, 2009, 11:59:00 AM, you wrote:
 
 I don't have any strong opinion about whether there should be a
 library standard or not, but if there is a standard, how about
 putting the entire thing (perhaps including the Prelude) under the
 prefix Haskell2010. or similar? Most of it could be implemented by
 just re-exporting things from the real libraries.
 
 we already have PvP mechanism for these things
 
 The PvP isn't (proposed as) part of the standard, and without package
 qualified imports as implemented by GHC, it wouldn't help anyway.
 
 but package versioning implemented by ghc, hugs and probably other
 compilers.

Do you mean the syntax that allows modules to be imported from a
specified package? If so I didn't realise this was implemented by
anything more than GHC.

  with your idea we will have two things that address the
 same problem,

Arguably it is the ability to import from a specified package that
duplicates the disambiguation mechanism provided by module names.

 and these will be miltiplied - i.e. we will carry
 several versions of base package, each having Haskell2010.*,
 Haskell2011.* and so on modules   

I'd expect the Haskell2010.* etc to be implemented in a haskell2010
package which depends on the relevant version of base. Obviously it
would need to be updated when base was changed incompatibly.

Having a library standard implies that implementations must support it
for some period of time. I don't see why namespacing the libraries of
that standard makes that any harder.

Cheers,

Ganesh


=== 
 Please access the attached hyperlink for an important electronic 
communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 
=== 
 
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime


Re: Haskell 2010: libraries

2009-07-14 Thread Duncan Coutts
On Tue, 2009-07-14 at 00:20 +0100, Ian Lynagh wrote:
 On Mon, Jul 13, 2009 at 09:56:50PM +0100, Duncan Coutts wrote:
  
  I'd advocate 4. That is, drop the ones that are obviously superseded.
  Keep the commonly used and uncontroversial (mostly pure) modules and
  rename them to use the new hierarchical module names.
  
  Specifically, I suggest:
  
   1. Ratio   keep as Data.Ratio
   2. Complex keep as Data.Complex
   3. Numeric keep as Numeric (?)
   4. Ix  keep as Data.Ix
   5. Array   keep as Data.Array
   6. Listkeep as Data.List
   7. Maybe   keep as Data.Maybe
   8. Charkeep as Data.Char
   9. Monad   keep as Control.Monad
  10. IO  keep as System.IO
  11. Directory   drop
  12. System  drop (superseded by System.Process)
  13. Timedrop
  14. Locale  drop
  15. CPUTime drop
  16. Random  drop
 
 We've been fortunate recently that, because the hierarchical modules
 haven't been in the standard, we've been able to extend and improve them
 without breaking compatibility with the language definition. In some
 cases, such as the changes to how exceptions work, we haven't had this
 freedom as the relevant functions are exposed by the Prelude, and that
 has been causing us grief for years.
 
 To take one example, since List was immortalised in the H98 report with
 104 exports, Data.List has gained an additional 7 exports:
 foldl'
 foldl1'
 intercalate
 isInfixOf
 permutations
 stripPrefix
 subsequences
 The last change (making the behaviour of the generic* functions
 consistent with their non-generic counterparts) was less than a year
 ago, and the last additions were less than 2.

Though also note that we have not changed any of the existing ones. Is
there a problem with specifying in the libraries section of the report
that the exports are a minimum and not a maximum?

 But to me, the most compelling argument for dropping them from the
 report is that I can see no benefit to standardising them as part of the
 language, rather than in a separate base libraries standard.

Some functions, especially the pure ones are really part of the
character of the language (and some are specified as part of the
syntax). We have not had major problems with the pure parts of the
standard libraries, our problems have almost all been with the system
facing parts (handles, files, programs, exceptions).

I don't see any particular problem with having some essential (in the
sense of being part of the essence of the language) libraries in the
main report and some separate libraries report in a year or two's time
standardising some of the trickier aspects of libraries for portable
programs to interact with the OS (addressing Malcolm's point about the
need for this so as to be able to write portable programs).

Duncan

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


Re: Haskell 2010: libraries

2009-07-14 Thread Ian Lynagh
On Tue, Jul 14, 2009 at 12:23:51PM +0100, Duncan Coutts wrote:
 On Tue, 2009-07-14 at 00:20 +0100, Ian Lynagh wrote:
  On Mon, Jul 13, 2009 at 09:56:50PM +0100, Duncan Coutts wrote:
   
  To take one example, since List was immortalised in the H98 report with
  104 exports, Data.List has gained an additional 7 exports:
 
  The last change (making the behaviour of the generic* functions
  consistent with their non-generic counterparts) was less than a year
  ago, and the last additions were less than 2.
 
 Though also note that we have not changed any of the existing ones.

Yes we have, less than a year ago:

GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude Data.List.genericTake (-1) abc
*** Exception: List.genericTake: negative argument

GHCi, version 6.10.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude Data.List.genericTake (-1) abc


 Is there a problem with specifying in the libraries section of the report
 that the exports are a minimum and not a maximum?

We wouldn't be able to fix the generic* functions, or the way exceptions
work.

  But to me, the most compelling argument for dropping them from the
  report is that I can see no benefit to standardising them as part of the
  language, rather than in a separate base libraries standard.
 
 Some functions, especially the pure ones are really part of the
 character of the language

The Haskell language could be thought of as being composed of Haskell
Language 2010 report and Haskell Libraries 1.0 report.

 (and some are specified as part of the
 syntax)

Yes, some types functions may need to be specified by the report as
being somewhere for desugaring etc. Although maybe we could even
eliminate most of these if rebindable syntax became part of the
language?


Thanks
Ian

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


Re: Haskell 2010: libraries

2009-07-14 Thread Ian Lynagh
On Tue, Jul 14, 2009 at 11:57:11AM +0400, Bulat Ziganshin wrote:
 Tuesday, July 14, 2009, 3:20:42 AM, you wrote:
 
  We've been fortunate recently that, because the hierarchical modules
  haven't been in the standard, we've been able to extend and improve them
  without breaking compatibility with the language definition.
 
 but breaking compatibility with existing programs. i hate situation
 when we need to reupload entire hackage every year

Standardising the number of modules we're talking about isn't going to
affect whether or not this happens.

Also, just because the libraries are standardised separately doesn't
mean that we /need/ to change them every year, it just makes it
/possible/ to change them.


Thanks
Ian

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


Re: Proposal: change to qualified operator syntax

2009-07-14 Thread Simon Marlow

On 14/07/2009 08:58, Malcolm Wallace wrote:

 left section  right section  prefix
unqualified (+ 1) (1 +) (+)
Haskell 98 (M.+ 1) (1 M.+) (M.+)
proposed (`M.(+)` 1) (1 `M.(+)`) M.(+)
or(*) (M.(+) 1) (flip M.(+) 1)


The last line is not correct. (M.(+) 1) captures the first argument of
the function, not the second like all the other entries in that column.
Likewise the flip variant captures the second arg, where all the others
capture the first.


oops, I got those the wrong way around.  Well spotted.

Fixed on the wiki page:

http://hackage.haskell.org/trac/haskell-prime/wiki/QualifiedOperators

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


Re: Haskell 2010: libraries

2009-07-14 Thread Ian Lynagh
On Tue, Jul 14, 2009 at 07:48:36AM +0100, Sittampalam, Ganesh wrote:
 
 I don't have any strong opinion about whether there should be a library
 standard or not, but if there is a standard, how about putting the
 entire thing (perhaps including the Prelude) under the prefix
 Haskell2010. or similar? Most of it could be implemented by just
 re-exporting things from the real libraries.

That would be OK with me, although I still think it would be easier for
us to disentangle the library standardisation effort from the language
standardisation effort.

I'd suggest

Haskell.V2010.Data.List (just re-exports from V2011 where possible)
Haskell.V2010.Prelude   (just re-exports from V2011 where possible)
Haskell.V2011.Data.List
Haskell.V2011.Prelude

with the implicit Prelude import being changed to
Haskell.Vversion.Prelude
where version is that latest the compiler supports, unless you say
e.g. -XHaskell2010.


Thanks
Ian

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


Re: [Haskell-cafe] Re: Are GADTs what I need?

2009-07-14 Thread Jason Dagit
On Mon, Jul 13, 2009 at 10:52 PM, Ashley Yakeley ash...@semantic.orgwrote:

 Ryan Ingram wrote:

  data Type a where
   TInt :: Type Int
   TBool :: Type Bool
   TChar :: Type Char
   TList :: Type a - Type [a]
   TFun :: Type a - Type b - Type (a - b)


 Type here is what I call a simple type witness. Simple type witnesses are
 useful because they can be compared by value, and if they have the same
 value, then they have the same type.

 So you can write this:

  data EqualType a b where
MkEqualType :: EqualType t t


Is there any reason to prefer this over:
data EqualType a b where
  MkEqualType :: EqualType a a

In the darcs source code we use a definition similar to the one I just
gave.  I never thought about making the definition like you gave.  I wonder
if it would have changed things, but I'm not sure what.  Your example type
checks the same with both versions of EqualType and a type signature is
required for matchWitness with both definitions.  Playing with the two, I
don't really see any way in which they are different.  Certainly, both
versions of MkEqualType have the same type, but I'm just surprised you don't
have to involve a or b in the type of MkEqualType.

After playing with both definitions for a bit, I think I see why they have
the same type and behave the same way.  Initially I was thinking t was an
existential type, but because of where it appears it is actually universally
quantifed, like the type variable 'a' in my version, so they end up being
equivalent.

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


[Haskell-cafe] Re: Example for formatted show in HStringTemplate

2009-07-14 Thread John MacFarlane
+++ Kemps-Benedix Torsten [Jul 13 09 23:56 ]:
 Hello,
 
 is there a working example of how to use the format clause with 
 HStringTemplate, e.g. for Data.Time.Day? I think, if there is a parameter 
 $day$, a reasonable template might contain e.g.:
 
 $day;format=%d.%b.%Y$
 
 But I only get toModifiedJulianDay: [54960] as the result which corresponds 
 to the unformatted show.

You probably need to define a StringTemplateShows instance for
Data.Time.Day, and then use stShowsToSE to define a ToSElem instance.
Something like

instance StringTemplateShows Day
  where stringTemplateFormattedShow formatString = formatTime defaultTimeLocale 
formatString 
   {- or whatever -- I'm not sure what the correct time-formatting function is 
-}

instance ToSElem Day
  where toSElem = stShowsToSE

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


Re: [Haskell-cafe] Re: Are GADTs what I need?

2009-07-14 Thread Ashley Yakeley
On Mon, 2009-07-13 at 23:20 -0700, Jason Dagit wrote:
  data EqualType a b where
MkEqualType :: EqualType t t
 
 Is there any reason to prefer this over:
 data EqualType a b where
   MkEqualType :: EqualType a a

They're exactly the same. Yours just looks a bit left-biased, that's
all.

-- 
Ashley Yakeley

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


Re: [Haskell-cafe] Re: Are GADTs what I need?

2009-07-14 Thread Luke Palmer
On Mon, Jul 13, 2009 at 10:33 PM, Ashley Yakeley ash...@semantic.orgwrote:

 On Mon, 2009-07-13 at 23:20 -0700, Jason Dagit wrote:
   data EqualType a b where
 MkEqualType :: EqualType t t
 
  Is there any reason to prefer this over:
  data EqualType a b where
MkEqualType :: EqualType a a

 They're exactly the same. Yours just looks a bit left-biased, that's
 all.


For GADTs I prefer the kind color:

data EqualType :: * - * - * where
MkEqualType :: EqualType a a

Except I don't usually use it, because I mostly use GADT syntax
pedagogically, as introduction to algebraic data types, and introducing
kinds just seems to confuse things further.

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


[Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Simon Peyton-Jones
Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start
| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| 
| Thank you very much for your time.
| 
| Charles Turner.

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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Andrew Butterfield

Simon Peyton-Jones wrote:

Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
  
The biggest probelm with full Haskell for beginners is that many type 
error messages require

some familiarity with the class system, which is not a beginner topic..

However, a good starting point perhaps is Helium - a stripped down 
version of Haskell
designed for teaching, with special care gvien to producing useful 
helpful error messages...


http://www.cs.uu.nl/wiki/Helium

Then full Haskell could be introduced in semester 2/ year2 / whatever 
timeline suits


(Anything is better than Java.. sigh ;-)
| 
| Thank you very much for your time.
| 
| Charles Turner.


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



--

Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Foundations and Methods Research Group Director.
School of Computer Science and Statistics,
Room F.13, O'Reilly Institute, Trinity College, University of Dublin
   http://www.cs.tcd.ie/Andrew.Butterfield/


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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Joe Fredette
If only for the fact that our little Haskell community is composed of 
about the nicest set of people ever -- I mean, try asking a newbie 
question on #c sometime -- then Haskell is a great language to learn early.


Not only is it great because of it's community, but it's also full of 
resources -- there are plenty of fun and interesting tutorials to learn 
with, among the best are Real World Haskell -- it's actually a print 
book, but you can read it in it's entirety online, give it a google. 
There's also a nice tutorial called, Learn you a Haskell for Great 
Good (or something like that), I've heard good things about it.


By far the best things you can do are subscribe to the Haskell-Cafe 
mailing list, and get yourself in the #haskell chatroom on freenode. I 
believe it was Mrs. Frizzle who said it best, Ask Questions, Make 
Mistakes, get Haskell-y!!!


/Joe

Simon Peyton-Jones wrote:

Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| 
| Thank you very much for your time.
| 
| Charles Turner.


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

  
begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:jfred...@gmail.com
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard

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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Michael Vanier

Simon Peyton-Jones wrote:

Haskell is a great language!  Check out haskell.org.   I'm ccing the Haskell 
Cafe which is read by many people better qualified to answer your question than 
me.   (Since I've been working on Haskell for many years, I am not well 
qualified to say how it seems to a beginner.)

S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| 
| I'll make this short! Do you think Haskell is a good language to start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| 
| Thank you very much for your time.
| 
| Charles Turner.


  

Charles,

Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.  My path into 
Haskell was roughly C - Python - Scheme - Ocaml - Haskell, and I 
think that this has a lot going for it (though for a beginner I would 
recommend Python over Haskell, and Scheme is suitable for beginners with 
the right textbooks, e.g. How To Design Programs and/or Structure and 
Interpretation of Computer Programs).  If you're willing to work really 
hard, and don't mind that it may take you quite a bit longer before you 
are creating real applications in Haskell than it would in e.g. Python, 
you can start with Haskell (check out the book Real World Haskell: 
http://realworldhaskell.org).  But if you get frustrated, feel free to 
shift down the list I gave.  Scheme or Ocaml are good languages to learn 
the basics of functional programming, and then you just have to add on 
the Haskell-specific material (of which there is a lot).  Haskell is 
kind of like a point in the language space that programmers evolve towards.


Mike


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


Re: [Haskell-cafe] Program with profiling runs faster than without

2009-07-14 Thread Grigory Sarnitskiy
14.07.09, 12:37, Grigory Sarnitskiy sargrig...@ya.ru:

 Hello! I can't understand why the following happens.
 ghc --make -fforce-recomp -O2 -fexcess-precision -fvia-C -optc-O2 Run.lhs -o 
 Run -prof -auto-all
 and
 time ./Run TestSim
 seems to be much faster (I got ~4 times faster indeed) than just
 ghc --make -fforce-recomp -O2 -fexcess-precision -fvia-C -optc-O2 Run.lhs -o 
 Run
 and
 time ./Run TestSim
 with ghc 6.8.2 on pentium 4 2.4 GHz under Ubuntu
 I was on my way to optimize the program when I've discovered this. The 
 program is rather complicated and badly optimized but still I think it is 
 quite strange to the profiled version to run faster. All necessary files I 
 send with this letter (Tann.7z).

Well, I've tested the code with ghc 6.10.3 under Windows --- the result is 
quite the same, however with the native binary compilier (not via C) the redult 
is even more drastic. I'm really interested how to obtain the same speed 
withput profiling compilation.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Miguel Mitrofanov
I disagree. It was easy enough for me. OK, I do have some Category 
Theory background and it certainly helps a lot. Still, I think that for 
a beginner (without any experience with C or anything like that) Haskell 
would be relatively easy. It doesn't involve (at least at the start) an 
ugly notion of assignment.


Michael Vanier wrote:

Simon Peyton-Jones wrote:
Haskell is a great language!  Check out haskell.org.   I'm ccing the 
Haskell Cafe which is read by many people better qualified to answer 
your question than me.   (Since I've been working on Haskell for many 
years, I am not well qualified to say how it seems to a beginner.)


S

| -Original Message-
| From: Charles Turner [mailto:charlie.h.tur...@googlemail.com]
| Sent: 11 July 2009 22:52
| To: Simon Peyton-Jones
| Subject: Haskell as a first language?
| | I'll make this short! Do you think Haskell is a good language to 
start

| with? I am brand new to programming and have been using Scheme, some of
| my peers suggest I should use Haskell. It seems professional to me.
| Has features that a beginner should not worry about. What would you
| suggest. (I'm not worried about bias)
| | Thank you very much for your time.
| | Charles Turner.

  

Charles,

Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.  My path into 
Haskell was roughly C - Python - Scheme - Ocaml - Haskell, and I 
think that this has a lot going for it (though for a beginner I would 
recommend Python over Haskell, and Scheme is suitable for beginners with 
the right textbooks, e.g. How To Design Programs and/or Structure and 
Interpretation of Computer Programs).  If you're willing to work really 
hard, and don't mind that it may take you quite a bit longer before you 
are creating real applications in Haskell than it would in e.g. Python, 
you can start with Haskell (check out the book Real World Haskell: 
http://realworldhaskell.org).  But if you get frustrated, feel free to 
shift down the list I gave.  Scheme or Ocaml are good languages to learn 
the basics of functional programming, and then you just have to add on 
the Haskell-specific material (of which there is a lot).  Haskell is 
kind of like a point in the language space that programmers evolve towards.


Mike


___
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[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Bulat Ziganshin
Hello Michael,

Tuesday, July 14, 2009, 2:01:44 PM, you wrote:

 Haskell is a wonderful language (my favorite language by far) but it is
 pretty difficult for a beginner.

i believe that Haskell is hard for intermediate programmers already
knowing any imperative language, but for beginners it should be ideal


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


[Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Ketil Malde

[redirected from hask...@]

Benjamin L.Russell dekudekup...@yahoo.com writes:

 One often amusing outgrowth of this is that FP (OOP) fanatics 
 anthropomorphize
 their functions (objects).

Well, I don't think we do.

Functions are just mappings of values to values, they may be opaque,
but they're predictable, unchanging, and just...too boring to be
antropomorphized.

Objects contain all kinds of hidden state and dependencies, and the
sheer unpredicatability of it all is the reason for the
anthropomorphics - it a symptom of a disease, not a desirable
quality. 

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


[Haskell-cafe] AW: Example for formatted show in HStringTemplate

2009-07-14 Thread Kemps-Benedix Torsten
John,

thanks for your answer, but HStringtemplate has instance definitions for 
Date.Time.Day. The question is more on the script side: How do I have to write 
the ST calls with ;format= embedded in HTML?

regards,

Torsten 



-Ursprüngliche Nachricht-
Von: John MacFarlane [mailto:fiddlosop...@gmail.com] 
Gesendet: Dienstag, 14. Juli 2009 08:20
An: Kemps-Benedix Torsten
Cc: ha...@googlegroups.com; haskell-cafe@haskell.org
Betreff: Re: Example for formatted show in HStringTemplate

+++ Kemps-Benedix Torsten [Jul 13 09 23:56 ]:
 Hello,
 
 is there a working example of how to use the format clause with 
 HStringTemplate, e.g. for Data.Time.Day? I think, if there is a parameter 
 $day$, a reasonable template might contain e.g.:
 
 $day;format=%d.%b.%Y$
 
 But I only get toModifiedJulianDay: [54960] as the result which corresponds 
 to the unformatted show.

You probably need to define a StringTemplateShows instance for
Data.Time.Day, and then use stShowsToSE to define a ToSElem instance.
Something like

instance StringTemplateShows Day
  where stringTemplateFormattedShow formatString = formatTime defaultTimeLocale 
formatString 
   {- or whatever -- I'm not sure what the correct time-formatting function is 
-}

instance ToSElem Day
  where toSElem = stShowsToSE

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


Re: [Haskell-cafe] Program with profiling runs faster than without

2009-07-14 Thread Malcolm Wallace

On 14 Jul 2009, at 11:09, Grigory Sarnitskiy wrote:


I think it is quite strange to the profiled version to run faster


I'm really interested how to obtain the same speed withput  
profiling compilation.


This is only a guess, but maybe there is a context-qualified CAF-like  
value that is being re-evaluated multiple times in the non-profiling  
case, but is appropriately monomorphised in the profiling case, so it  
is only evaluated once?


Regards,
Malcolm

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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Duncan Coutts
On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote:

 Charles,
 
 Haskell is a wonderful language (my favorite language by far) but it is 
 pretty difficult for a beginner.  In fact, it is pretty difficult for 
 anyone to learn in my experience, because it has so many advanced 
 concepts that simply don't exist in other languages, and trying to 
 absorb them all at once will likely be overwhelming.

As a contrary data-point, at Oxford we teach functional programming
(using Haskell) as the first course at the very beginning of the
computer science degree. I know several other universities also use FP
and Haskell very early on in their CS courses. On the Oxford course
about half the students have had significant previous programming
experience. There does not appear to be a significant difference in how
quickly students with little previous programming experience learn FP
compared to those with more programming experience (keep in mind these
are young people, not mature students with years of professional
programming experience).

The point is, it's not at all clear that it's a harder language for
beginners. Unfortunately, it rather hard to gather decent evidence about
learning on which one could base decisions on the choice of language.

Duncan

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


[Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Patai Gergely
Hello all,

I was asked to give a one-hour 'introductory' seminar on Haskell. The
audience is a bunch of very clever people with a wider than usual
perspective on programming and mathematics, and my talk should be rather
informational than evangelistic. Which topics do you think I should
touch by all means given the short time?

Gergely

-- 
http://www.fastmail.fm - Same, same, but different...

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


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Thomas Davie


On 14 Jul 2009, at 15:30, Patai Gergely wrote:


Hello all,

I was asked to give a one-hour 'introductory' seminar on Haskell. The
audience is a bunch of very clever people with a wider than usual
perspective on programming and mathematics, and my talk should be  
rather

informational than evangelistic. Which topics do you think I should
touch by all means given the short time?


Lazyness and the many funky things it lets you do -- there's tons of  
elegant programs that are only possible because of lazyness :)


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


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Magnus Therning
On Tue, Jul 14, 2009 at 2:42 PM, Thomas Davietom.da...@gmail.com wrote:

 On 14 Jul 2009, at 15:30, Patai Gergely wrote:

 Hello all,

 I was asked to give a one-hour 'introductory' seminar on Haskell. The
 audience is a bunch of very clever people with a wider than usual
 perspective on programming and mathematics, and my talk should be rather
 informational than evangelistic. Which topics do you think I should
 touch by all means given the short time?

 Lazyness and the many funky things it lets you do -- there's tons of elegant
 programs that are only possible because of lazyness :)

I'd add type-classes to that.

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
On Tue, Jul 14, 2009 at 3:42 PM, Thomas Davietom.da...@gmail.com wrote:

 On 14 Jul 2009, at 15:30, Patai Gergely wrote:

 Hello all,

 I was asked to give a one-hour 'introductory' seminar on Haskell. The
 audience is a bunch of very clever people with a wider than usual
 perspective on programming and mathematics, and my talk should be rather
 informational than evangelistic. Which topics do you think I should
 touch by all means given the short time?

 Lazyness and the many funky things it lets you do -- there's tons of elegant
 programs that are only possible because of lazyness :)

I would like to know them.

I'm looking for small snippets of code that are elegant when written
in Haskell (which is lazy by default) but not in other languages
supporting some form of laziness (like Python+Iterators).

Can you post some?

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


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
2009/7/14 Patai Gergely patai_gerg...@fastmail.fm:
 Hello all,

 I was asked to give a one-hour 'introductory' seminar on Haskell. The
 audience is a bunch of very clever people with a wider than usual
 perspective on programming and mathematics, and my talk should be rather
 informational than evangelistic. Which topics do you think I should
 touch by all means given the short time?

When you create the presentation, please consider the big picture of
Haskell, not only its technological features like laziness,
curryfication, HOF, monadic syntax, type inference, type classes and
so on.

I would concentrate on the fact that when you use Haskell, you write
code that is less prone to errors and bugs. When you write a program
in Haskell and it finally compiles, chances are that there are far
less bugs than in a program written in another language (I'm thinking
about so popular dynamic languages like Python and Ruby): hunting for
semantic errors is a significantly shorter task.

This comes directly from the technological features I mentioned above:
they are in the language for a purpose.

My 2 cents.

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


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Andrew Wagner
http://www.haskell.org/haskellwiki/Tying_the_Knot would seem to be relevant.

On Tue, Jul 14, 2009 at 9:55 AM, Cristiano Paris fr...@theshire.org wrote:


 I would like to know them.

 I'm looking for small snippets of code that are elegant when written
 in Haskell (which is lazy by default) but not in other languages
 supporting some form of laziness (like Python+Iterators).

 Can you post some?

 Cristiano
 ___
 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] What to say about Haskell?

2009-07-14 Thread Miguel Mitrofanov

Domain theory semantics, I guess.

I know, that if I (or rather a younger copy of me, not knowing a thing 
about Haskell) would be one of your students, and you tell me that there 
is such a clean and nice semantics for what we are doing, I'd be excited.


Patai Gergely wrote:

Hello all,

I was asked to give a one-hour 'introductory' seminar on Haskell. The
audience is a bunch of very clever people with a wider than usual
perspective on programming and mathematics, and my talk should be rather
informational than evangelistic. Which topics do you think I should
touch by all means given the short time?

Gergely


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


Re: [Haskell-cafe] Program with profiling runs faster than without

2009-07-14 Thread Grigory Sarnitskiy
14.07.09, 15:16, Malcolm Wallace malcolm.wall...@cs.york.ac.uk:

 This is only a guess, but maybe there is a context-qualified CAF-like  
 value that is being re-evaluated multiple times in the non-profiling  
 case, but is appropriately monomorphised in the profiling case, so it  
 is only evaluated once?
 Regards,
  Malcolm

And I guess you are quite right. I knew there is a poorly optimized place in my 
program, but I didn't  touch it for some ideological reasons. But this morning 
I get how to optimize it in an ideological friendly manner, so now without 
profiling the program ~ 2 times faster. The speed of profiled version hasn't 
changed, hence I've manually done some work the compiler does during profiling.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: AW: [Haskell-cafe] Example for formatted show in HStringTemplate

2009-07-14 Thread Sterling Clover

What I suspect that you've encountered is an infelicity when importing
GenericStandard. The ToSElem instance defaults to that provided by (Data a)
context. However, there is no special handler for Data.Time types in the
`extQ` chain. I could add one, but that would require relying on the
Data.Time library being the latest (since Typeable isn't provided until
then) or on conditional compilation and standalone deriving, which is a
pain. As the new time package comes into widespread use, I'll fix up the
gToSElem function with the appropriate handlers, but until then I'm afraid
that standard generics won't play well with Data.Time. GenericWithClass, on
the other hand, might yield better results.

There is, by the way, (thanks to the efforts of Luke Plant) now an
HStringTemplate page on the haskellwiki:
http://www.haskell.org/haskellwiki/HStringTemplate. Edits, improvements,
etc. of course welcome by all.

You may want to post this question and answer there.

By the way, I plan to have a new version with a real announcement and a fair
share of bugfixes in the next week or so.

Cheers,
Sterl.



Kemps-Benedix Torsten wrote:
 
 John,
 
 thanks for your answer, but HStringtemplate has instance definitions for
 Date.Time.Day. The question is more on the script side: How do I have to
 write the ST calls with ;format= embedded in HTML?
 
 regards,
 
 Torsten 
 
 
 
 -Ursprüngliche Nachricht-
 Von: John MacFarlane [mailto:fiddlosop...@gmail.com] 
 Gesendet: Dienstag, 14. Juli 2009 08:20
 An: Kemps-Benedix Torsten
 Cc: ha...@googlegroups.com; haskell-cafe@haskell.org
 Betreff: Re: Example for formatted show in HStringTemplate
 
 +++ Kemps-Benedix Torsten [Jul 13 09 23:56 ]:
 Hello,
 
 is there a working example of how to use the format clause with
 HStringTemplate, e.g. for Data.Time.Day? I think, if there is a parameter
 $day$, a reasonable template might contain e.g.:
 
 $day;format=%d.%b.%Y$
 
 But I only get toModifiedJulianDay: [54960] as the result which
 corresponds to the unformatted show.
 
 You probably need to define a StringTemplateShows instance for
 Data.Time.Day, and then use stShowsToSE to define a ToSElem instance.
 Something like
 
 instance StringTemplateShows Day
   where stringTemplateFormattedShow formatString = formatTime
 defaultTimeLocale formatString 
{- or whatever -- I'm not sure what the correct time-formatting
 function is -}
 
 instance ToSElem Day
   where toSElem = stShowsToSE
 
 John
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 

-- 
View this message in context: 
http://www.nabble.com/Example-for-formatted-show-in-HStringTemplate-tp24470429p24480823.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

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


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Magnus Therning
On Tue, Jul 14, 2009 at 3:01 PM, Cristiano Parisfr...@theshire.org wrote:
 2009/7/14 Patai Gergely patai_gerg...@fastmail.fm:
 Hello all,

 I was asked to give a one-hour 'introductory' seminar on Haskell. The
 audience is a bunch of very clever people with a wider than usual
 perspective on programming and mathematics, and my talk should be rather
 informational than evangelistic. Which topics do you think I should
 touch by all means given the short time?

 When you create the presentation, please consider the big picture of
 Haskell, not only its technological features like laziness,
 curryfication, HOF, monadic syntax, type inference, type classes and
 so on.

 I would concentrate on the fact that when you use Haskell, you write
 code that is less prone to errors and bugs. When you write a program
 in Haskell and it finally compiles, chances are that there are far
 less bugs than in a program written in another language (I'm thinking
 about so popular dynamic languages like Python and Ruby): hunting for
 semantic errors is a significantly shorter task.

 This comes directly from the technological features I mentioned above:
 they are in the language for a purpose.

 My 2 cents.

And maybe adding that Haskell seems to make it easy to concentrate on
data flow rather than control flow.

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org  Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Bulat Ziganshin
Hello Cristiano,

Tuesday, July 14, 2009, 6:01:14 PM, you wrote:

 When you create the presentation, please consider the big picture of
 Haskell, not only its technological features like laziness,
 curryfication, HOF, monadic syntax, type inference, type classes and
 so on.

 I would concentrate on the fact that when you use Haskell, you write
 code that is less prone to errors and bugs. When you write a program
 in Haskell and it finally compiles, chances are that there are far
 less bugs than in a program written in another language

the question is how to justify this in 1 hour. technical people don't
buy such arguments with justification. but if it will be done, it
would be best presentation possible


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

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


[Haskell-cafe] Problem resizing widget contained in window

2009-07-14 Thread Jeff Heard
I created a window, like so:

Gtk.windowSetTitle win name
Gtk.widgetSetName win Hieroglyph
Gtk.onDestroy win (exitWith ExitSuccess)
Gtk.windowSetDefaultSize  win w h
Gtk.containerResizeChildren win

And an GLDrawingArea like so:

config ←  Gtk.glConfigNew [Gtk.GLModeRGBA, Gtk.GLModeMultiSample,
Gtk.GLModeDouble, Gtk.GLModeDepth, Gtk.GLModeAlpha]
area ←  Gtk.glDrawingAreaNew config
Gtk.onRealize area ◊ GL.drawBuffer $= GL.BackBuffers
Gtk.onExpose area (λ_ →  renderOnExpose bus ≫ return True)

and finally show it like this:

Gtk.containerAdd win area
Gtk.widgetShowAll win



Now, if someone resizes the window, the GLArea does not appear to
resize along with it.  Did I screw something up?

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


Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
On Tue, Jul 14, 2009 at 4:46 PM, Bulat
Ziganshinbulat.zigans...@gmail.com wrote:
 ...
 the question is how to justify this in 1 hour. technical people don't
 buy such arguments with justification. but if it will be done, it
 would be best presentation possible

I think it's important to elaborate on this.

Why don't we create a specific Wiki page about Haskell advocation,
developing contents suitable for a presentation to be delivered to an
Haskell-unware audience? That would be useful to those people
spreading the word :)

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


Re: Re[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Ross Mellgren
I agree -- I think the most major learning curve problem (for me) was  
not learning haskell directly, it was un-learning all those patterns  
and workarounds and so on from imperative/OOP languages.


Of course, the only problem with learning haskell first is that one  
will probably be mildly annoyed by most of the more common programming  
languages ;-)


-Ross


On Jul 14, 2009, at 6:22 AM, Bulat Ziganshin wrote:


Hello Michael,

Tuesday, July 14, 2009, 2:01:44 PM, you wrote:

Haskell is a wonderful language (my favorite language by far) but  
it is

pretty difficult for a beginner.


i believe that Haskell is hard for intermediate programmers already
knowing any imperative language, but for beginners it should be ideal


--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com

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


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


Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Cristiano Paris
On Tue, Jul 14, 2009 at 5:12 PM, Cristiano Parisfr...@theshire.org wrote:
 ...
 Why don't we create a specific Wiki page about Haskell advocation,

http://haskell.org/haskellwiki/Advocation

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


Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Max Cantor

Any chance of renaming it to Advocacy?


On Jul 14, 2009, at 11:42 PM, Cristiano Paris wrote:

On Tue, Jul 14, 2009 at 5:12 PM, Cristiano Parisfr...@theshire.org  
wrote:

...
Why don't we create a specific Wiki page about Haskell advocation,


http://haskell.org/haskellwiki/Advocation

Cristiano
___
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] RE: Haskell as a first language?

2009-07-14 Thread Thomas Davie


On 14 Jul 2009, at 13:48, Duncan Coutts wrote:


On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote:


Charles,

Haskell is a wonderful language (my favorite language by far) but  
it is

pretty difficult for a beginner.  In fact, it is pretty difficult for
anyone to learn in my experience, because it has so many advanced
concepts that simply don't exist in other languages, and trying to
absorb them all at once will likely be overwhelming.


As a contrary data-point, at Oxford we teach functional programming
(using Haskell) as the first course at the very beginning of the
computer science degree. I know several other universities also use FP
and Haskell very early on in their CS courses. On the Oxford course
about half the students have had significant previous programming
experience. There does not appear to be a significant difference in  
how

quickly students with little previous programming experience learn FP
compared to those with more programming experience (keep in mind these
are young people, not mature students with years of professional
programming experience).

The point is, it's not at all clear that it's a harder language for
beginners. Unfortunately, it rather hard to gather decent evidence  
about

learning on which one could base decisions on the choice of language.


What I'd be interested to see is how fast beginners pick up haskell  
compared to imperative language – is it actually hard to learn, or do  
we just forget how hard it was to learn a new paradigm when we first  
learned imperative programming.  I guess it's rather hard to establish  
a metric for how fast the learning occurs though.


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


Re: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Don Stewart
patai_gergely:
 Hello all,
 
 I was asked to give a one-hour 'introductory' seminar on Haskell. The
 audience is a bunch of very clever people with a wider than usual
 perspective on programming and mathematics, and my talk should be rather
 informational than evangelistic. Which topics do you think I should
 touch by all means given the short time?

I'd concentrate on the getting things done aspect.

E.g. the efficient production of programs that utilize parallelism in
different ways, something Haskell's particularly well suited for.

Here's the talk I gave at Supercomputing 08, based on Simon and Satnam's
summer tutorial:


http://www.galois.com/blog/2008/11/12/beautiful-parallelism-harnessing-multicores-with-haskell/

Parallel programs, multicore programs == real dollar value. Lazy
programs, cute but not easy to quantify the benefit.

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


Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Patai Gergely
  I would concentrate on the fact that when you use Haskell, you write
  code that is less prone to errors and bugs. When you write a program
  in Haskell and it finally compiles, chances are that there are far
  less bugs than in a program written in another language
 
 the question is how to justify this in 1 hour. technical people don't
 buy such arguments with justification. but if it will be done, it
 would be best presentation possible
That's not really the direction I'd like to take anyway, because as I
said, the primary goal of this talk is not to convince these people to
use Haskell, but to give them an overview that's more helpful than
reading a book, and it should definitely introduce specific language
features and important patterns besides the general talk. The question
is which topics are noteworthy. But here's some more context for you:

My talk will be the second (there's one every week). The first one will
be a comparison of Prolog and Haskell by an expert of the former (not
surprisingly a rather mathematically minded fellow), and the third one
will be about monads in category theory. Also, the initiator of the
seminars is mostly interested in processing natural languages, so it
might be a good idea to bring up at least one relevant example -- for
instance, the latest post on sigfpe's blog could be nice, but it comes
with too many prerequisites.

Gergely

-- 
http://www.fastmail.fm - Access your email from home and the web

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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Jake McArthur

Michael Vanier wrote:
Haskell is a wonderful language (my favorite language by far) but it is 
pretty difficult for a beginner.  In fact, it is pretty difficult for 
anyone to learn in my experience, because it has so many advanced 
concepts that simply don't exist in other languages, and trying to 
absorb them all at once will likely be overwhelming.


I disagree, based on seeing my wife learn some Haskell with basically no 
previous experience programming. It was thrilling to see her learn some 
concepts almost instantly that it actually took me a while to understand 
because I had preconceived notions of how programming should work. When 
I talk about how other programming languages do things she thinks it's 
stupid. For example, I mentioned that you can actually change the values 
of variables in most other programming languages, and often have to, and 
she asked how anything understandable gets written that way. I also 
noticed that when I kept emphasizing that you can pass functions as 
parameters to other functions she was getting bored; it seemed that it 
simply would not have made sense any other way. I see no reason why 
learning more concepts on top of this foundation should be all that hard 
for her.


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


Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Matthias Görgens
Dear Gergely,

Okasaki's Purely Functional Data Structures is a treasure trove of
interesting things to demonstrate Haskell on.  Especially the data
structures based on numerical representations (skew binary numbers and
so on) appealed to my mathematical side.

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


Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Don Stewart
patai_gergely:
   I would concentrate on the fact that when you use Haskell, you write
   code that is less prone to errors and bugs. When you write a program
   in Haskell and it finally compiles, chances are that there are far
   less bugs than in a program written in another language
  
  the question is how to justify this in 1 hour. technical people don't
  buy such arguments with justification. but if it will be done, it
  would be best presentation possible
 That's not really the direction I'd like to take anyway, because as I
 said, the primary goal of this talk is not to convince these people to
 use Haskell, but to give them an overview that's more helpful than
 reading a book, and it should definitely introduce specific language
 features and important patterns besides the general talk. The question
 is which topics are noteworthy. But here's some more context for you:
 
 My talk will be the second (there's one every week). The first one will
 be a comparison of Prolog and Haskell by an expert of the former (not
 surprisingly a rather mathematically minded fellow), and the third one
 will be about monads in category theory. Also, the initiator of the
 seminars is mostly interested in processing natural languages, so it
 might be a good idea to bring up at least one relevant example -- for
 instance, the latest post on sigfpe's blog could be nice, but it comes
 with too many prerequisites.

See also Simon Peyton Jones' intro to Haskell, recently:


http://erlang-factory.com/upload/presentations/116/SimonPeyton-Jones-ErlangFactoryLondon2009-HaskellandErlangGrowinguptogether.pdf

http://www.erlang-factory.com/conference/London2009/speakers/SimonPeytonJones

And one big difference from Prolog: centralized community resources.
One main implementation, one distribution mechanism, one build system,
one central library archive.

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


[Haskell-cafe] Re: AW: Example for formatted show in HStringTemplate

2009-07-14 Thread John MacFarlane
Torsten,

I'm not quite sure what you're asking -- but this simple example seems
to work fine:

Prelude Text.StringTemplate let (a :: StringTemplate String) = newSTMP 
$day;format=\%d.%b.%Y\$
Prelude Text.StringTemplate Data.Time render $ setAttribute day 
(ModifiedJulianDay 234) a
09.Jul.1859

John

+++ Kemps-Benedix Torsten [Jul 14 09 12:20 ]:
 John,
 
 thanks for your answer, but HStringtemplate has instance definitions for 
 Date.Time.Day. The question is more on the script side: How do I have to 
 write the ST calls with ;format= embedded in HTML?
 
 regards,
 
 Torsten 
 
 
 
 -Ursprüngliche Nachricht-
 Von: John MacFarlane [mailto:fiddlosop...@gmail.com] 
 Gesendet: Dienstag, 14. Juli 2009 08:20
 An: Kemps-Benedix Torsten
 Cc: ha...@googlegroups.com; haskell-cafe@haskell.org
 Betreff: Re: Example for formatted show in HStringTemplate
 
 +++ Kemps-Benedix Torsten [Jul 13 09 23:56 ]:
  Hello,
  
  is there a working example of how to use the format clause with 
  HStringTemplate, e.g. for Data.Time.Day? I think, if there is a parameter 
  $day$, a reasonable template might contain e.g.:
  
  $day;format=%d.%b.%Y$
  
  But I only get toModifiedJulianDay: [54960] as the result which 
  corresponds to the unformatted show.
 
 You probably need to define a StringTemplateShows instance for
 Data.Time.Day, and then use stShowsToSE to define a ToSElem instance.
 Something like
 
 instance StringTemplateShows Day
   where stringTemplateFormattedShow formatString = formatTime 
 defaultTimeLocale formatString 
{- or whatever -- I'm not sure what the correct time-formatting function 
 is -}
 
 instance ToSElem Day
   where toSElem = stShowsToSE
 
 John
 ___
 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] Haskell as a first language?

2009-07-14 Thread Gareth Smith
 On Tue, 2009-07-14 at 03:01 -0700, Michael Vanier wrote:
  Haskell is a wonderful language (my favorite language by far) but it is
  pretty difficult for a beginner.  In fact, it is pretty difficult for
  anyone to learn in my experience, because it has so many advanced
  concepts that simply don't exist in other languages, and trying to
  absorb them all at once will likely be overwhelming.

Then Duncan said:
 As a contrary data-point, at Oxford we teach functional programming
 (using Haskell) as the first course at the very beginning of the
 computer science degree. I know several other universities also use FP
 and Haskell very early on in their CS courses.

At Imperial College, Haskell's also the first language the undergrads
touch and people seem to like it.

I think it's easy to forget how reassuring it is to be surrounded by
lots of other beginners when one is learning something completely new -
like programming. A lot of people here seem to be suggesting that haskell is
an advanced language for advanced programmers. I think it more likely
that people whose first experience of haskell is online are likely to
come into contact with mostly advanced programmers in here and on
#haskell. This is great, because they can teach us things - but it can
also be off-putting, because they can seem so far beyond us.

Imagine trying to learn basic arithmetic in a university common room
full of category theorists.

Personally, I think that haskell is a great beginners language. Just
don't feel that you have to be able to keep up with all the #haskellers.
It's absolutely fine to not understand what a monad transformer is.

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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Jeremy Shaw
At Tue, 14 Jul 2009 03:01:44 -0700,
Michael Vanier wrote:

 Haskell is a wonderful language (my favorite language by far) but it is 
 pretty difficult for a beginner.  In fact, it is pretty difficult for 
 anyone to learn in my experience, because it has so many advanced 
 concepts that simply don't exist in other languages, and trying to 
 absorb them all at once will likely be overwhelming.

I think that all programming languages are hard to learn, because it
involves a new way of thinking.

It maybe be that Haskell is harder to learn as your *second* language
because you have to unlearn things. Especially if your first language
was something like C or Python.

Additionally, I suspect people forget how hard it was to learn their
first language. They get used to the idea that if they know Python,
they can learn Ruby with out to much difficulty. But that is only
because Python and Ruby share a lot in common. When moving from Python
to Haskell, there is simply more to learn (and unlearn). But, if you
start by knowing nothing, then it is not clear that you have to learn
more to learn Haskell than you would some other language.

Also, Haskell may be easier to learn because it's concepts are more
'pricipled' and 'sensible'. Imperative languages tend to allow all
sorts of silly errors. For example, letting you use unitialized
variables (nearly impossible to do in Haskell). And automatic type
casting has burned me so many times. (Especially automatic conversion
between floating ponit numbers and integers.) I seldom get off-by-one
errors in Haskell, but I do get them in imperative/OOP languages.

I suspect that if you don't know any language and want to become a
Haskell expert as quickly as possible, then the quickest, straigtest
path is to start with Haskell.

Also, it depends on what you mean by 'learn' and 'Haskell'. Just as a
beginning C++ programmer is not going to learn about templates on day
one, a beginner Haskell programmer probably won't be learning type
families on day one.

Additionally, Haskell includes numerous libraries which are not part
of the language itself. Things like parser combinators, pretty
printing, applicative functors, etc, are all just libraries. But each
of those libraries brings a bunch of new concepts. 

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


[Haskell-cafe] Re: Goldman Sachs - your home for OCaml and Erlang?

2009-07-14 Thread Ahn, Ki Yung

Max Cantor wrote:
I know that this is a bit off topic, but thought it would interest 
several readers.  Apparently, GS, which. AFAIK, doesn't make a lot of 
noise in the FP space compared to some other banks, does use some FP:


http://www.zerohedge.com/article/aleynikov-code-dump-uncovered


The link you gave seems controversial.  But there is a more relative 
product based on OCaml that GS actually uses (or have used): 
http://www.lexifi.com/press_2002-09-02.html


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


[Haskell-cafe] Re: Haskell as a first language?

2009-07-14 Thread Ahn, Ki Yung
Before teaching any data structure course, one MUST learn functional 
languages with ADTs.  It makes everything so easy to understand.  So, it 
MUST be a first language in every institution.


The biggest reason that one should learn functional languages with 
algebraic data type(ADT)s first is because understanding recursive 
definitions.  If you recursion first, understanding iteration and 
mutable data structures are dead simple and easy: they are just 
alternate representation or optimization.


However, when you learn while loops and for loops first, your brain gets 
damaged and a lot of students gets stuck when they first see the Tower 
of Hanoi, the notorious in-place quicksort routine written in imperative 
languages, you'll get to think of recursion as some stack blowing up 
monster that must be unrolled and managed manually.  Furthermore, 
learning data structures in most traditional imperative language 
literature gives you the impression that linked list and binary trees 
are brain-fucking spaghetti monsters of memory pointers all the cells, 
which is a dead simple recursive definition in functional languages with 
ADTs.


Personally, I never really understood what linked list was before I 
learned ML and Haskell, although I've used doubly linked list in a C++ 
standard library, which was to me a black box that meets the 
specification in some huge standard document, for two years.


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


Re: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Matthias Görgens
 It maybe be that Haskell is harder to learn as your *second* language
 because you have to unlearn things. Especially if your first language
 was something like C or Python.

Python is not too bad.  You can nearly use it a as a strict functional
programming language.  While this is not the idiomatic style to use
python in, it sure eases transition to a real functional language
(compared to say, C).  Also Python has no pointers, but does have
garbage collection.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Ky
Hello,

Is it possible to create a circular pure data structure in Haskell?  For
example:

a :: Data

let b = getNext a
let c = getNext b

c == a -- Gives True

Thanks,

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


[Haskell-cafe] Build 32-bit apps on 64-bit Windows?

2009-07-14 Thread Lyle Kopnicky
If I am running GHC on 64-bit Windows, do I have a choice of building a
32-bit or 64-bit app? On a cursory glance through the command-line options,
I didn't find anything.

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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Brandon S. Allbery KF8NH

On Jul 14, 2009, at 18:27 , John Ky wrote:
Is it possible to create a circular pure data structure in Haskell?   
For example:



http://haskell.org/haskellwiki/Tying_the_knot

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




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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Ross Mellgren

Yes, using lazy semantics.

http://www.haskell.org/haskellwiki/Tying_the_Knot

-Ross

On Jul 14, 2009, at 6:27 PM, John Ky wrote:


Hello,

Is it possible to create a circular pure data structure in Haskell?   
For example:


a :: Data

let b = getNext a
let c = getNext b

c == a -- Gives True

Thanks,

-John

___
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] Circular pure data structures?

2009-07-14 Thread Felipe Lessa
On Wed, Jul 15, 2009 at 08:27:04AM +1000, John Ky wrote:
 a :: Data

 let b = getNext a
 let c = getNext b

 c == a -- Gives True

What do you mean? This works

type Data = ()
getNext = id

but I guess this is not what you meant ;).

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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Dorsey
John,

 Is it possible to create a circular pure data structure in Haskell?  For
 example:

Creating the data structure is easy; as other respondents have pointed out.
A simple example is this...

ones  = 1 : ones
ones' = 1 : ones'

Comparing these values is harder.  All of (ones), (ones'), (tail ones), and
so forth are equal values.  But I don't know how to compare them.  My
Spidey-sense tells me there's probably a simple proof that you can't, if you
care about the comparison terminating.

Pointer equality (ie. testing if the values are represented by the same
bits in memory) is no good, since it's entirely up to the compiler whether
ones and ones' use the same bits.  (They won't, but that's not important.)
In general pointer equality of Haskell values, such as ones and (tail
ones) interferes with referential transparency, which is held in high
regard around here.  Although, for the record, when pointer equality is
really what you want, I'm sure there's ways to Force It.

For your purposes, does it matter if you can actually do the comparison?  Is
it enough to know that ones and (tail ones) are equal?

Regards,
John

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


Re: [Haskell-cafe] How to Read this?

2009-07-14 Thread Gwern Branwen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Tue, Jul 14, 2009 at 1:49 AM, Magicloud Magiclouds wrote:
 Hi,
  I have a data structure, which shows like this: AttrBgColor {bgColor
 = Color 0 0 0}
  And the following is my Read code. But it failed parsing
  31 instance Read Attribute where
  32   readsPrec _ str = [ (mkAttr attr_ color, rest) | (attr_, rest1)   33
   , (color, rest)
   34
   || (isPrefixOf  {fgColor =  rest1)
  35
   then case reads $ drop 12 rest1 of
  36
  [(color_, rest_)] - [(color_, rest_)]
  37
  _ - [(Color 0 0 0, rest1)]
  38
   else [(Color 0 0 0, rest1)] ]
  39 where mkAttr AttrFgColor color = AttrFgColor color
  40   mkAttr AttrBgColor color = AttrBgColor color
  41   mkAttr AttrInverse _ = AttrInverse
  42   mkAttr AttrWeak _ = AttrWeak
  43   mkAttr AttrUnderline _ = AttrUnderline

Perhaps I am mis-understanding you, but why aren't you just deriving
Read  Show?
eg. data AttrBgColor = AttrBgColor { bgColor :: Color Int Int Int }
deriving (Read, Show)

It would certainly seem to be much easier and more reliable than
hand-rolling an ad hoc parser.

- --
gwern
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREKAAYFAkpdJS8ACgkQvpDo5Pfl1oI/1QCfUgfHVsD/PMmgS6Z1sMMPljWt
zOkAn0hQ3GBLFxHCO6ryoYyvPZ+nDJdp
=qR5d
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] laziness blowup exercise

2009-07-14 Thread Thomas Hartman
Challenge: change one function in the following pipeline so that t
doesn't blow up when executed in ghci.

import qualified Data.Set as S
t = last . take (10^6) . iterate f $ S.empty
f s = S.delete 1 . S.insert 1 $ s

Please suggest more of these types of exercises if you have them and
maybe we can collect the folk wisdom into a wiki page and/or exercise
page for beginners.

spoiler for the above problem below :)

































































myiterate f x =
  let nxt = f x
  in nxt `seq` x : myiterate f nxt
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: iteratee enumHandle (and parsing)

2009-07-14 Thread John Lato
Hello,

This explanation is entirely correct.  I'm not happy with this
situation, because I think it's confusing for people just starting
with iteratee.  However, I do want something that will be unicode (and
other possible encodings) aware.

Currently, I'm waiting to see how unicode support in the base
libraries works out.  What seems the best possibility at this time is
writing codecs that could be used with mapStream or convStream to
handle this appropriately, but I'd prefer to re-use core unicode
support if possible.  I'm open to suggestions on this issue.  At the
very least, I should probably include the ASCII encoding in the
iteratee package.

I'd like to make the common case of reading ASCII text easier than it
currently is.  Until then, one approach is using mapStream as
suggested below.  Another is using a wrapped ByteString instead of the
List chunk.  The ByteString chunk forces the element to be an 8-bit
ASCII character instead of using the Char storable instance.  If the
full polymorphism of the List chunk is required, the conversion can be
done with either mapStream or convStream.  convStream is probably more
efficient for this at the moment.

Regarding using Parsec with iteratees: unfortunately I don't really do
much in the way of parsing myself so I'm not much help here.  I think
that Oleg intended for parsers to be written directly using the
iteratee primitives, in particular the heads function would be
useful (at least he found it so).  I don't see an efficient way to
generate a continuation on a partial parse with Parsec, using
iteratees or not.  I think you could just load data into a parser with
setInput, but if you don't have enough data for a complete parse
you'll just need to hold onto all the data until you've loaded enough
to run it.

If you tell me what functions you find lacking from iteratee, I'll
look into implementing them.  I'd rather not re-implement all of
Parsec, but the text parsers should be simple enough, as well as some
of the combinators.

Cheers,
John Lato

 From: Echo Nolan hell...@comcast.net

 Hi Paolino.

 What's happening is reading [Char] uses the Storable instance for Char
 which is 32-bit. Thus, you get gibberish. The below does what you want,
 by reading Word8s and converting them.

 import Control.Exception
 import Data.Char
 import Data.Iteratee.IO
 import Data.Iteratee.Base
 import Data.Word
 import System.IO

 main :: IO ()
 main = do
        h - openFile mamma23 ReadWriteMode
        hPutStr h ciao
        hSeek h AbsoluteSeek 0
        l - enumHandle h readString = run
        print $ assert (l == ciao) ()

 -- This is declared on its own so I can give a type signature without making
 -- any of the above lines unmanageably long.
 readString :: IterateeG [] Word8 IO String
 readString = joinI $ mapStream (chr . fromIntegral) stream2list

 This only works for ASCII, of course. Someone should write some
 enumerators for the other encodings.

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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread wren ng thornton

John Dorsey wrote:

John,


Is it possible to create a circular pure data structure in Haskell?  For
example:


Creating the data structure is easy; as other respondents have pointed out.
A simple example is this...

ones  = 1 : ones
ones' = 1 : ones'

Comparing these values is harder.  All of (ones), (ones'), (tail ones), and
so forth are equal values.  But I don't know how to compare them.  My
Spidey-sense tells me there's probably a simple proof that you can't, if you
care about the comparison terminating.


That depends on what you mean by proof or comparison. Usually large 
proofs are constructed by induction (breaking the problem apart bit by 
bit), but that only works for arbitrarily large but nevertheless finite 
problems. If you try induction on a (possibly) infinite structure you'll 
get a (possibly) non-terminating proof/program.


Instead, for infinite structures we must use coinduction to reason 
about them. In a sense, this changes the definition of proof from yes 
this is the case into yes this is the case as far as you know, since 
in finite time we can only look at a finite portion of any structure 
(and conversely, differences that we can't/don't observe don't 
matter). Often this results in semidecidable properties from the 
inductive world becoming co-semidecidable in the coinductive world (if 
two infinite streams are unequal this can be discovered in finite time, 
but discovering that they are equal is trickier).


--
Live well,
~wren
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: AC-Vector, AC-Colour and AC-EasyRaster-GTK

2009-07-14 Thread Richard O'Keefe


On Jul 10, 2009, at 8:44 PM, Wolfgang Jeltsch wrote:


Am Freitag, 10. Juli 2009 05:26 schrieb rocon...@theorem.ca:
I find it amazing that you independently chose to spell colour with  
a `u'.

It makes me feel better about my choice.


I have to admit that it makes me unhappy. :-(

Why do we use English for identifiers? Because English is the  
language of
computer science. What English should we use? It’s tempting to say,  
we should
use the original English, which is British English. But we should  
ask again

what is the language of computer science. And the language of computer
science is American English.


It was possible to adopt such an attitude in the 20th century.
But this is the 21st century.  We have globalisation,
internationalisation, localisation.  We have Unicode, so that
people are no longer limited to the set of characters that
technicians from the USA found tolerable back in 1967.  (Note
that Americans includes French Canadians and lost of people
who mainly speak Spanish.)

Let's face it, by this argument we'd have to abandon the
metric system when writing computer programs.

There are good reasons to adopt American speling for a term
or English spelling.  They include the language that the
author is most familiar with, the language the paying
customers are most familiar with, the language of the laws
that the program has to conform to, any number of things.

But there is a way above this issue.

Why can't we have BOTH Colour AND Color?

What changes, if any, would it take for Haskell to
support bidialectal naming practices (whether it is English
-vs- American, insular/Brazilian Portuguese, Norwegian,
Arabic dialects, or whatever)?

We can create an alias for a type easily enough.
We can create an alias for a defined function easily enough.
We cannot create an alias for a constructor; there is no way
to say
data X = A | B Int
constructor C = B
so that C can be used for pattern matching just like B.
We cannot create an alias for a module name; while we
can create a module that re-exports everything from some
module, there is no way to make them act the same as far
as inheritance of dotted names is concerned.

SML has similar limitations, but not quite the same.
It lets us create alias for types and defined functions.
It also lets us create aliases for modules, its structures
and functors (more or less).  But even SML doesn't allow
the definition of aliases for constructors.








To my knowledge, most early developments in computer science had  
their roots
in the US. One consequence of this is that reserved words of  
programming

languages are typically in American English. PASCAL uses “program”,
not “programme”, and BASIC uses “COLOR”, not “COLOUR”. So, in my  
opinion,
Haskell color packages should use the identifier Color, not Colour.  
By the

way, I also write my papers and documentation in American English.

Best wishes,
Wolfgang
(who is neither British nor American)
___
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] Leaner Haskell.org frontpage

2009-07-14 Thread Richard O'Keefe


On Jul 10, 2009, at 6:14 PM, Thomas Davie wrote:
In my mind, the front page is for nothing more than enticing people  
to use Haskell for long enough to look at a second page where all  
the useful stuff is if you are a haskell programmer.


I would have thought that a web page should serve its
most frequent visitors best.  By all means have an enticing
paragraph at the top, pointing to a second page, but why
make life hard for regular Haskellers visiting their site?


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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Ky
Hello,

Actually, I wanted to be able to create a tree structure when I can navigate
both leaf-ward and root-ward.  I didn't actually care for equality.

I think the tying the knot technique as mentioned by others is sufficient
for this purpose.

Cheers,

-John

On Wed, Jul 15, 2009 at 8:55 AM, John Dorsey hask...@colquitt.org wrote:

 John,

  Is it possible to create a circular pure data structure in Haskell?  For
  example:

 Creating the data structure is easy; as other respondents have pointed out.
 A simple example is this...

 ones  = 1 : ones
 ones' = 1 : ones'

 Comparing these values is harder.  All of (ones), (ones'), (tail ones), and
 so forth are equal values.  But I don't know how to compare them.  My
 Spidey-sense tells me there's probably a simple proof that you can't, if
 you
 care about the comparison terminating.

 Pointer equality (ie. testing if the values are represented by the same
 bits in memory) is no good, since it's entirely up to the compiler whether
 ones and ones' use the same bits.  (They won't, but that's not important.)
 In general pointer equality of Haskell values, such as ones and (tail
 ones) interferes with referential transparency, which is held in high
 regard around here.  Although, for the record, when pointer equality is
 really what you want, I'm sure there's ways to Force It.

 For your purposes, does it matter if you can actually do the comparison?
  Is
 it enough to know that ones and (tail ones) are equal?

 Regards,
 John

 ___
 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] Circular pure data structures?

2009-07-14 Thread Miguel Mitrofanov

Sufficient, but not good.

Try zippers instead.

On 15 Jul 2009, at 08:29, John Ky wrote:


Hello,

Actually, I wanted to be able to create a tree structure when I can  
navigate both leaf-ward and root-ward.  I didn't actually care for  
equality.


I think the tying the knot technique as mentioned by others is  
sufficient for this purpose.


Cheers,

-John

On Wed, Jul 15, 2009 at 8:55 AM, John Dorsey hask...@colquitt.org  
wrote:

John,

 Is it possible to create a circular pure data structure in  
Haskell?  For

 example:

Creating the data structure is easy; as other respondents have  
pointed out.

A simple example is this...

ones  = 1 : ones
ones' = 1 : ones'

Comparing these values is harder.  All of (ones), (ones'), (tail  
ones), and

so forth are equal values.  But I don't know how to compare them.  My
Spidey-sense tells me there's probably a simple proof that you  
can't, if you

care about the comparison terminating.

Pointer equality (ie. testing if the values are represented by the  
same
bits in memory) is no good, since it's entirely up to the compiler  
whether
ones and ones' use the same bits.  (They won't, but that's not  
important.)
In general pointer equality of Haskell values, such as ones and  
(tail

ones) interferes with referential transparency, which is held in high
regard around here.  Although, for the record, when pointer equality  
is

really what you want, I'm sure there's ways to Force It.

For your purposes, does it matter if you can actually do the  
comparison?  Is

it enough to know that ones and (tail ones) are equal?

Regards,
John

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

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


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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread John Ky
Hello,

If I use zippers, do all my nodes need to be the same type?  My tree doesn't
have the same type for every node.  For example:

Modules - Module - Types - Type - Members - Member - Type - ...

Thanks

-John

On Wed, Jul 15, 2009 at 2:41 PM, Miguel Mitrofanov miguelim...@yandex.ruwrote:

 Sufficient, but not good.

 Try zippers instead.


 On 15 Jul 2009, at 08:29, John Ky wrote:

  Hello,

 Actually, I wanted to be able to create a tree structure when I can
 navigate both leaf-ward and root-ward.  I didn't actually care for equality.

 I think the tying the knot technique as mentioned by others is sufficient
 for this purpose.

 Cheers,

 -John

 On Wed, Jul 15, 2009 at 8:55 AM, John Dorsey hask...@colquitt.org
 wrote:
 John,

  Is it possible to create a circular pure data structure in Haskell?  For
  example:

 Creating the data structure is easy; as other respondents have pointed
 out.
 A simple example is this...

 ones  = 1 : ones
 ones' = 1 : ones'

 Comparing these values is harder.  All of (ones), (ones'), (tail ones),
 and
 so forth are equal values.  But I don't know how to compare them.  My
 Spidey-sense tells me there's probably a simple proof that you can't, if
 you
 care about the comparison terminating.

 Pointer equality (ie. testing if the values are represented by the same
 bits in memory) is no good, since it's entirely up to the compiler whether
 ones and ones' use the same bits.  (They won't, but that's not important.)
 In general pointer equality of Haskell values, such as ones and (tail
 ones) interferes with referential transparency, which is held in high
 regard around here.  Although, for the record, when pointer equality is
 really what you want, I'm sure there's ways to Force It.

 For your purposes, does it matter if you can actually do the comparison?
  Is
 it enough to know that ones and (tail ones) are equal?

 Regards,
 John

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

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



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


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Eugene Kirpichov
Zippers come up as the derivative of the type; if you haven't yet
encountered this trick, then first find it :)

Try differentiating your datastructure.

2009/7/15 John Ky newho...@gmail.com:
 Hello,

 If I use zippers, do all my nodes need to be the same type?  My tree doesn't
 have the same type for every node.  For example:

 Modules - Module - Types - Type - Members - Member - Type - ...

 Thanks

 -John

 On Wed, Jul 15, 2009 at 2:41 PM, Miguel Mitrofanov miguelim...@yandex.ru
 wrote:

 Sufficient, but not good.

 Try zippers instead.

 On 15 Jul 2009, at 08:29, John Ky wrote:

 Hello,

 Actually, I wanted to be able to create a tree structure when I can
 navigate both leaf-ward and root-ward.  I didn't actually care for equality.

 I think the tying the knot technique as mentioned by others is sufficient
 for this purpose.

 Cheers,

 -John

 On Wed, Jul 15, 2009 at 8:55 AM, John Dorsey hask...@colquitt.org
 wrote:
 John,

  Is it possible to create a circular pure data structure in Haskell?
   For
  example:

 Creating the data structure is easy; as other respondents have pointed
 out.
 A simple example is this...

 ones  = 1 : ones
 ones' = 1 : ones'

 Comparing these values is harder.  All of (ones), (ones'), (tail ones),
 and
 so forth are equal values.  But I don't know how to compare them.  My
 Spidey-sense tells me there's probably a simple proof that you can't, if
 you
 care about the comparison terminating.

 Pointer equality (ie. testing if the values are represented by the same
 bits in memory) is no good, since it's entirely up to the compiler
 whether
 ones and ones' use the same bits.  (They won't, but that's not
 important.)
 In general pointer equality of Haskell values, such as ones and (tail
 ones) interferes with referential transparency, which is held in high
 regard around here.  Although, for the record, when pointer equality is
 really what you want, I'm sure there's ways to Force It.

 For your purposes, does it matter if you can actually do the comparison?
  Is
 it enough to know that ones and (tail ones) are equal?

 Regards,
 John

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

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



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





-- 
Eugene Kirpichov
Web IR developer, market.yandex.ru
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Antoine Latter
On Wed, Jul 15, 2009 at 12:13 AM, Eugene Kirpichovekirpic...@gmail.com wrote:
 Zippers come up as the derivative of the type; if you haven't yet
 encountered this trick, then first find it :)

 Try differentiating your datastructure.


Here's a paper with a good introduction to the concept and bibliography:

http://strictlypositive.org/dfordata.pdf

My take on it:

A zipper is the one-hole-context of your data-type plus a focused-on
payload. Data-structure differentiation is the method for deriving the
one-hole-context.

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


[Haskell-cafe] Re: [Haskell] Re: 20 years ago

2009-07-14 Thread Benjamin L . Russell
On Tue, 14 Jul 2009 12:36:02 +0200, Ketil Malde ke...@malde.org
wrote:


[redirected from hask...@]

Benjamin L.Russell dekudekup...@yahoo.com writes:

 One often amusing outgrowth of this is that FP (OOP) fanatics 
 anthropomorphize
 their functions (objects).

Well, I don't think we do.

Functions are just mappings of values to values, they may be opaque,
but they're predictable, unchanging, and just...too boring to be
antropomorphized.

Objects contain all kinds of hidden state and dependencies, and the
sheer unpredicatability of it all is the reason for the
anthropomorphics - it a symptom of a disease, not a desirable
quality. 

Although I don't necessary agree with your choice of the term, I find
it interesting that you should use the biological term disease;
according to a post [1] entitled Re: Re: Smalltalk Data Structures
and Algorithms, by K. K. Subramaniam, dated Mon, 29 Jun 2009
11:25:34 +0530, on the squeak-beginners mailing list (see
http://lists.squeakfoundation.org/pipermail/beginners/2009-June/006270.html),
Concepts in Squeak [a dialect and implementation of Smalltalk] have
their origins 
in biology rather than in computational math See the reading list at
http://www.squeakland.org/resources/books/readingList.jsp
particularly The Selfish Gene by Richard Dawkins.

It's an interesting coincidence that you should hit upon the term
disease, which also derives from biology.

It's not just the sheer unpredictability of it all that is the
reason for the anthropomorphics; it is the fundamental difference of
the basis in biology vs. computational mathematics.  Haskell (and FP)
derive from the latter; Smalltalk (and OOP) derive from the former.

Biological structures also contain all kinds of hidden state and
dependencies; in that sense, objects are similar to biological
structures, and are more easily anthromorphized on that account.
Functional programming functions, on the other hand, are not similar
to biological structures, and hence are not easily anthromorphized;
instead, they are similar to mathematical functions.

I wouldn't necessarily say that anthromorphics ... [is] a symptom of
a disease, though.  Anthromorphics simply uses terms from biology,
from which concepts in Squeak (and the OO paradigm thereof) derive.
The closest counterpart for Haskell that I can think of is the puzzle
game Alligator Eggs! [2] (see http://worrydream.com/AlligatorEggs/),
by Bret Victor, which draws an analogy between various behaviors of
alligators and operations in the lambda calculus--a collection of
allomorphisms, perhaps?

-- Benjamin L. Russell

[1] Subramaniam, K. K. Re: Re: Smalltalk Data Structures and
Algorithms. The Beginners Archives. Squeak.org. 29 June 2009. 15 July
2009.
http://lists.squeakfoundation.org/pipermail/beginners/2009-June/006270.html.

[2] Victor, Bret. Alligator Eggs! _Bret Victor's website._ Bret
Victor. 11 May 2007. 15 July 2009.
http://worrydream.com/AlligatorEggs/.
-- 
Benjamin L. Russell  /   DekuDekuplex at Yahoo dot com
http://dekudekuplex.wordpress.com/
Translator/Interpreter / Mobile:  +011 81 80-3603-6725
Furuike ya, kawazu tobikomu mizu no oto. 
-- Matsuo Basho^ 

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