Hi,
because Template Haskell is a compile-time metaprogramming language,
there is no metaprogram
left after the first stage. Thus, it does not make sense, conceptually,
to have more than one stage.
In contrast, in MetaOCaml, you can generate code at run time that
generates code at run time
Hi,
Henning Thielemann wrote:
...
The notation
[f x | x - xs]
describes operations on list elements, and looks like the imperative
forall x in xs do f x,
whereas
map f xs
is a list transformation. The second one is more abstract, isn't it?
for that simple example yes, but what's about
Hi,
an experienced person at our lab told me that the classification
into generations has become unfashioned in the last decade;
thus I think I will stay away from using it but argue with
concrete abstraction features.
Concerning the point someone made about the features of Haskell:
* pattern
Hi,
and/or visual programming (Visual Basic,...)
I can only assume you are a) joking
a bit, yes
, or b) not a visual basic user.
also true
While Visual Basic is a much insulted language, I have a soft spot for
it. However, its not a Visual programming language - its a
Hi,
Henning Thielemann wrote:
assembly language (Assembler ist deutsch :-)
for mysterious reasons it entered the English world.
3GLs: programming based on algorithms (C, Java, ...)
4GSs: domain-specific languages (SQL,...)
5GLs: automatic problem solving (Mathematica, Prolog,...)
-
Please accept our apologies if you have received multiple copies.
Please feel free to distribute it to those who might be interested.
-
Hi,
trying to adapt the zipN-example in the paper
Template Meta-programming for Haskell by
Sheard and Peyton Jones to Language.Haskell.THSyntax
I found that quasi-quotation for patterns does not seem
to work with ghci-6.0, e.g., the following results in
Parse error in pattern:
pcons x xs =
Hi,
playing around with partial evaluation,
I encountered the following bug:
65 ghc --make -fglasgow-exts -package haskell-src Main.hs -o Main -ddump-splices
Chasing modules from: Main.hs
Compiling Power( Power.hs, ./Power.o )
Compiling Main ( Main.hs, ./Main.o )
Hi Simon
Simon Yes, this is a known bug,
Sorry that I'm not perfectly aware of everything going
on with Template Haskell.
Simon but thank you for reporting it
Simon anyway. I'm going to fix it as part of my next sweep though.
Thank you very much. I'm happy to know that it is
Apologies if you receive multiple copies of this message.
---
**
******
*** LAST CALL
Apologies if you receive multiple copies of this message.
---
**
******
***SECOND
Dear Haskellers,
many of you are using Haskell as a tool for developing parallel
programs, are working on parallelizing Haskell compilers,
language extensions, or interfaces. If you are involved in
parallel programming, I'd strongly encourage you to submit a
paper to Topic 10 of Euro-Par 2003.
Hi Haskellers,
Simon Any objections?
frankly speaking, yes.
The intellectual meaning of a successor in a non-integral type
is not clear for me. Can anyone explain it?
I observed this report discussion for quite a long time and
maybe have found the deep reason behind the problems. It
Hi GHC users,
I'm looking for secure compile and run-time methods to ensure
automatically that Haskell modules cannot perform particular
IO operations. Therefore, I've got some questions that might
be interesting for other people using GHC as well.
o There are functions like
Hi Pavel,
pavel == pavel [EMAIL PROTECTED] writes:
pavel I'm having a problem with writing a function dealing with
pavel I/O. Maybe it's just a lack of experience or simple Haskell
pavel knowledge because I'm just a beginer. The problem: I want to
pavel write a function that
Hi Pavel,
pavel == pavel [EMAIL PROTECTED] writes:
pavel My task is to write a parser for some language (TSG).
pavel ...
pavel Why should I use that do thing? What is so magical in it?
pavel PS: Please, don't say that I'm stupid, I just have problem
pavel with
Hi Haskellers,
Max == Max Kirillov [EMAIL PROTECTED] writes:
Max So why one might need it? I've never used Rational, but, if
Max asked, I would say that they are for exact representation of
Max numbers (some symbolic calcs).
that's true. I'm using rationals intensively since a
Hi,
JiJie 20) append' x:xs y = [(init x:xs)] ++ [(tail xs)++[y]]
function application (blank) binds stronger than :,
thus you should write
append' (x:xs) y = ...
Cheers
--
Christoph
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
To make it short:
Main let append' xs y = init xs ++ [last xs ++ [y]]
This works for the three given examples but maybe incorrect
for the task you have in mind, e.g., if xs is empty.
Main append' [ [1, 2], [3, 4], [5] ] 6
[[1,2],[3,4],[5,6]]
Main append' [ ['1', '2'], ['3'] ] '4'
[12,34]
Main
Hi,
first of, you should consider whether you really need O(n).
Since you want to use Haskell, your aim is probably more
on elegance than on performance. Maybe, an Theta(n * log n) program
in Haskell would be easier to verify.
Surely, you can program in imperative style in Haskell achieving
Hi,
compiling the example ModuleTest.hs from the
Gtk+HS distribution produces the following
error message:
84 ghc `gtkhs-config --cflags --libs` ModuleTest.hs
ghc-5.02.3: panic! (the `impossible' happened, GHC version 5.02.3):
AbsCStixGen.gencode typedef void ( *_ccall_fun_tys1ku)
Hi,
the following instance declaration doesn't work any
more with ghc-5.02.3, it worked before.
newtype ST state a = ST { unST :: state - (a,state) }
instance Monad (ST c) where
return x = ST (\state - (x,state))
(m = f) = ST (\state - let (x,state1) = unST m state
Hi Haskellers,
Bernard == Bernard James POPE [EMAIL PROTECTED] writes:
Bernard Handling functions is always going to be hard. Actually, a
Bernard related issue in Haskell is what do you do with partially
Bernard evaluated structures? Certainly in some circumstances you
Bernard
Hi Bernard,
Bernard I, and I assume many other Haskell programmers would from
Bernard time to time like a universal print mechanism, something
Bernard that can turn an arbitrary value into a String.
yes, I'm such a Haskell programmer that would like such a mechanism but
it only
Simon == Simon Marlow [EMAIL PROTECTED] writes:
Yes, I see. Would it be possible to have a standard strict list,
i.e. something equivalent of
data SList a = SNil | SCons !a SList
(which could be a member of the same class as the normal lists,
and have the
Hi Haskellers,
personally, I'd prefer to use a kind of labeled fields notation at the
point where the function is called, like:
addBase{?base=7} 5
In recursive calls, this notation would then be optional, of course.
If a function should be called multiple times with the same
value of the
Hal == Hal Daume, Hal writes:
Hal are there any MPI bindings for any version of Haskell (or
Hal related language or any FPL for that matter)?
there's a tool called hMPI:
http://www-i2.informatik.rwth-aachen.de/~michaelw/hmpi.html
Cheers
--
Christoph
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes:
Simon Christoph does not like this
It's OK if the definition is clear; it wasn't using
the words positive or greatest integer.
Stating gcd 0 0 = 0 explicitly is a good thing,
even if it could be expressed verbatim;
people may think
George == George Russell [EMAIL PROTECTED] writes:
George I've reconsidered my earlier position and think now that the
George Prelude is wrong to make gcd 0 0 an error, and should return
George 0. It probably doesn't make much difference to anyone, but
George it's like 1 not
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes:
Simon gcd x y is the greatest POSITIVE integer that divides
Simon both x and y.
Simon I don't think that changes the specification in fact, but
Simon experience has led me to always check these things!
I find it
Hello,
Bryan == Bryan Hayes (Hayes Technologies)
[EMAIL PROTECTED] writes:
Bryan My question is:
Bryan Does Haskell principally not need pointers (i.e. in case of 2
Bryan data structures needing to reference an other very large data
Bryan structure) or is this a design flaw or
Hi Haskellers,
which compiler settings do I have to pass to ghc-5.02
in order to achieve that the strictness analyzer
recognizes strictness of (+) in foldl and computes
sum in constant space?
Prelude sum [1..1000]
had the following effect:
PID USER PRI NI SIZE RSS SHARE STAT %CPU
Hi Haskellers,
assuming that the type class Enum represents enumeration
types, there are two questions for me:
(1) What is the justification for the types Float and Double
to be members of the type class Enum? This might induce students
to use floating point values as counters in
Lennart == Lennart Augustsson [EMAIL PROTECTED] writes:
Lennart Ch. A. Herrmann wrote:
(1) What is the justification for the types Float and Double
to be members of the type class Enum? This might induce
students to use floating point values as counters in arithmetic
Stephanie == Stephanie Randles [EMAIL PROTECTED] writes:
Stephanie Hi, I have a script here
Stephanie interleave :: [Integer] - [Strings] - [String]
Stephanie interleave (x:xs) (y:ys) = words [a | a - (unwords
Stephanie [(show x), (filter (/= 1) y), +])]
Stephanie and the
We have installed ghc-5.02 from source on a Solaris-2.6
machine after a difficult bootstrapping process.
Now, ghc-5.02 works fine but with ghci we get the following
error message:
Loading package std ... linking ...
/public/packages/programming/ghc-5.02/lib/ghc-5.02/HSstd_cbits.o: unknown
Dear Haskellers,
in ghc-5.02/distrib/INSTALL, there is the following hint:
Linux users: GHCi-5.00 needs libreadline.so.3. Newer Linuxes (SuSE
7.1, possibly RH 7.X, possibly Mandrake 8.X) only come with
libreadline.so.4. If you need libreadline.so.3 and only have the .4
version, you might
Julian == Julian Seward (Intl Vendor) [EMAIL PROTECTED] writes:
Julian On possible thing you can do is
Julian * Find a copy of libreadline.so.4 from somewhere (your home
Julian PC ?) * Place it in some dir under your control, eg
Julian /home/herrman/lib * export
Julian
Basically, I like the suggestions, but want to clarify:
* The library focuses on graphical *user interfaces* (ie,
buttons, menus, scrollbars, selection lists, etc) as
opposed to drawing and animation routines.
Many applications where GUIs are used require a canvas/scribble field
with the
Hi Haskellers,
because I recognized that some people are discussing
the Haskell report, I'd like to point out a problem
concerning the operator precedences.
At precedence level 9, there are the left associative
operator (!!) and the right associative operator (.),
but combining both directions
Simon == Simon Peyton-Jones [EMAIL PROTECTED] writes:
Simon You may be right, but the Report is neither confusing nor
Simon inconsistent on this point, I think. So I don't think it
Simon falls into the class of things that we can change for H98.
Simon You'll just have to add
Hi Haskellers,
S == S D Mechveliani S.D.Mechveliani writes:
S I was said that there exists an algebraic library proposal for
S Haskell (version 0.02) dated by February (2001?), by Dylan
S Thurston.
that sounds interesting for me. Sorry, that I don't have an answer to your
Hi Faizan,
"FAIZAN" == FAIZAN RAZA [EMAIL PROTECTED] writes:
FAIZAN Hello Please help me to solve this questions
FAIZAN Question
FAIZAN Cartesian Product of three sets, written as X x Y x Z is
FAIZAN defined as the set of all ordered triples such that the
FAIZAN first
moved to haskell-cafe
Ketil E.g. way back, I wrote a simple differential equation solver.
Ketil Now, the same function *could* have been applied to vector
Ketil functions, except that I'd have to decide on how to implement
Ketil all the "Num" stuff that really didn't fit well.
moved to haskell-cafe
Ketil E.g. way back, I wrote a simple differential equation solver.
Ketil Now, the same function *could* have been applied to vector
Ketil functions, except that I'd have to decide on how to implement
Ketil all the "Num" stuff that really didn't fit well.
Hi,
Jose I am working on an Computer Algebra system to transform
Jose mathematic expressions, possibly simplifing them. There is a
Jose data type to represent the expressions:
Jose data Expr = Int Integer | Cte String | Var String | App Fn [Expr]
Jose An expression may be
"Jan" == Jan Kort [EMAIL PROTECTED] writes:
Jan I can't seem to work around this behaviour, is it possible to
Jan force readFile to just open a file, read it entirely and close
Jan it before doing the next open ? I tried a few things with seq,
Jan but this doesn't work:
I
Hello,
I'm considering for the near future to "hack" with the core language
module of GHC, but I'm not sure whether it's good to use the
current definitions or data structures because things may change
with the new GHC.
Is there an agreement that the data structures used for the
core language
Hi Diego,
"Diego" == Diego Dainese [EMAIL PROTECTED] writes:
Diego - In Haskell is there some way to combine IO and ST?
there is a so-called IOS-Monad combining IO and State, appended below.
Thanks to John O'Donnell who told me about it and gave it to me a few weeks ago.
Cheers
Hello,
does type-checking remain decidable (in general) for overlapping instances
(:+o in hugs)?
--
Christoph
Hello,
"Johannes" == Johannes Waldmann [EMAIL PROTECTED] writes:
Johannes 1) FranTk runs with hugs *and* with ghc (does this hold
Johannes for FAL as well? last I checked it seemed hugs only)
Johannes 2) FranTk has all those fancy input widgets
Johannes Again i want to avoid
Hi Tim,
Tim 6. Applying a function f:t-u to a list x::[t] translates to
Tim "map f x".
the problem is that we loose much of the strength the Haskell type
system provides and a lot of programming errors will remain
undetected.
What you can do is write a preprocessor that provides a
Hi,
very slow. After we made the insert operation in the AVL tree
hyperstrict and a few similar changes, our program behaved very
well and is surely faster than if written in C using naive data
structures and algorithms. We used combinators like strict2 f x
y = strict
Dear Haskellites,
My experience with the program of generating permutations on
[1..10] showed that the code produced by ghc-4.04 is 22 times
slower than certain specially written C program. Only the C
program algorithm was taken very different from Haskell's
one. For
Hi,
Jan Haskell code optimised by strictnes annotions in functions or
Jan in datastructures are ? times slower than C.
Jan Please correct me where I am wrong and fill in the required
Jan number for the ? sign above
I cannot give you a number, but I like to report about some
Hello,
I'm worrying that there are too many constraints put on the definition
of a function's domain. Thus, if you agreed on the domains of take, drop,
etc. and their semantics, please give a definition, say D, of these functions
in terms of the ordinary list constructors. I would consider any
"Hamilton" == Hamilton Richards [EMAIL PROTECTED] writes:
Hamilton How about these definitions? They're like the Haskell98
Hamilton prelude definitions except that n0 is always an error,
Hamilton even if the list is [].
the problem with an unnecessary restriction is that it
Hello,
operators with suitable associations defined). So
my symbolic expression type should be an instance
of the Num class so that the (+) operator can
be overloaded for it. But, as the function has
now three arguments, it cannot be a binary operator
anymore.
maybe, an ad-hoc solution is
I had just a fast look at the following I found at the
page "http://www.cse.ogi.edu/PacSoft/projects/Hugs/hugsman/exts.html"
for dynamic scoping:
min :: [a] - a
min = least with ?cmp = (=)
Actually, I'm not sure how referential transparency can be established
with these implicit
Hi,
"F" == Fergus Henderson [EMAIL PROTECTED] writes:
F Well, it depends a bit on how you look at it. But I would say
F that with normal equational reasoning, you _are_ constrained to
F preserve strictness. To say that a function is strict in an
F argument just means that
Happens also with the solaris binary:
ld: fatal: library -lgmp: not found
ld: fatal: File processing errors. No output written to ...
"S" == S D Mechveliani [EMAIL PROTECTED] writes:
S I have a question for the GHC developers: where it is explained
S the path setting for the gmp
Hello,
I'm sorry cause I didn't recognized that the "strict" function is
still available:
"Ch" == Ch A Herrmann [EMAIL PROTECTED] writes:
Ch What I like to have is a mechanims to force the evaluation of an
Ch expression before passing it as an argument to a
Hi,
I have a problem with the Eval class. Maybe its just that a compiler
flag or import declaration is missing. I compiled with
ghc-4.01/bin/ghc -c -fvia-C -syslib exts
and got the error message:
No instance for `Eval Int'
OK, let's try
instance Eval Int where
seq x y = y
Hello,
Jan Your thought would destroy equational reasoning! For example
Jan you would be able to define different equalties on the same
Jan data structure. So Red==Black could be False in one place
Jan and True in another place. Does that make any sense?
Ralf Of course, it
Hello,
"Hans" == Hans Aberg [EMAIL PROTECTED] writes:
Hans The idea with calling the floating numbers floating numbers
Hans is that it is possible to implement real numbers too, as in
Hans computer algebra programs.
we have to distinguish between 3 sets:
(1) The set of
Hello,
in the following example, where I define a
state transformer monad "St" parametrized with
the state "c", the ghc-2.08 typechecker reports
the following error message in the type definition of
function "foo" which uses the instantiated "St":
`St' should have no arguments, but has
Hello,
concerning my previous mail:
during compilation with the binary installed version of
ghc-2.07 for Solaris, I got the following message:
---
*** Pattern-matching error within GHC!
This is a compiler bug; please
67 matches
Mail list logo