pattern-matching extension?

2003-12-05 Thread Abraham Egnor
I've occasionally wanted some sort of equivalent of an instanceOf function in haskell, i.e. one that would let me define a function that could dispatch on the type of its argument as well as the value. One option I've seen for this is "http://okmij.org/ftp/Haskell/class-based-dispatch.lhs";, but t

Re: show function

2003-12-05 Thread jason feingold
see the GHC library Text.Show.Functions for some insight.rui yang <[EMAIL PROTECTED]> wrote: I want to print a function which itself have some functions as it's parameters and will return some functions as the results, and I want to print out the result, does anyone knows how to define the instance

Mathematics of Program Construction

2003-12-05 Thread Jeremy . Gibbons
[We apologize if you receive multiple copies of this announcement.] MPC 2004 7th International Conference on MATHEMATICS OF PROGRAM CONSTRUCTION --- http

FOAL 2004 -- deadline 19.01.2004

2003-12-05 Thread Ralf Laemmel
(* This field has meanwhile seen a number of contributions from the functional programming community. So it is fair to assume that the present announcement is of interest for some subscribers of this list. *) FOAL: Foundations of Aspect-Oriented Languages A one day workshop affiliated w

FOAL 2004 -- deadline 19.01.2004

2003-12-05 Thread Ralf Laemmel
(* This field has meanwhile seen a number of contributions from the functional programming community. So it is fair to assume that the present announcement is of interest for some subscribers of this list. *) FOAL: Foundations of Aspect-Oriented Languages A one day workshop affil

CFP --- FOAL 2004: Foundations of Aspect-Oriented Languages

2003-12-05 Thread Ralf Laemmel
(* This field has meanwhile seen a number of contributions from the functional programming community. So it is fair to assume that the present announcement is of interest for subscribers of this list. *) FOAL: Foundations of Aspect-Oriented Languages A one day workshop affiliated with AO

incompatible signatur syntax within instance definition

2003-12-05 Thread Christian Maeder
Hi, if I try to supply a signatur for the local function "showsl" below, then ghc rejects a constraint (Show a) whereas hugs (and nhc98) needs this constraint. What should be the correct notation? (apart from omitting any signature) Cheers Christian (BTW, I would appreciate if the (instantiat

Re: incompatible signatur syntax within instance definition

2003-12-05 Thread Christian Maeder
I've just noticed that I used ghc with -fglasgow-exts. Without extensions hugs, ghc und nhc98 consistently need the constraint in the type signature (below) showsl :: Show a => List a -> ShowS Switching the extensions on, breaks this code, however (ghc only). Christian I wrote: Hi, if I tr

Re: pattern-matching extension?

2003-12-05 Thread Derek Elkins
On Wed, 03 Dec 2003 15:10:07 -0500 "Abraham Egnor" <[EMAIL PROTECTED]> wrote: > I've occasionally wanted some sort of equivalent of an instanceOf > function in haskell, i.e. one that would let me define a function that > could dispatch on the type of its argument as well as the value. One > optio

Re: pattern-matching extension?

2003-12-05 Thread Bernard James POPE
Abe writes: > The thought occurred to me that it is (intuitively) natural to do this via > extending the pattern-matching facility to include types as well as > literal values, i.e. something like: > > f :: a -> String > f (a :: Int) = "got an int, incremented: "++(show (a+1)) > f (a :: Show q =>