[Haskell-cafe] parse error in pattern, and byte code interpreter

2012-01-14 Thread TP
Hi everybody, I want to test a higher level language than C/C++ (type inference, garbage collection), but much faster than Python. So I am naturally led to Haskell or OCaml. I have read and tested tutorials for the two languages. For the time being, my preference goes to Haskell, first

Re: [Haskell-cafe] parse error in pattern, and byte code interpreter

2012-01-14 Thread Brandon Allbery
On Sat, Jan 14, 2012 at 18:18, TP paratribulati...@free.fr wrote: Times expr1 Plus( expr2 expr3 ) - OCaml pattern syntax is not the same as Haskell pattern syntax. The correct way to write that pattern is Times expr1 (Plus expr2 expr3) This is consistent with Haskell not using

Re: [Haskell-cafe] Parse error

2010-01-18 Thread Evan Laforge
It's an improvement. It's still not pretty, but I guess that's as good as it's going to get... Maybe this is an instance of Haskell trying to tell me if you need to write a 20-line do-block in the middle of your function, you're doing it wrong. 20 lines is a lot, but I have smaller ones all

[Haskell-cafe] Parse error

2010-01-17 Thread Andrew Coppin
Is there a specific reason why GHC consistently refuses to accept the following perfectly reasonable code snippet? main = do putStrLn Line 1 putStrLn Line 2 let xs = do x - [1..10] y - [1..10] return (x+y) print xs No matter which way I rearrange this, it *insists* that there's

Re: [Haskell-cafe] Parse error

2010-01-17 Thread VoidPrayer
let ... in ... I guess GHC is finding where in is. 在 2010年 1月 17日 星期日 18:05:47,Andrew Coppin 寫道: Is there a specific reason why GHC consistently refuses to accept the following perfectly reasonable code snippet? main = do putStrLn Line 1 putStrLn Line 2 let xs = do x -

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Tony Morris
No, but there's a specific reason why GHC consistently refuses to accept your perfectly unreasonable code snippet :) GHC accepts the following perfectly reasonable code snippet: main = do putStrLn Line 1 putStrLn Line 2 let xs = do x - [1..10] y - [1..10] return

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Daniel Fischer
Am Sonntag 17 Januar 2010 11:05:47 schrieb Andrew Coppin: Is there a specific reason why GHC consistently refuses to accept the following perfectly reasonable code snippet? Yes, you violated the layout rule. main = do putStrLn Line 1 putStrLn Line 2 let xs = do x - [1..10]

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Andrew Coppin
Tony Morris wrote: No, but there's a specific reason why GHC consistently refuses to accept your perfectly unreasonable code snippet :) She sells csh on the sea shore. :-) GHC accepts the following perfectly reasonable code snippet: main = do putStrLn Line 1 putStrLn Line 2 let xs =

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Daniel Fischer
Am Sonntag 17 Januar 2010 11:33:45 schrieb Andrew Coppin: Tony Morris wrote: No, but there's a specific reason why GHC consistently refuses to accept your perfectly unreasonable code snippet :) She sells csh on the sea shore. :-) GHC accepts the following perfectly reasonable code

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Ross Paterson
On Sun, Jan 17, 2010 at 10:33:45AM +, Andrew Coppin wrote: Tony Morris wrote: main = do putStrLn Line 1 putStrLn Line 2 let xs = do x - [1..10] y - [1..10] return (x+y) print xs Urg, but that's *ugly*. Is there no way I can reduce the amount of

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Andrew Coppin
Daniel Fischer wrote: Am Sonntag 17 Januar 2010 11:33:45 schrieb Andrew Coppin: Urg, but that's *ugly*. Is there no way I can reduce the amount of indentation to something more reasonable? main = do putStrLn Line 1 putStrLn Line 2 let xs = do x - [1..10] y -

Re: [Haskell-cafe] Parse error

2010-01-17 Thread Hans Aberg
On 17 Jan 2010, at 11:44, Andrew Coppin wrote: Urg, but that's *ugly*. Is there no way I can reduce the amount of indentation to something more reasonable? main = do putStrLn Line 1 putStrLn Line 2 let xs = do x - [1..10] y - [1..10] return (x+y) print xs That

[Haskell-cafe] parse error on input `'

2009-04-25 Thread siso dagbovie
Hi, I've defined the following datatype with haskell data Graph a b = Empty | Context a b Graph a b But I am having the error message: parse error on input `' . I am wondering what it is wrong with my definition. How can I fix this? Thanks in advance. Kind regards

Re: [Haskell-cafe] parse error on input `'

2009-04-25 Thread Daniel Fischer
Am Samstag 25 April 2009 19:29:30 schrieb siso dagbovie: Hi, I've defined the following datatype with haskell data Graph a b = Empty | Context a b Graph a b But I am having the error message: parse error on input `' . I am wondering what it is wrong with my definition. How can I fix

Re: [Haskell-cafe] parse error on input `'

2009-04-25 Thread Jochem Berndsen
siso dagbovie wrote: I've defined the following datatype with haskell data Graph a b = Empty | Context a b Graph a b But I am having the error message: parse error on input `' . I am wondering what it is wrong with my definition. How can I fix this? Constructors have to start with a

[Haskell-cafe] Parse error on input |

2007-05-31 Thread Akijmo
Hi everyone. I am new to this Forum, Haskell and i am german, so i am sorry for noob failures or spelling mistakes. I am currently learning for an informatic exam (11th class) and i tried to code a function to sum a polynom with a pair of polynoms... (I actually want to to code a polynomdivision

Re: [Haskell-cafe] Parse error on input |

2007-05-31 Thread Robin Green
You neglected a ) - remember to count your parentheses in future when you get an error directly after a parenthesised expression. -- Robin On Thu, 31 May 2007 08:09:23 -0700 (PDT) Akijmo [EMAIL PROTECTED] wrote: Hi everyone. I am new to this Forum, Haskell and i am german, so i am sorry

Re: [Haskell-cafe] Parse error on input |

2007-05-31 Thread Dan Weston
The second argument of the second line of the definition does not match the expected type. (Polynom,Polynom) is a tuple, not a list, so []::(a,a) is not well typed for any a. Dan Akijmo wrote: Hi everyone. I am new to this Forum, Haskell and i am german, so i am sorry for noob failures or

Re: [Haskell-cafe] Parse error on input |

2007-05-31 Thread Akijmo
thx much green... this helped for the parser failure. Dan you were right too, cause now i got the interfering types [(Int,Int)] and Polynom for line 2. But i fixed this by replacing it with ([],[]) So thx much guys :D greenrd wrote: You neglected a ) - remember to count your parentheses in

[Haskell-cafe] Parse error

2005-03-17 Thread Dmitri Pissarenko
Hello! In the attachment you will find a file, in which I try to access Java from Haskell using the Java bridge for functional languages. For details see http://sourceforge.net/projects/jvm-bridge/ and http://dapissarenko.com/resources/2005_02_17_eigenvaluesJava/2005_02_17_eigenva

Re: [Haskell-cafe] Parse error

2005-03-17 Thread Arthur Baars
You need { } around the declaration of matrix1. Otherwise the semicolon at the end of its definition is considered to be part of the 'let': let { matrix1 = (array ((1,1),(3,3)) [((1,1), 0.0), ((1,2), 0.0), ((1,3),-2.0), ((2,1), 0.0), ((2,2), 7.0), ((2,3), 0.0), ((3,1), 0), ((3,2), 0),

Re: [Haskell-cafe] Parse error

2005-03-17 Thread Lemmih
On Thu, 17 Mar 2005 20:42:30 +0100, Dmitri Pissarenko [EMAIL PROTECTED] wrote: Hello! In the attachment you will find a file, in which I try to access Java from Haskell using the Java bridge for functional languages. For details see http://sourceforge.net/projects/jvm-bridge/ and

[Haskell-cafe] Parse error in a package file

2005-02-13 Thread Dmitri Pissarenko
Hello! I'm building the haskell-jvm-bridge (http://sourceforge.net/projects/jvm- bridge/). The final step of the building procedure is to install the package of haskell- jvm-bridge. When I enter ghc-pkg -a -f javavm.ghc-pkg I'm getting the error javavm.ghc-pkg: parse error in package config

Re: [Haskell-cafe] Parse error in a package file

2005-02-13 Thread Isaac Jones
Dmitri Pissarenko [EMAIL PROTECTED] writes: Hello! I'm building the haskell-jvm-bridge (http://sourceforge.net/projects/jvm- bridge/). The final step of the building procedure is to install the package of haskell- jvm-bridge. When I enter ghc-pkg -a -f javavm.ghc-pkg I'm getting the