[Haskell-cafe] ICFP Programming Contest 2007

2007-04-25 Thread Johan Jeuring
Want to show off your programming skills? Your favorite programming  
language?

Your best programming tools?

Join the ICFP Programming Contest 2007! The 10th ICFP Programming  
Contest

celebrates a decade of contests. This is one of the world's most
advanced and prestiguous programming contest you can enter. For free!

Book July 20 - 23, 2007. Check out http://www.icfpcontest.org/.

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


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Dougal Stanton

On 25/04/07, Tony Morris [EMAIL PROTECTED] wrote:

In a debate I proposed Excel is a functional language. It was refuted
and I'd like to know what some of you clever Haskellers might think :)


By coincidence I wrote about Excel (and related spreadsheets) as
functional languages just recently [1]. It was prompted by an article
in the BMJ where a spreadsheet cell was accidentally overwritten by
patient data, meaning a small child was given their weight as a drug
quantity, rather than the quantity being calculated from their weight.

[1]: http://brokenhut.livejournal.com/233310.html

Cheers,

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


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Ryan Dickie

On 4/24/07, Tony Morris [EMAIL PROTECTED] wrote:


In a debate I proposed Excel is a functional language. It was refuted
and I'd like to know what some of you clever Haskellers might think :)

My opposition proposed (after some weeding out) that there is a
distinction between Excel, the application, the GUI and Excel, the
language (which we eventually agreed (I think) manifested itself as a
.xls file). Similarly, VB is both a language and a development
environment and referring to VB is a potential ambiguity. I disagree
with this analogy on the grounds that the very definition of Excel
(proposed by Microsoft) makes no distinction. Further, it is impossible
to draw a boundary around one and not the other.

I also pointed to the paper by Simon Peyton-Jones titled, Improving the
world's most popular functional language: user-defined functions in
Excel, which quite clearly refers to Excel as a [popular] functional
language.

The debate started when I referred to the fact that financial
institutions change their functional language from Excel to something
like OCaml or Haskell. Of course, there is no doubting that these
companies can replace their entire use of Excel with a functional
language, which I think is almost enough to fully support my position
(emphasis on almost).


--
Tony Morris
http://tmorris.net/

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




Okay.. Excel consists of some c/c++ code, some visual basic, and some sort
of cell evaluation engine. The c/c++ and vb are definitely not functional.

Is the cell evaluation engine one? I think not. I do not believe what you
can type into those cells does constitute a programming language, or at
least not a turing complete one. As far as i know only simple calculations
can be performed. For example, is there any way to evaluate f(2) = 0, f(x) =
5 without invoking vba (how does vba affect the dynamic?). As far as i
understand you can compose functions by stringing cells together, higher
level functions or values, but the contents of the cells themselves are
heavily restricted.

I am obviously no Excel guru but I believe that if you can prove it a
programming language then you can probably prove that it is a functional
one.

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


[Haskell-cafe] Re: [Haskell] ANN: IOSpec 0.1

2007-04-25 Thread Wouter Swierstra

Hi Twan,


Wouter Swierstra wrote:

Test.IOSpecVersion 1.0

Shouldn't that be 0.1?


You're right of course.

You use Dynamic for the data type in IORefs, this has the  
unfortunate consequence of needing Typeable constraints. You could  
try to use unsafeCoerce instead,

 type Data = ()
 unsafeToData :: a - Data
 unsafeToData = unsafeCoerce
 unsafeFromData :: Data - a
 unsafeFromData = unsafeCoerce

I think this should be just as safe as Dynamic, since internally  
Dynamic uses unsafeCoerce as well. Just steal the details from there.


I'm not entirely happy with the unsafeFromDynamic approach I use at  
the moment. GHC can derive instances of Typeable, so the price you  
have to pay is not too high. The real problem is that Haskell's type  
system is not expressive enough to cleanly describe the type of the  
heap (I know, I could be using HList, but still...).


If you're interested, I also have a dependently typed version of the  
code for IORefs that allows heterogeneous, type-safe, well-scoped  
pointers. I should probably mention that an ulterior motive for this  
work is integrating IO in dependently typed languages such as  
Epigram. It is all, of course, still very much subject to active  
research.


  Wouter




This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

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


[Haskell-cafe] Re: [Haskell] ANN: IOSpec 0.1

2007-04-25 Thread Wouter Swierstra

Hi Isaac,

Moving to Haskell-cafe

How does or might this relate to the typeclass-based Restricted IO  
monad

http://article.gmane.org/gmane.comp.lang.haskell.general/14526
?  RIO's technique has the advantage that multiple capabilities can be
easily combined in one use of the monad - but this manner of using
typeclasses might interfere with how testable it is? (I think that
should be okay...  Also that this is a really neat project -  
incremental

progress on taming Haskell IO in practice!)


Stefan is absolutely right. The RIO, as far as I remember, restricts  
which parts of the IO monad you use. The same could be said for the  
Test.IOSpec modules. However, the Test.IOSpec also give you a pure  
specification of the functions you are using. This is very important  
if you want to trace/debug an execution of you code - you can see how  
the state of your machine changes at every step. There's also a bit  
finer control over how you test your functions: concurrent code is  
parameterised over the scheduler, for instance. Both these aren't  
possible with the RIO approach.



P.S. why
*If you're an ICFP referee, you may want to avoid reading any  
further*


ICFP has a double-blind review process: if I were to submit a paper,  
I should do so anonymously. The idea behind it all is that if the  
reviewers don't know who the author of a paper is, they can't be  
prejudiced. The code I just released is described in a paper  
submitted to ICFP.


All the best,

  Wouter

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

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


[Haskell-cafe] Re: [Haskell] ANN: IOSpec 0.1

2007-04-25 Thread Wouter Swierstra

Hi Stefan,


in the Teletype module, it would probably be better to reflect
IOTeletype operations as:

data Action a = Finish a | Put Char (Action a) | Get (Char -  
Action a)


That way, there is no need to use (unobservable) laziness.


I'm afraid I've lost you. How does this differ from the current  
definition of IOTeletype?


Thanks,

  Wouter


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

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


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Claus Reinke

My opposition proposed (after some weeding out) that there is a
distinction between Excel, the application, the GUI and Excel, the
language (which we eventually agreed (I think) manifested itself as a
.xls file). Similarly, VB is both a language and a development
environment and referring to VB is a potential ambiguity. I disagree
with this analogy on the grounds that the very definition of Excel
(proposed by Microsoft) makes no distinction. Further, it is impossible
to draw a boundary around one and not the other.


without commenting on excel, i believe this separation of development
environment and language is outdated. development environments are
no good unless they are intimately aware of the language and language
designers should keep development environments in mind. language
designs get too complicated if they try to cover issues that are better
handled in the development environment, and such environments are
much easier to create for languages supportive of such efforts.

recent trends in semantics-aware ides highlight one side of the 
association, and of course, there are the ancient lisp and smalltalk,

where the languages not only ease tool development, but trying to
understand smalltalk as a notation only, rather than an image-based
language/environment, is really missing half the point.

claus

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


Re: [Haskell-cafe] Reasoning [was: Tutorial on Haskell]

2007-04-25 Thread Malcolm Wallace
Tim Newsham [EMAIL PROTECTED] wrote:

- What about program proofs?  Are there any systems that tie
  directly into haskell and let you augment your haskell program
  with a proof that can be machine checked?

Programatica.
http://www.csee.ogi.edu/PacSoft/projects/programatica/

You can write properties in the PLogic specification language (in
comments within your program), and have them translated to the Alfa/Agda
theorem prover.  (However, I haven't seen much development activity on
the Programatica project for a couple of years now.)

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


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Neil Mitchell

Hi Tony,

I think Lennart said it best with Excel is a zero-order functional
language - a functional language in which you can't define functions.
Another way of putting that is that it is a functional language, but a
really bad one (from a functional'ness perspective).

Thanks

Neil


On 4/25/07, Tony Morris [EMAIL PROTECTED] wrote:

In a debate I proposed Excel is a functional language. It was refuted
and I'd like to know what some of you clever Haskellers might think :)

My opposition proposed (after some weeding out) that there is a
distinction between Excel, the application, the GUI and Excel, the
language (which we eventually agreed (I think) manifested itself as a
.xls file). Similarly, VB is both a language and a development
environment and referring to VB is a potential ambiguity. I disagree
with this analogy on the grounds that the very definition of Excel
(proposed by Microsoft) makes no distinction. Further, it is impossible
to draw a boundary around one and not the other.

I also pointed to the paper by Simon Peyton-Jones titled, Improving the
world's most popular functional language: user-defined functions in
Excel, which quite clearly refers to Excel as a [popular] functional
language.

The debate started when I referred to the fact that financial
institutions change their functional language from Excel to something
like OCaml or Haskell. Of course, there is no doubting that these
companies can replace their entire use of Excel with a functional
language, which I think is almost enough to fully support my position
(emphasis on almost).


--
Tony Morris
http://tmorris.net/

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


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


[Haskell-cafe] Re: Compilling GHC on Vista

2007-04-25 Thread Simon Marlow
There isn't a solution for the getPermissions issue; the bug is here: 
http://hackage.haskell.org/trac/ghc/ticket/1280.


Monique: can you post the relevant section of config.log from your failed 
configure run?


Cheers,
Simon

Monique Monteiro wrote:

For backward compatibility reasons, I'm using GHC 6.2.2.  So, if there
is already a solution for this issue in the GHC repository, please let
me know how to add it manually.

I don't have problems with ./configure on Windows XP.

On 4/24/07, Tom Schrijvers [EMAIL PROTECTED] wrote:

 I still get the same message even with these instructions.  I guess it
 may be due to some Vista security checking...

Do you still get the same error message in your config.log now? Or a
different one? There is also an error on Vista with checking whether a
file is executable. I don't know whether there's already a solution
for that in the repository?

Tom

 Cheers,

 Monique

 On 4/24/07, Simon Marlow [EMAIL PROTECTED] wrote:
 Tom Schrijvers wrote:
 
  Here's the more complete error message:
 
  configure:3321: checking for C compiler default output file name
  configure:3348: c:/MinGW/bin/gccconftest.c  5
  ld: /mingw/lib/crt2.o: No such file: No such file or directory
  configure:3351: $? = 1
  configure:3389: result:
  configure: failed program was:
  configure:3396: error: C compiler cannot create executables
  See `config.log' for more details.
 
  Do make sure that MingW's bin/ and libexec/gcc/mingw32/3.4.2/ are 
the
  very first two in your path. I get the same error message if I 
don't do

  that.

 Hi Tom - would you mind adding the right incantation to the Vista
 instructions
 at the top of 
http://hackage.haskell.org/trac/ghc/wiki/Building/Windows?


 Cheers,
Simon



 --
 __
 Monique Monteiro, MSc
 MCP .NET Framework 2.0 / SCJP / IBM OOAD
 Project Manager
 Recife Microsoft Innovation Center
 +55 81 34198137
 http://www.cin.ufpe.br/~mlbm
 http://thespoke.net/blogs/moniquelouise/default.aspx
 [EMAIL PROTECTED]
 MSN: [EMAIL PROTECTED]
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


--
Tom Schrijvers

Department of Computer Science
K.U. Leuven
Celestijnenlaan 200A
B-3001 Heverlee
Belgium

tel: +32 16 327544
e-mail: [EMAIL PROTECTED]






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


[Haskell-cafe] Re: Compilling GHC on Vista

2007-04-25 Thread Monique Monteiro

Here is the complete message in config.log:

gcc version 3.4.2 (mingw-special)
configure:3288: $? = 0
configure:3295: c:/MinGW/bin/gcc -V 5
gcc.exe: `-V' option must have argument
configure:3298: $? = 1
configure:3321: checking for C compiler default output file name
configure:3348: c:/MinGW/bin/gccconftest.c  5
ld: /mingw/lib/crt2.o: No such file: No such file or directory
configure:3351: $? = 1
configure:3389: result:
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME 
| #define PACKAGE_TARNAME 
| #define PACKAGE_VERSION 
| #define PACKAGE_STRING 
| #define PACKAGE_BUGREPORT 
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3396: error: C compiler cannot create executables
See `config.log' for more details.

Cheers,

Monique

On 4/25/07, Simon Marlow [EMAIL PROTECTED] wrote:

There isn't a solution for the getPermissions issue; the bug is here:
http://hackage.haskell.org/trac/ghc/ticket/1280.

Monique: can you post the relevant section of config.log from your failed
configure run?

Cheers,
   Simon

Monique Monteiro wrote:
 For backward compatibility reasons, I'm using GHC 6.2.2.  So, if there
 is already a solution for this issue in the GHC repository, please let
 me know how to add it manually.

 I don't have problems with ./configure on Windows XP.

 On 4/24/07, Tom Schrijvers [EMAIL PROTECTED] wrote:
  I still get the same message even with these instructions.  I guess it
  may be due to some Vista security checking...

 Do you still get the same error message in your config.log now? Or a
 different one? There is also an error on Vista with checking whether a
 file is executable. I don't know whether there's already a solution
 for that in the repository?

 Tom

  Cheers,
 
  Monique
 
  On 4/24/07, Simon Marlow [EMAIL PROTECTED] wrote:
  Tom Schrijvers wrote:
  
   Here's the more complete error message:
  
   configure:3321: checking for C compiler default output file name
   configure:3348: c:/MinGW/bin/gccconftest.c  5
   ld: /mingw/lib/crt2.o: No such file: No such file or directory
   configure:3351: $? = 1
   configure:3389: result:
   configure: failed program was:
   configure:3396: error: C compiler cannot create executables
   See `config.log' for more details.
  
   Do make sure that MingW's bin/ and libexec/gcc/mingw32/3.4.2/ are
 the
   very first two in your path. I get the same error message if I
 don't do
   that.
 
  Hi Tom - would you mind adding the right incantation to the Vista
  instructions
  at the top of
 http://hackage.haskell.org/trac/ghc/wiki/Building/Windows?
 
  Cheers,
 Simon
 
 
 
  --
  __
  Monique Monteiro, MSc
  MCP .NET Framework 2.0 / SCJP / IBM OOAD
  Project Manager
  Recife Microsoft Innovation Center
  +55 81 34198137
  http://www.cin.ufpe.br/~mlbm
  http://thespoke.net/blogs/moniquelouise/default.aspx
  [EMAIL PROTECTED]
  MSN: [EMAIL PROTECTED]
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 

 --
 Tom Schrijvers

 Department of Computer Science
 K.U. Leuven
 Celestijnenlaan 200A
 B-3001 Heverlee
 Belgium

 tel: +32 16 327544
 e-mail: [EMAIL PROTECTED]








--
__
Monique Monteiro, MSc
MCP .NET Framework 2.0 / SCJP / IBM OOAD
Project Manager
Recife Microsoft Innovation Center
+55 81 34198137
http://www.cin.ufpe.br/~mlbm
http://thespoke.net/blogs/moniquelouise/default.aspx
[EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Marc Weber
Is the cell evaluation engine one? I think not. I do not believe what
you can type into those cells does constitute a programming language,
or at least not a turing complete one. As far as i know only simple
calculations can be performed. For example, is there any way to
evaluate f(2) = 0, f(x) = 5 
Sure. Should not be hard using 5 - 5 * (1-abs(sign(2-x)))
I admit that I didn't test it using Excel but oocalc.
Or is this VBA?
You are right. I get your intention ;)

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


[Haskell-cafe] Re: HXT namespace problem

2007-04-25 Thread Martin Huschenbett

Tim Walkenhorst schrieb:



  runX $ constA (request TableListRequest)  root [] [writeA] 
writeDocument [(a_indent,v_1)] -


writeDocument [(a_indent,v_1), (a_check_namespaces, v_1)] -

should do the trick.


a_check_namespaces unfortunately didn't do the trick. But using 
uniqueNamespacesFromDeclAndQNames *before* constructing the root helped. 
But this was not very well documented.


However, thanks for your help.

Regards,
  Martin.

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


Re: [Haskell-cafe] Re: release plans

2007-04-25 Thread Bulat Ziganshin
Hello Simon,

Tuesday, April 17, 2007, 11:51:07 AM, you wrote:

 The parallel GC code is currently sitting dormant waiting for me to go back to
 it and figure out why it isn't performing very well.  Basically I saw little 
 or
 no speedup regardless of how many CPUs I threw at it, which suggests that the
 bottleneck might be the memory system.  I tried a few things - prefetching, 
 for
 example - without much success.

Simon, you can investigate influence of memory speed to GC speed by
manipulating memory timings on standard GC. for example, you write
random-memory-access program, measure its slowdown when you change
memory timings, then measure slowdown of GC with the same memory
timing change

another variant - try to increase CPU speed without changing memory
speed. if this don't allow to make GC faster (including parallel GC) -
this means that process is memory-bound



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


Re: [Haskell-cafe] Program optimisation

2007-04-25 Thread Bulat Ziganshin
Hello Andrew,

Friday, April 20, 2007, 10:01:32 PM, you wrote:

 I have *no idea* if this is an appropriate place to put this, but here
 goes...

http://haskell.org/haskellwiki/Library/AltBinary
http://haskell.org/haskellwiki/Modern_array_libraries

last article contains information about slowness of GC with
boxed arrays. also, unboxed arrays of Complex are made via
ForeignArray (starting from 6.6 it has the same speed as UArray)


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


[Haskell-cafe] Programming Languages and Mechanised Mathematics -- deadline extension

2007-04-25 Thread Jacques Carette

[Extended deadline: submissions now due May 2nd, 2007]

Programming Languages for Mechanized Mathematics Workshop

As part of Calculemus 2007
http://www.risc.uni-linz.ac.at/about/conferences/Calculemus2007/
Hagenbergs, Austria
June 29-30, 2007.

The intent of this workshop is to examine more closely the intersection 
between

programming languages and mechanized mathematics systems (MMS). By MMS, we
understand computer algebra systems (CAS), [automated] theorem provers
(TP/ATP), all heading towards the development of fully unified systems (the
MMS), sometimes also called universal mathematical assistant systems 
(MAS) (see

Calculemus 2007
http://www.risc.uni-linz.ac.at/about/conferences/Calculemus2007/).

There are various ways in which these two subjects of /programming 
languages/ and /systems for mathematics/ meet:


  * Many systems for mathematics contain a dedicated programming
language. For instance, most computer algebra systems contain a
dedicated language (and are frequently built in that same
language); some proof assistants (like the Ltac language for Coq)
also have an embedded programming language. Note that in many
instances this language captures only algorithmic content, and
/declarative/ or /representational/ issues are avoided.
  * The /mathematical languages/ of many systems for mathematics are
very close to a functional programming language. For instance the
language of ACL2 is just Lisp, and the language of Coq is very
close to Haskell. But even the mathematical language of the HOL
system can be used as a functional programming language that is
very close to ML and Haskell. On the other hand, these languages
also contain very rich specification capabilities, which are
rarely available in most computation-oriented programming
languages. And even then, many specification languages (B, Z,
Maude, OBJ3, CASL, etc) can still teach MMSes a trick or two
regarding representational power.
  * Conversely, functional programming languages have been getting
more mathematical all the time. For instance, they seem to have
discovered the value of dependent types rather recently. But they
are still not quite ready to 'host' mathematics (the non-success
of docon http://www.haskell.org/docon/ being typical). There are
some promising languages on the horizon (Epigram
http://www.e-pig.org/, Omega
http://web.cecs.pdx.edu/%7Esheard/Omega/index.html) as well as
some hybrid systems (Agda http://agda.sourceforge.net/, Focal
http://focal.inria.fr/site/index.php), although it is unclear if
they are truly capable of expressing the full range of ideas
present in mathematics.
  * Systems for mathematics are used to prove programs correct. (One
method is to generate correctness conditions from a program that
has been annotated in the style of Hoare logic and then prove
those conditions in a proof assistant.) An interesting question is
what improvements are needed for this both on the side of the
mathematical systems and on the side of the programming languages.

We are interested in all these issues. We hope that a certain synergy will
develop between those issues by having them explored in parallel.

These issues have a very colourful history. Many programming language
innovations first appeared in either CASes or Proof Assistants, before
migrating towards more mainstream languages. One can cite (in no particular
order) type inference, dependent types, generics, term-rewriting, 
first-class

types, first-class expressions, first-class modules, code extraction, and so
on. However, a number of these innovations were never aggressively 
pursued by

system builders, letting them instead be developped (slowly) by programming
language researchers. Some, like type inference and generics have 
flourished.
Others, like first-class types and first-class expressions, are not 
seemingly

being researched by anyone.

We want to critically examine what has worked, and what has not. Why are all
the current ``popular''[1] computer algebra systems untyped? Why are the
(strongly typed) proof assistants so much harder to use than a typical 
CAS? But

also look at question like what forms of polymorphism exists in mathematics?
What forms of dependent types exist in mathematics? How can MMS regain the
upper hand on issues of 'genericity'? What are the biggest barriers to 
using a

more mainstream language as a host language for a CAS or an ATP?

This workshop will accept two kinds of submissions: full research papers as
well as position papers. Research papers should be nore more than 15 
pages in
length, and positions papers no more than 3 pages. Submission will be 
through

_EasyChair_. An informal version of the proceedings will be available at the
workshop, with a more formal version to appear later. We are looking into
having the best papers completed into full papers and published as a special
issue of 

Re[2]: [Haskell-cafe] COM and Haskell

2007-04-25 Thread Bulat Ziganshin
Hello Andrew,

Tuesday, April 24, 2007, 5:03:53 AM, you wrote:

 A core difficulty is the mismatch between the object-oriented type
 system of .NET and Haskell's.  This is something that RubyCLR didn't  
 need to conquer, Ruby already having object-oriented concepts.

Simon Marlow recently wrote paper about handling dynamic exceptions -
for me it seems that he described general system to mimic OOP in Haskell

-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


Re[2]: [Haskell-cafe] faster factorial function via FFI?

2007-04-25 Thread Bulat Ziganshin
Hello Dan,

Tuesday, April 24, 2007, 3:25:39 AM, you wrote:

 Usings Ints everywhere isn't an option, because my final answers are
 definitely Integers -- although I might try using Ints in some places. I

may be memoizing is the right answer?

factorials :: Array Int Integer
factorials = array (0,100) (map factorial [1..n])



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


Re: [Haskell-cafe] Re: Compilling GHC on Vista

2007-04-25 Thread Claus Reinke

gcc version 3.4.2 (mingw-special)
configure:3288: $? = 0
configure:3295: c:/MinGW/bin/gcc -V 5
gcc.exe: `-V' option must have argument
configure:3298: $? = 1
configure:3321: checking for C compiler default output file name
configure:3348: c:/MinGW/bin/gccconftest.c  5
ld: /mingw/lib/crt2.o: No such file: No such file or directory


not sure whether this is relevant, but there is no drive letter in that library 
path.

cygwin doesn't know about /mingw anyway, but if i am in a cmd shell,
it does matter what drive i'm on, as absolute paths without drive letter
will default to the root of that drive:

   D:\c:\mingw\bin\ld \mingw\lib\crt2.o -M | find OUTPUT
   c:\mingw\bin\ld: \mingw\lib\crt2.o: No such file: No such file or directory

   C:\c:\mingw\bin\ld \mingw\lib\crt2.o -M | find OUTPUT
   ..
   OUTPUT(a.exe pei-i386)

claus

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


[Haskell-cafe] Talking to the serial (RS232) port from Haskell

2007-04-25 Thread Dan Piponi

What's the easiest way, from Haskell, to open a serial port (under
Windows, say) with the correct baud rate and parity, and send data
through it? Is there a serial library for Haskell?
--
Dan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Talking to the serial (RS232) port from Haskell

2007-04-25 Thread Marc Weber
On Wed, Apr 25, 2007 at 09:28:37AM -0700, Dan Piponi wrote:
 What's the easiest way, from Haskell, to open a serial port (under
 Windows, say) with the correct baud rate and parity, and send data
 through it? Is there a serial library for Haskell?

Don't know wethere there are some libraries

This is just the way I would go.. I did this long ago on Windows but
there may be better ways now.
Get DevCPP (because it ships with a WinAPI help file)
search for COM or special device or openfile ..
There you might get a reference to the functions you need to set
baudrate etc
In general all you need is opening a file with name COM1 on windows.
I think you don't have to do all the ffi stuff yourself.
There are windows api bindings already.
I'd also recommend http://com0com.sourceforge.net/ .
Perhaps try readFile COM1  and see wether it works.
I'd also recommend http://com0com.sourceforge.net/ .
Then you can use Windows HyperTerminal
to see wether your application produces some output/ send data to your
application to test it.
I hope I didn't tell you too much rubbish from my memory ;)
You can also wait till you get a better response.
I hope I didn't tell you too much rubbish from my memory ;)

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


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Lennart Augustsson
I usually refer to Excel as a zeroth order functional language, i.e.,  
you can't define any functions. :)
(You can define functions if you do it in VBA or in an addin, but  
that's not really Excel, imo.)


-- Lennart

On Apr 25, 2007, at 04:00 , Tony Morris wrote:

In a debate I proposed Excel is a functional language. It was  
refuted

and I'd like to know what some of you clever Haskellers might think :)

My opposition proposed (after some weeding out) that there is a
distinction between Excel, the application, the GUI and Excel, the
language (which we eventually agreed (I think) manifested itself as a
.xls file). Similarly, VB is both a language and a development
environment and referring to VB is a potential ambiguity. I disagree
with this analogy on the grounds that the very definition of Excel
(proposed by Microsoft) makes no distinction. Further, it is  
impossible

to draw a boundary around one and not the other.

I also pointed to the paper by Simon Peyton-Jones titled,  
Improving the

world's most popular functional language: user-defined functions in
Excel, which quite clearly refers to Excel as a [popular] functional
language.

The debate started when I referred to the fact that financial
institutions change their functional language from Excel to something
like OCaml or Haskell. Of course, there is no doubting that these
companies can replace their entire use of Excel with a functional
language, which I think is almost enough to fully support my position
(emphasis on almost).


--
Tony Morris
http://tmorris.net/

___
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] Is Excel a FP language?

2007-04-25 Thread Lennart Augustsson

How about 'IF(x=2,0,5)' ?

On Apr 25, 2007, at 13:48 , Marc Weber wrote:

   Is the cell evaluation engine one? I think not. I do not  
believe what
   you can type into those cells does constitute a programming  
language,
   or at least not a turing complete one. As far as i know only  
simple

   calculations can be performed. For example, is there any way to
   evaluate f(2) = 0, f(x) = 5

Sure. Should not be hard using 5 - 5 * (1-abs(sign(2-x)))
I admit that I didn't test it using Excel but oocalc.
Or is this VBA?
You are right. I get your intention ;)

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


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


[Haskell-cafe] RE: On reflection

2007-04-25 Thread Simon Peyton-Jones
Not only that, but when we have associated type synonyms going it'll be even 
clearer.  Instead of

class CoreProcessSyntax p a x | p - a x where
   zero :: p
   sequence :: a - x - p
   compose :: [p] - p

you'll be able to write

class CoreProcessSyntax p where
   type AThing p :: *
   type XThing p :: *
   zero :: p
   sequence :: AThing p - XThing p - p
   compose :: [p] - p

I'm not sure what the 'a' and 'x' parameters stand for, but they are 
functionally dependent on 'p'; I've called these type functions AThing and 
XThing, but you'll have more meaningful names.  Now the type of 'sequence' is 
much rmore perspicuous.

Simon



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Meredith
Sent: 25 April 2007 04:27
To: [EMAIL PROTECTED]; Simon Peyton-Jones
Cc: haskell-cafe; Matthias Radestock; Matthew Sackman; Tristan Allwood
Subject: On reflection

Oleg, Simon,

Thanks for your help. If i understand it correctly, the code below gives a 
reasonably clean first cut at a demonstration of process calculi as 
polymorphically parametric in the type of name, allowing for an instantiation 
of the type in which the quoted processes play the role of name. This is much, 
much cleaner and easier to read than the OCaml version.

Best wishes,

--greg

{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}

module Core(
Nominal
   ,Name
   ,Locality
   ,Location
   ,CoreProcessSyntax
   ,CoreAgentSyntax
   ,MinimalProcessSyntax
   ,MinimalAgentSyntax
   ,ReflectiveProcessSyntax
--   ,make_process
   )
where

-- What's in a name?

class Nominal n where
   nominate :: i - n i

-- newtype Name i = Nominate i deriving (Eq, Show)
newtype Name i = Name i deriving (Eq, Show)

instance Nominal Name where nominate i = Name i

-- Where are we?

class Locality a where
   locate :: (Eq s, Nominal n) = s - (n i) - a s (n i)
   name :: (Eq s, Nominal n) = a s (n i) - (n i)

-- data Location s n = Locate s n deriving (Eq, Show)
data Location s n = Location s n deriving (Eq, Show)

instance Locality Location where
  locate s n = Location s n
  name (Location s n) = n


-- Constraints

class CoreProcessSyntax p a x | p - a x where
   zero :: p
   sequence :: a - x - p
   compose :: [p] - p

class CoreAgentSyntax x p n | x - p n where
   bind  :: [n] - p - x
   offer :: [n] - p - x

-- Freedom (as in freely generated)

data MinimalProcessSyntax l x =
Null
| Sequence l x
| Composition [MinimalProcessSyntax l x]

data MinimalAgentSyntax n p =
Thunk (() - p)
| Abstraction ([n] - p)
| Concretion [n] p

-- Responsibility : constraining freedom to enjoy order

instance CoreProcessSyntax (MinimalProcessSyntax l x) l x where
zero = Null
sequence l a = Sequence l a
compose [] = zero
compose ps = Composition ps

instance CoreAgentSyntax (MinimalAgentSyntax n p) p n where
bind [] proc = Thunk (\() - proc)
--  -- TODO : lgm : need to substitute m for name in proc
bind (name:names) proc = Abstraction (\m - comp $ bind names proc)
where comp (Thunk fp) = fp ()
  -- comp (Abstraction abs) = abs name
offer names proc = Concretion names proc

data ReflectiveProcessSyntax =
Reflect
(MinimalProcessSyntax
 (Location [(Name ReflectiveProcessSyntax)] (Name ReflectiveProcessSyntax))
 (MinimalAgentSyntax (Name ReflectiveProcessSyntax) 
ReflectiveProcessSyntax))

-- instance (CoreProcessSyntax p a x) =
-- CoreProcessSyntax
-- (MinimalProcessSyntax
--  (Location
--   [(Name (MinimalProcessSyntax a x))]
--   (Name (MinimalProcessSyntax a x)))
--  (MinimalAgentSyntax
--   (Name (MinimalProcessSyntax a x))
--   (MinimalProcessSyntax a x)))
-- (Location
--   [(Name (MinimalProcessSyntax a x))]
--   (Name (MinimalProcessSyntax a x)))
-- (MinimalAgentSyntax
--   (Name (MinimalProcessSyntax a x))
--   (MinimalProcessSyntax a x))

--
L.G. Meredith
Managing Partner
Biosimilarity LLC
505 N 72nd St
Seattle, WA 98103

+1 206.650.3740

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


Re: [Haskell-cafe] Is Excel a FP language?

2007-04-25 Thread Udo Stenzel
Albert Y. C. Lai wrote:
 I say Excel is a functional language. If there needs to be the quoted 
 distinction, fine: Excel the language is a functional language, and 
 Excel the application is an interpreter of said language.

Excel has functions, but does it treat functions as it treats other
data?  I don't think so, and that makes it non-functional
(dys-functional?).  As for VB... that may be functional, in the same
sense as XSLT is: if you step back and squint, it almost looks vaguely
like a functional language.
 
 (Does the opposition self-consistently distinguish Perl the language 
 from perl.exe the interpreter?)

Only perl can parse Perl.  (Yes, they do.)


-Udo
-- 
Science is like sex - sometimes something useful comes out of it, but
that's not what we are doing it for. -- Richard Feynman


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


Re: [Haskell-cafe] How Albus Dumbledore would sell Haskell

2007-04-25 Thread Alexey Rodriguez Yakushev
Since no one mentioned automatic differentiation (AD), I will. I  
think AD is a nice example of using type classes and higher order  
functions to get small and useful code. Maybe this example is not  
ideal for the audience, but anyway, Simon has the last word.


Here is how demo would go:

Define a polynomial with roots at -9, 0 and 9:

 Main let poly x = (x + 9) * x * (x - 9)

check type:

 Main :t poly
 poly :: (Num a) = a - a

then explain type and handwave a bit about the polymorphism 
+overloading and the type.


Check that it works:

 Main poly 2
 -154
 Main poly 9
 0

Aha, it works.

Let's see a graph then (sorry if the email formatting destroys the  
graph):


 Main draw poly
**   |
   *  ***|
 **  *   |
* ** |  *
*|
 --*-***-
 *  | ** *
 |   *  **
 *   |***  *
 |   **

Oh did I mention that 'draw' is a higher order function? (handwavy  
explanation of H.O. functions, bla bla)


 Main :t draw
 draw :: (Double - Double) - IO ()

Now define, first derivative of poly:

 Main let poly' x = d poly x

(Note that x is required because of monomorphism restriction, but I  
wouldn't mention it).


and test it:

 Main draw poly'
 *   |
 *  |  *
   **|**
 *   |   *
  *  |  *
   **|**
 **  |  **
 --**-**-
 |
 *

one can do it once again:

 Main let poly'' x = d poly' x
 Main draw poly''
 |***
 |
 |
 |   *
 
 |
*|
 |
 |
 *** |

The nice thing is that the code for d is very small (unlike the  
drawing code, for example):


 data Dual a = Dual a a
 deriving (Eq,Show)

 instance (Num a) = Num (Dual a) where
 (Dual x y) + (Dual x' y') = Dual (x+x') (y+y')
 (Dual x y) * (Dual x' y') = Dual (x*x') (x*y'+y*x')
 negate (Dual x y) = Dual (negate x) (negate y)
 fromInteger n = Dual (fromInteger n) 0

(omitting some methods here)

Below, d is a H.O. function bla bla


 type Poli = forall a.(Num a) = a - a

 d :: Poli - Poli
 d f x
 = case f (Dual x 1) of
   Dual f_x f'_x - f'_x

end of pseudo-demo

This code is based on a blog post[1] which is in turn based on some  
nice posts by Dan Piponi. It's nothing new, but it's worthwhile to  
stress how easy it is to do this kind of thing in Haskell.


Cheers,

Alexey

[1] http://insomne.pinguinos.org/2006/06/25/derivacion-automatica- 
utilizando-numeros-duales-y-clases-type-classes/


On Apr 19, 2007, at 10:05, Simon Peyton-Jones wrote:

| Simon (aka Dumbledore) is speaking to four different Houses:  
scientists

| (Ravenclaw), engineers (Hufflepuff), entrepreneurs (Slytherin), and
| managers (Griffindor).

I wish I could live up to this image!

Lots of interesting ideas on this thread, and Haskell-Cafe threads  
are *supposed* to wander a bit.  But, just to remind you all: I'm  
particularly interested in


  concrete examples (pref running code) of programs that are
   * small
   * useful
   * demonstrate Haskell's power
   * preferably something that might be a bit
   tricky in another language

I have lots of *general* ideas.  What I'm hoping is that I can  
steal working code for one or two compelling examples, so that I  
can spend my time thinking about how to present it, rather than on  
dreaming up the example and writing the code.


(But don't let me inhibit wider-ranging discussion as well.)

thanks

Simon
___
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] How Albus Dumbledore would sell Haskell

2007-04-25 Thread R Hayes


I don't know how many of the other people on this list are actually  
going to *be* at OSCON.  I will.


I think it is important to think about the kinds of problems the  
audience is trying to solve, as well as the context in which they are  
trying to solve them.  For the most part, the attendees at OSCON work  
on system software: operating systems, operating system services  
(printing, packaging, scheduling, etc), network  distributed  
computing infrastructure, databases, languages, and every imaginable  
variation on the word web.


1) Build a simple database access layer that is immune to SQL  
injection attacks from user input (using the type system to guarantee  
that safety).  Include the FFI portion (FFI is a point of paranoia  
about any new language).  Now the, the audience values the type  
system.


2) Show something appallingly simple, yet blazingly fast.   
Demonstrate that it is blazingly fast.  I would implement wc -l  
using data.Bytestring.lazy and run in over a huge file.  It's a one  
line program and it will run faster than the built in unix command.   
Explain that its fast because of GHCs rewrite rules.  Explain that  
the rewrite rules are only possible because of purity.   Now the, the  
audience values purity.


3) Build a simple combinator framework that supports multiple  
evaluation schemes (like your derivative framework that supported  
both valuation and settlement processes).  For this audience, it  
might be cool to build a simple package system that both installed  
software and later verified the integrity of the installation.   
Although, if you *wanted* to present How to write a financial  
contract I could not object.  Quantitative finance is my business  
and I promise to be in the audience for this.


Also, see if Audrey Tang is going to be present.  If she is, consider  
enlisting her support.  Haskell has *enormous* credibility in the  
Perl 6 community because of PUGS.  I recently had a conversation with  
Jesse Vincent, the Perl 6 program manager.   He said that the  
majority of the Perl 6 community is aware that PUGS (and therefore  
Haskell) are crucial to the success of Perl 6.  Perl has its own  
track at this conference.


reilly hayes


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