Re: [Haskell-cafe] can't build module with ffi 'wrapper' by cabal (or ghc): unknown symbol

2005-07-05 Thread Evgeny Chukreev
On Wed, 29 Jun 2005 22:05:49 +0400
/Evgeny/ /Chukreev/ [EMAIL PROTECTED] wrote me:

EC gcc src/Codec/Mhash_stub.c -o ...
EC /usr/bin/ar qv dist/build/libHSHMhash-0.1.a dist/build/src/Codec/Mhash.o
EC /usr/bin/ar: creating dist/build/libHSHMhash-0.1.a
EC a - dist/build/src/Codec/Mhash.o
(why mhash_stub.o did not archived?)

Does no answer to my question mean that there is no-one who knows what kind of 
bug 
it is (ghc/cabal/mine) or it is the fact that nobody cares (even the
developers of ghc/cabal)?

Without answer I can't continue developing that wrapper for mhash library.

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


[Haskell-cafe] Re: haskell parser for java bytecode?

2005-07-05 Thread Frank-Andre Riess
Hi there,

keeping out of the previous tiff, I'd just like to mention that I, too, am
interested in such a project - I don't require a parser for Java bytecode,
but I think I'd be a good experience and at least it would get me to know
the JVM a bit better... maybe :)

By the way, there once was some discussion about having Haskell actually
-target- the JVM (I think, it was on the Glasgow Haskell Users list). That
might as well be an interesting thing to do.

Best regards,
Frank-Andre Riess
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] can't build module with ffi 'wrapper' by cabal (or ghc): unknown symbol

2005-07-05 Thread Lemmih
On 7/4/05, Evgeny Chukreev [EMAIL PROTECTED] wrote:
 On Wed, 29 Jun 2005 22:05:49 +0400
 /Evgeny/ /Chukreev/ [EMAIL PROTECTED] wrote me:
 
 EC gcc src/Codec/Mhash_stub.c -o ...
 EC /usr/bin/ar qv dist/build/libHSHMhash-0.1.a dist/build/src/Codec/Mhash.o
 EC /usr/bin/ar: creating dist/build/libHSHMhash-0.1.a
 EC a - dist/build/src/Codec/Mhash.o
 (why mhash_stub.o did not archived?)
 
 Does no answer to my question mean that there is no-one who knows what kind 
 of bug
 it is (ghc/cabal/mine) or it is the fact that nobody cares (even the
 developers of ghc/cabal)?
 
 Without answer I can't continue developing that wrapper for mhash library.

The problem lies in GHC.
$fptools/ghc/compiler/main/DriverPipeline.hs:514 to be exact.
You can link 'dist/build/WrapperMod.o' to
'dist/build/Your/Hierarchy/WrapperMod.o' as a dirty fix.  Perhaps
copying it after builds with a Cabal hook would be cleaner.

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


Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-05 Thread Keean Schupke
Henning Thielemann wrote:

I'm uncertain about how who want to put the different kinds of
multiplication into one method, even with multi-parameter type classes.
You need instances

 (*) :: Matrix - Matrix - Matrix
 (*) :: RowVector - Matrix - RowVector
 (*) :: Matrix - ColumnVector - ColumnVector
 (*) :: RowVector - ColumnVector - Scalar
 (*) :: ColumnVector - RowVector - Matrix
 (*) :: Scalar - RowVector - RowVector
 (*) :: RowVector - Scalar - RowVector
 (*) :: Scalar - ColumnVector - ColumnVector
 (*) :: ColumnVector - Scalar - ColumnVector

but you have to make sure that it is not possible to write an expression
which needs
 (*) :: Matrix - RowVector - RowVector

Further you need
 transpose :: RowVector - ColumnVector
 transpose :: ColumnVector - RowVector
 transpose :: Matrix - Matrix
and you must forbid, say
 transpose :: RowVector - RowVector
  

Of course if they are all of type Matrix this problem disappears. What
is the
difference between a 1xN matrix and a vector? Please explain...

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


Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-05 Thread Keean Schupke
David Roundy wrote:

In short, especially since the folks doing the work (not me) seem to want
plain old octave-style matrix operations, it makes sense to actually do
that.  *Then* someone can implement an ultra-uber-tensor library on top of
that, if they like.  And I would be interested in a nice tensor
library... it's just that matrices need to be the starting point, since
they're where most of the interesting algorithms are (that is, the ones
that are interesting to me, such as diagonalization, svd, matrix
multiplication, etc).
  

This is a really good idea. I would like a Matrix library soon, not in 6
years time.
Slice it up into managable pieces and keep it simple!

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


Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-05 Thread Henning Thielemann

On Tue, 5 Jul 2005, Keean Schupke wrote:

 David Roundy wrote:

 In short, especially since the folks doing the work (not me) seem to want
 plain old octave-style matrix operations, it makes sense to actually do
 that.  *Then* someone can implement an ultra-uber-tensor library on top of
 that, if they like.  And I would be interested in a nice tensor
 library... it's just that matrices need to be the starting point, since
 they're where most of the interesting algorithms are (that is, the ones
 that are interesting to me, such as diagonalization, svd, matrix
 multiplication, etc).
 
 This is a really good idea. I would like a Matrix library soon, not in 6
 years time.
 Slice it up into managable pieces and keep it simple!

As I said, _that_ already exists: MatLab, HaskellDSP (with some simple new
definitions for infix operators) ...

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


Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-05 Thread Henning Thielemann

On Tue, 5 Jul 2005, Keean Schupke wrote:

 Henning Thielemann wrote:

 I'm uncertain about how who want to put the different kinds of
 multiplication into one method, even with multi-parameter type classes.
 You need instances
 
  (*) :: Matrix - Matrix - Matrix
  (*) :: RowVector - Matrix - RowVector
  (*) :: Matrix - ColumnVector - ColumnVector
  (*) :: RowVector - ColumnVector - Scalar
  (*) :: ColumnVector - RowVector - Matrix
  (*) :: Scalar - RowVector - RowVector
  (*) :: RowVector - Scalar - RowVector
  (*) :: Scalar - ColumnVector - ColumnVector
  (*) :: ColumnVector - Scalar - ColumnVector
 
 but you have to make sure that it is not possible to write an expression
 which needs
  (*) :: Matrix - RowVector - RowVector

This was my reply to Jacques Carette who suggested to distinguish row and
column vectors by their _type_. His revised suggestion was to use phantom
types. Then the types changes to

(*) :: Matrix - Matrix - Matrix
(*) :: Vector Row - Matrix - Vector Row
(*) :: Matrix - Vector Column - Vector Column
(*) :: Vector Row - Vector Column - Scalar
...

but the problem remains ...

 Further you need
  transpose :: RowVector - ColumnVector
  transpose :: ColumnVector - RowVector
  transpose :: Matrix - Matrix
 and you must forbid, say
  transpose :: RowVector - RowVector
 
 
 Of course if they are all of type Matrix this problem disappears.

All type problems disappear when we switch to exclusive String
representation. 8-]

 What is the difference between a 1xN matrix and a vector? Please explain...

My objections to making everything a matrix were the objections I sketched
for MatLab.

The example, again: If you write some common expression like

transpose x * a * x

then both the human reader and the compiler don't know whether x is a
true matrix or if it simulates a column or a row vector. It may be that
'x' is a row vector and 'a' a 1x1 matrix, then the expression denotes a
square matrix of the size of the vector simulated by 'x'. It may be that
'x' is a column vector and 'a' a square matrix. Certainly in most cases I
want the latter one and I want to have a scalar as a result. But if
everything is a matrix then I have to check at run-time if the result is a
1x1 matrix and then I have to extract the only element from this matrix.
If I omit the 1x1 test mistakes can remain undiscovered. I blame the
common notation x^T * A * x for this trouble since the alternative
notation x, A*x can be immediately transcribed into computer language
code while retaining strong distinction between a vector and a matrix
type.

More examples? More theory?

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


[Haskell-cafe] Fork execve

2005-07-05 Thread yin
Hello!

Is there some way how to fork a process in haskell? And excuting an
another proces, waiting until it exit and colecting his stdout?

Matej 'Yin' Gagyi

PS: I'm sorry for my English!

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


Re: [Haskell-cafe] Fork execve

2005-07-05 Thread Donn Cave
On Tue, 5 Jul 2005, yin wrote:
 Is there some way how to fork a process in haskell? And excuting an
 another proces, waiting until it exit and colecting his stdout?

Yes, but it depends on
 -- your Haskell environment (ghc?)
 -- your platform (UNIX?)
 
If it's ghc and UNIX, see
http://www.haskell.org/ghc/docs/latest/html/libraries/base/System.Process.html

Or if you would rather use low level POSIX functions directly, see
the Posix.IO and Posix.Process pages.  The effect of these functions
should be as described in the respective man pages for the C functions
(though with a few gratuitous API modifications like a [1..n] argv where
the C function takes [0..n].)

For the Process vs. Command distinction, Command uses the UNIX
shell to interpret a command, where Process would execute it directly.
If you are going to compute the command parameters, it's much easier to
use the Process version, than to check the shell command input data for
shell punctuation that would have unintended results.

If you're on another platform or using another Haskell implementation,
it still might be worth a try, I just haven't tried it myself.

Donn Cave, [EMAIL PROTECTED]

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


Re: [Haskell-cafe] matrix computations based on the GSL

2005-07-05 Thread Michael Walter
On 7/5/05, Henning Thielemann [EMAIL PROTECTED] wrote:
 The example, again: If you write some common expression like
 
 transpose x * a * x
 
 then both the human reader and the compiler don't know whether x is a
 true matrix or if it simulates a column or a row vector.

But since a, by definition (question), is a 1xN matrix, what's the
ambiguity exactly?

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


Re: [Haskell-cafe] can't build module with ffi 'wrapper' by cabal (or ghc): unknown symbol

2005-07-05 Thread Isaac Jones
Evgeny Chukreev [EMAIL PROTECTED] writes:

 On Wed, 29 Jun 2005 22:05:49 +0400
 /Evgeny/ /Chukreev/ [EMAIL PROTECTED] wrote me:

 EC gcc src/Codec/Mhash_stub.c -o ...
 EC /usr/bin/ar qv dist/build/libHSHMhash-0.1.a dist/build/src/Codec/Mhash.o
 EC /usr/bin/ar: creating dist/build/libHSHMhash-0.1.a
 EC a - dist/build/src/Codec/Mhash.o
 (why mhash_stub.o did not archived?)

 Does no answer to my question mean that there is no-one who knows what kind 
 of bug 
 it is (ghc/cabal/mine) or it is the fact that nobody cares (even the
 developers of ghc/cabal)?

You posted to the wrong place.  I don't follow this list as closely as
[EMAIL PROTECTED]  It would also help if you can describe your
problem and only paste relevant details of your compiler interaction.

Which version of Cabal are you using?  Handling of _stub files is new
in versions  1.0.1, which are not yet released, but you can get it
from CVS / darcs or from the latest tarballs on the web page.

peace,

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


Re: [Haskell-cafe] Cabal with Alex and and Happy

2005-07-05 Thread Isaac Jones
Brian Smith [EMAIL PROTECTED] writes:

 Is there an example of how to build a Cabal package that has a lexer
 generated with Alex and a parser generated with Happy?  As far as I
 can tell, the way to do this is to add Other-Modules:
 Module.Name.Of.Parser.y Module.Name.Of.Lexer.x to each
 executable/library stanza. But, when I try this, I get:

No, they should just be Module.Name.Of.Parser and
Module.Name.Of.Lexer.

 Could not find module `GHC.Exts':
   it is a member of package base-1.0, which is hidden

 The generated parser code contains:

But your real problem is answered by the other replies on this thread.

peace,

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