Hello,
I am looking for a real world example of a type constructor, that expects
another type constructor as an argument in the context of subtyping,
e.g., one could define
--not Haskell98
data T a b c = F (a b c)
a::T (-) Pt Pt
a = F id
b::T (-) CPt CPt
b = F id
l = [a,b]
Thereby CPt is assumed
A... should be split into A.. and .
I found a compromise: let's make it a lexing error! :-)
At least that agrees with what some Haskell compilers implement. No
current Haskell compiler/interpreter agrees with what the report seems
to say, that is that A... should be lexed as the two tokens
Hi,
But I'm just writing this to let you guys know (surely you know this
already) that anyone from a C/C++/Java/Delphi background is going to
completely misunderstand the meaning of A.anything in Haskell... it's
completely nonintuitive to people with my background.
Surely this is no worse
Haskell has lazy/lifted products and not true products. This feature
is considered by many to be an unfortunate aspect of Haskell. A 2-tuple
is just syntactic sugar for
data Tuple2 a b = Tuple2 a b
Maybe from seeing this, it's clearer why laws such as
x = (fst x,snd x)
do not hold. Neither
Hi,
Haskell to me seems to be a great language with a syntax problem,
and a bad case of too many ways to do the same thing; thus every
programmer does things their own way and it's difficult to grasp
the language by looking at examples.
int fact(int x){int t=1; while(x) t*=x--;}
int
In GHC 6.0.1, using GHCi:
Prelude let x # f = f x
Prelude :t (#)
interactive:1: parse error on input `)'
Prelude :t ( #)
interactive:1: parse error on input `#)'
Prelude :t (# )
interactive:1: parse error on input `)'
Prelude :t ( # )
( # ) :: forall t t1. t1 - (t1 - t) - t
Prelude zipWith (#)
In GHC 6.0.1, using GHCi:
Prelude let x # f = f x
Prelude :t (#)
interactive:1: parse error on input `)'
Prelude :t ( #)
interactive:1: parse error on input `#)'
Prelude :t (# )
interactive:1: parse error on input `)'
Prelude :t ( # )
( # ) :: forall t t1. t1 - (t1 - t) - t
Prelude
When Mark Shields and I tackled this problem we came up with
Object-Oriented Style Overloading for Haskell
http://research.microsoft.com/~simonpj/Papers/oo-haskell/index.htm
It describes an (unimplemented) extension to Haskell, rather than
modelling it in Haskell itself, but you
Peter Gammie writes:
Haskell Report, Sec 3.15.3
Great, that's exactly what I need.
Thanks a lot to all who replied!
Peter
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
The following code illustrates a _generic_ interface to low-level
database code. The left-fold iterator doQuery is completely generic
over any possible iterator -- no matter how many columns the query
returns, what are the types of these columns and what is the type of
the seed (accumulator). The
out of curiosity, is haskell already been used as a specification language ?
i was thinking in a business term, rather than mathematical one. (i.e. one than
normal mortal can read, even with a bit of training ;-)
I.e. one would specifiy a model, an application ( possibly run it on samples),
Note I've replied to haskell-cafe. This post is a bit chatty and low on
solid answers.
On Thu, 25 Sep 2003, Sean L. Palmer wrote:
A... should be split into A.. and .
I found a compromise: let's make it a lexing error! :-)
At least that agrees with what some Haskell compilers implement. No
Brandon Michael Moore wrote:
So I defined a class to model the inheritance relationships
class SubType super sub | sub - super where
upCast :: sub - super
Now I can define a default instance of HasFooMethod:
instance (HasFooMethod super args result,
SubClass super sub) =
13 matches
Mail list logo