Re: [Haskell-cafe] C++ Parser?

2012-02-01 Thread Yin Wang
I haven't dealt explicitly with templates. I treat them as type parameters (element $type-parameter). I don't check that they have been declared at all. As explained, these are semantic checks and should be deferred until type checking stage ;-) Cheers,     Yin On Wed, Feb 1, 2012

Re: [Haskell-cafe] C++ Parser?

2012-02-01 Thread Yin Wang
e C++ programs. Cheers,     Yin On Tue, Jan 24, 2012 at 5:06 AM, Christopher Brown wrote: > Hi, > > I have stumbled across language-c on hackage and I was wondering if anyone is > aware if there exists a full C++ parser written

Re: [Haskell-cafe] decoupling type classes

2012-01-16 Thread Yin Wang
>>> The typical example would be >>> >>> instance Eq a => Eq [a] where >>>  [] == [] = True >>>  (a : as) == (b : bs) = a == b && as == bs >>>  _ == _ = False >> >> It can handle this case, although it doesn't handle it as a parametric >> instance. I suspect that we don't need the concept of "param

Re: [Haskell-cafe] decoupling type classes

2012-01-14 Thread Yin Wang
On Sat, Jan 14, 2012 at 2:38 PM, Dominique Devriese wrote: >> I may or may not have thought about it. Maybe you can give an example >> of parametric instances where there could be problems, so that I can >> figure out whether my system works on the example or not. > > The typical example would be

Re: [Haskell-cafe] decoupling type classes

2012-01-14 Thread Yin Wang
> Also, you don't seem to have thought about the question of parametric > instances: do you allow them or not, if you do, what computational > power do they get etc.? I may or may not have thought about it. Maybe you can give an example of parametric instances where there could be problems, so tha

[Haskell-cafe] decoupling type classes

2012-01-11 Thread Yin Wang
esn't just match the name. It must match both the name and the inferred principle type. This intuition also explains why local instances shouldn't be allowed, because if we capture the variables at the definition site, the method call becomes "statically scoped". -- yin __

[Haskell-cafe] Gtk2Hs installation problem with ghc 6.8.2 on Ubuntu 7.10

2007-12-23 Thread Yin Wang
_closure' World.o: In function `r2JT_info': (.text+0xb8): undefined reference to `gtkzm0zi9zi12zi1_GraphicsziUIziGtkziTypes_zdf550_closure' ... collect2: ld returned 1 exit status The first command worked well with the ghc 6.6.1 came with ubuntu. I tried to uninstall my

[Haskell-cafe] How to parsing files

2005-07-20 Thread yin
Hi, I need to parse a file in this format: float float float float float float Each row has 3-columns of floating procision number divided by white space. The number of lines is undefined. I use (lines (readFile "...")) to read the file. Thnks. Matej &

Re: [Haskell-cafe] Word32 to Int converions

2005-07-20 Thread yin
Bernard Pope wrote: >On Wed, 2005-07-20 at 11:43 +0200, yin wrote: > >> >>how do I convert an Word32 (or WordXYZ) to Int, or Integer, or Float, >>...? The Int conversion is the priority. >> >> >fromIntegral to convert to an instance of Integral, such as

[Haskell-cafe] Word32 to Int converions

2005-07-20 Thread yin
hello, how do I convert an Word32 (or WordXYZ) to Int, or Integer, or Float, ...? The Int conversion is the priority. Thanks. Matej 'Yin' Gagyi ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listin

Re: [Haskell-cafe] file line operation perhaps need loop

2005-07-20 Thread yin
OF h eof2 <- hIsEOF h case (eof1, eof2) of (False, False) -> do l1 <- hGetLine h1 l2 <- hGetLine h2 return l1:l2:(zipFiles h1 h2) (False, True) -> return (readFile h1) (True, False) -> return (readFile h2) _ -> [] I didn't tested i

[Haskell-cafe] Named data type members

2005-07-19 Thread yin
-- where x = 1, 2 ... 50 ... ... 3b. every funtion needs only a part of the data... can I build for every fintion a class with defined operators to manipulate with the data and then: * pass the variable in func1 known as class A to func2, which is infering a class B? Thank you all... Matej

Re: [Haskell-cafe] IO Monad

2005-07-19 Thread yin
? > In short, to not break functional aproach. Non-IO functions can't call IO functions, because IO functions are evaluated every time you call them. Matej 'Yin' Gagyi ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Named data type members

2005-07-19 Thread yin
-- where x = 1, 2 ... 50 ... ... 3b. every funtion needs only a part of the data... can I build for every fintion a class with defined operators to manipulate with the data and then: * pass the variable in func1 known as class A to func2, which is infering a class B? Thank you

[Haskell-cafe] How to variables

2005-07-18 Thread yin
implement camera_pos_x, y and z as variables, which chage values in run? This is only simplified example, but it's important to implement it in as most imperative form as possible. Thank fo all answers. Matej 'Yin' Gagyi ___ Haskell-Cafe m

Re: [Haskell-cafe] How to variables

2005-07-18 Thread yin
robert dockins wrote: > > > yin wrote: > >> Hello all! >> >> I'm doing a 3D simulation. Now I need something like variables in >> imperative languages. My mainLoop check for new events and renders >> scene. > > > Then you want IORef. >

Re: [Haskell-cafe] How to variables

2005-07-18 Thread yin
it. I made a 3D engine in C++, but it was a broken aproach. I rewrote ti in C and it had many memory leaks and too many optimalizations. I shoudn't implement MainLoop and rendering state in Haskell. Haskell has the same leaks like imperative languages, but in other "programing u

Re: [Haskell-cafe] How to variables

2005-07-18 Thread yin
- getCameraPos --setCameraPos (x + 1, y, z) -- ... -- drawGLScreen drawGLScreen = do -- glTranslate to getCameraPos... Is this apoarch safe enougth, what do you think? Matej 'Yin' Gagyi ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread yin
Lemmih wrote: >On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > > >>Lemmih wrote: >> >> >> >>>On 7/18/05, yin <[EMAIL PROTECTED]> wrote: >>> >>> >>> >>> >>>>Hello, >>>> &

Re: [Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread yin
Lemmih wrote: >On 7/18/05, yin <[EMAIL PROTECTED]> wrote: > > >>Hello, >> >>I'm trying to write a 3D renderer in Haskell using SDL bindings (Lemmih) >>and OpenGL bindings. When I try to compile my work, ghc runs collect2: >> >>

[Haskell-cafe] Re: hawiki Haskell SDL openGl example works strange

2005-07-18 Thread yin
yin wrote: >I tried to run the example from http://haskell.org/hawiki/HaskellOpenGl >(the SDL version), but the scene is shown, only when I resize the >window. I tried to insert the drawGLScreen before mainloop call, but it >didn't worked. Do you some idea how to resolve th

[Haskell-cafe] hawiki Haskell SDL openGl example works strange

2005-07-18 Thread yin
oblem? Thanks Matej 'Yin' Gagyi ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell, SDL, OpenGL

2005-07-18 Thread yin
re -u GHCziIOBase_BlockedIndefinitely_closure -u GHCziIOBase_Deadlock_closure -u GHCziWeak_runFinalizzerBatch_closure -u __stginit_Prelude /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crt1.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../../crti.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtbegin.o -L/hom

Re: [Haskell-cafe] what does ' mean?

2005-07-17 Thread yin
Logesh Pillay wrote: > I found the following code on the web > > /-- Andrew Bromage > / > /-- If you're doing permutations, then I suppose you want this too: > //-- (subLists might be a more suggestive name) > /combinations *:: [a] -> [[a]] > *combinations [] = [[]] > combinations (x:xs) >= co

Re: [Haskell-cafe] IO platform for testing

2005-07-17 Thread Matej &#x27;Yin' Gagyi
Isaac Jones wrote: yin <[EMAIL PROTECTED]> writes: ./bundle01... I more apoarches, but no one worked. Now I tried this: m01_mod :: Int -> Int -> Int What's m01? You define b01 below: oops! "m01" propably is a halucination of my keyboard :)

[Haskell-cafe] IO platform for testing

2005-07-16 Thread yin
need runing more s and with various argument counts and types. All functions "in a bundle" should be in one file. Thanks to you all :) Matej 'Yin' Gagyi ___ 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@h

[Haskell-cafe] Trivial question... solve_qe

2005-06-15 Thread Matej &#x27;Yin' Gagyi
Hi all! I'm new to Haskell... absolutely new. I need some practice, but little problem seems to me like unresolvable... Is there some tutorial of "Exercise, set of resolutions" pairs type? My english is very bat, so there is it in a picture: Exercise 1: hello world Hint: use 'putStrLn' Resolutio