4

I am tryng to use this example (http://www.haskell.org/haskellwiki/HXT/Practical/Simple2) and when I try to run it always appear this PARSE ERROR ON INPUT "->"

The code where is the problem is this:

getTeams2 = atTag "LEAGUE" >>>
  proc l -> do
    leagName <- getAttrValue "NAME"       -< l

the line in especific is this:

 proc l -> do

so which problem can be?? How can i fix it?

by the way already remove all the "tabs" in the script

3
  • 4
    Do you have {-# LANGUAGE Arrows #-} set? When I try it in GHCi I get "The last statement in a do block in an arrow command must be an expression", and if I add return leagName after leagName <- getAttrValue ..., it tells me that the expression getAttrValue was found where an arrow command was expected. Commented Feb 3, 2014 at 21:29
  • I running the from CMD on Windows using this command "runhaskell example.hs" Each time i try to running the error appears. I have ran others examples and works. Only have problem with this sentence "proc x->do" BY the way how can i get sure i have the language arrows set? Commented Feb 3, 2014 at 21:49
  • 4
    The bit at the top of the file you linked to says {-# LANGUAGE Arrows #-}. This arrows pragma is absolutely essential to be able to run the code you show, because the proc <something> -> <something> is called "arrow notation" and it is not part of standard Haskell, but rather an extension you can enable in GHC with the arrows pragma. Make sure you also have {-# LANGUAGE Arrows #-}. Commented Feb 3, 2014 at 21:53

1 Answer 1

4
proc l -> do

is special notation for Arrows, and you have to enable it with

{-# LANGUAGE Arrows #-} 

at the top of your file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.