What means MutVar# ?

2004-04-08 Thread Hans Nikolaus Beck
Hi, 

by trying to understand how "writeIORef" works, I looked at

data STRef s a = STRef (MutVar# s a)

 what is MutVar# ? (especially zhe "#" ) ? I've readed tha writeIORef (and readIoRef etc) is used to write directly to memory places fo implementing variables, as in example in HOpenGL used.  Is this also Haskell standard ?

Thanks for help


Hans___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: How to write this correct...

2004-02-22 Thread Hans Nikolaus Beck
Hi,

The type signature is wrong. Try this..
 toVertex :: GLVertex -> Vertex3 GLfloat
or perhaps..
 toVertex :: (a,a,a) -> Vertex3 a
Regards
Yes this works (the first variant). Thanks ! But I must say that I have 
problems to understand the class mechanism in its full extend

Greetings

Hans

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


How to write this correct...

2004-02-22 Thread Hans Nikolaus Beck
Hi, 

I have the following problem: 

Vertex3 ist defined as 

data Vertex3 a = Vertex3 a a a

a is defined as

class a VertexComponent

But I fail to write to following correct

type GLVertex = (GLfloat, GLfloat, GLfloat)

toVertex :: GLVertex -> Vertex3 a  how do it correctly
toVertex (x,y,z) = Vertex3 x y z

The compiler says "cannot infer a with type GLFloat" or something like this I don't understand.

Thank you for help


Hans



___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: "Talking" with the compiler

2004-01-26 Thread Hans Nikolaus Beck
Hi,

My plan is to have an API where you can request a :load of a module
source (perhaps omitting the code generation steps for speed) and then
request information about the module, by source location (GHC now has
completely accurate source location information in its abstract
datatype; we did this recently in order to support the Visual Studio
work).  The API will most likely be a derivative of the existing
compilation manager interface: see 
ghc/compiler/compMan/CompManager.lhs.
What's about the HEP ?
The paper at haskell.org is a little bit old, and I could not find 
newer information about the API or it's use.

Greetings

Hans

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: "Talking" with the compiler

2004-01-20 Thread Hans Nikolaus Beck
Hi,

I agree.  It would be nice to have also a Iterator interface for the 
AST, i.e. for jump to next/previous symbol of a special kind. Also 
information about the caller of a symbol would be nice (I don't know if 
that is already part of the compiler manager interface).

I'm interested in code visualization and refactoring, so this all would 
be nice to have :-))

BTW:  My host system will be Squeak ...

greetings

Hans

Am 20.01.2004 um 11:32 schrieb Simon Marlow:


On Mon, 2004-01-19 at 11:34, Simon Marlow wrote:
For the Visual Studio plugin we're going to need to talk to
GHCi.  We
plan to do this by designing an appropriate API for GHCi
and calling it
directly; you *could* do it by talking over a pipe, but
it's going to be
a lot of work (and slow).  If you want to do this, please talk to us
about what API you'd like to see, and we can hopefully implement
something that will be generally useful.
I wanted something like that for a Haskell IDE I was working on (not
much progress on it at the moment, but I may pick it up again).
The main things I wanted was enough information to be able to
implement
"jump to definition". Where you select a symbol in your
editor and move
to where that variable/function/type/class was defined, in the same
module or another module.  It would also be useful to find out the
module and package a symbol comes from so that an IDE could
have a good
stab at finding some documentation.
For that, you'd want an API for wandering through the useful
information
in .hi files. An API corresponding to hugs/ghci's :info
, :browse
, :type  would be a good start. You'd want to
be able to
specify which root module to load up the symbols for, optionally
specifing a search path and expect it to also load up the .hi
files for
any imported modules.
This is all stuff that we need for Visual Studio too.  VS will 
typecheck
your program as you type, so you'll get errors underlined in the source
code.  A side effect of this is that it will collect all the 
information
reuqired to implement "jump to definition" and "tell me the type of 
this
identifier" in the editor.

My plan is to have an API where you can request a :load of a module
source (perhaps omitting the code generation steps for speed) and then
request information about the module, by source location (GHC now has
completely accurate source location information in its abstract
datatype; we did this recently in order to support the Visual Studio
work).  The API will most likely be a derivative of the existing
compilation manager interface: see 
ghc/compiler/compMan/CompManager.lhs.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: "Talking" with the compiler

2004-01-18 Thread Hans Nikolaus Beck
Hi,

Am 18.01.2004 um 11:31 schrieb Ketil Malde:

[EMAIL PROTECTED] (Hans Nikolaus Beck) writes:

in order to build a programming environement, it would be nice to ask
the GHC about symbols etc found in a given Haskell program.
I suppose a programming environment could talk to GHCi (which provides
commands like :type, :info, :browse to explore the currently defined
symbols)?
I've look shortly at the GHCi documentation. So I think it would be 
possible to include a "GHC engine" into a IDE application by 
redirecting input and output from GHCi to pipes (I rembemer that emacs 
used something similar for doing it's compile stuff). But that's 
hardcore UNIX,  I've forgot how to do that  :-(((

Greetings

Hans
-kzm
--
If I haven't seen further, it is by standing in the footprints of 
giants

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: "Talking" with the compiler

2004-01-17 Thread Hans Nikolaus Beck
Hi,

thank you, it's seems very helpful :-))

Greetings

Hans

Am 18.01.2004 um 00:31 schrieb Donald Bruce Stewart:

HNBeck:
Hi,

in order to build a programming environement, it would be nice to ask
the GHC about symbols etc found in a given Haskell program. I've read
that GHC has a interface, which was originally intended to plug in
other backends. But I've never found a detailed description or API
Can someone help me ?
Perhaps you are talking about the external Core interface.  
Documentation
for that is here:
 
http://www.haskell.org/ghc/docs/latest/html/users_guide/ext-core.html

Also, there are many -ddump-xxx options, that can give you very useful
information, at any level of the compiler. Info for that is here:
 
http://www.haskell.org/ghc/docs/latest/html/users_guide/flag- 
reference.html#AEN6775

Cheers,
Don
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


"Talking" with the compiler

2004-01-17 Thread Hans Nikolaus Beck
Hi,

in order to build a programming environement, it would be nice to ask 
the GHC about symbols etc found in a given Haskell program. I've read 
that GHC has a interface, which was originally intended to plug in 
other backends. But I've never found a detailed description or API

Can someone help me ?

Thanks

Hans

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


XCode and GHC on MacOs X

2004-01-10 Thread Hans Nikolaus Beck
Hi,

Could the XCode Tool from Mac Os X Panther be forced to use ghc instead 
of gcc ? I've found no option to do so, help says nothing about 
switching a compiler...

Greetings

Hans

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Compiling HOpenGL Examples with GHC 6.2 Mac OS

2004-01-06 Thread Hans Nikolaus Beck
Hi,

as far as I understand now, for my compiliing problem (see last past 
with same subject) I must do

ghc -package OpenGL -package GLUT --make Cube.hs

and in the code doing

import OpenGL
import GLUT
Right so far ?

But it seems that the package description in the GHC 6.2 distribution 
is not right for this packages (OpenGL and GLUT), for both the 
directory $(InstallDir)/Graphics/Rendering and 
$(InstallDir)/Graphics/UI is used .???

Greetings

Hans

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Compiling HOpenGL Examples with GHC 6.2 Mac OS

2004-01-06 Thread Hans Nikolaus Beck
Hi, 

I'm a Haskell newbee and  try to  compile the HOpenGL Examples with GHC 6.2 Mac OS X with it's build in openGL stuff,  by giving 

ghc --make Cube.hs 

the answer is :"not find module GLUT and GL", which is understandable because in the Cube.hs there is the code

import GL
import GLU

But how to say ghc what he needs ?  Is it -addpackage or -l  option (in other words "import" is the same as include in C?) ? 

BTW: In the HOpenGL distribution, in the directory lib there is a file GL.hs and GLUT.hs which I think are the files needed for teh example above.  But I don't found these files  in the new GHC 6.2 distribution, is that correct ?

Thanks for your help.

Greetings


Hans___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users