You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to do something a little funky with Atto by using it from JRuby, and I'm running into a strange issue.
Trying to run the readme example of parsing a list of integers separated by whitespace, but when calling
Parser.parse(Atto.sepBy(Atto.int, Atto.spaceChar), "123 45 6"), it tells me I'm missing an argument (2 for 3) in sepBy, whose signature in the scala code appears to only require 2 arguments. When I try providing different kinds of arguments to the third slot, it suggests i get something coercible to atto.compat.NonEmptyListy.
When i try providing NonEmptyList like inputs into the 3rd argument,
Atto.sepBy(Atto.int, Atto.spaceChar, NonEmptyList(1)), it tells me that I'm missing a method 'cons'. It suggests something about overloading to atto.compat.NonEmptyListy, or scala.Function0, but I'm stuck unable to figure out what the 3rd argument should be. When I look in the code for Atto, I notice there is an implicit Functor in ParseResultInstances. Is there some sort of Functor i should be passing as the third argument to let it accumulate on? or some kind of 'empty parser', like the Ok parser?
I understand that this is not the usual use of this library, but I would very much appreciate any help you can give.
The text was updated successfully, but these errors were encountered:
You're going to have a rough time calling atto from anything other than Scala, but the way you can figure this out is to try it from the REPL and use reify to see the implicit arguments.
I'm trying to do something a little funky with Atto by using it from JRuby, and I'm running into a strange issue.
Trying to run the readme example of parsing a list of integers separated by whitespace, but when calling
Parser.parse(Atto.sepBy(Atto.int, Atto.spaceChar), "123 45 6"), it tells me I'm missing an argument (2 for 3) in sepBy, whose signature in the scala code appears to only require 2 arguments. When I try providing different kinds of arguments to the third slot, it suggests i get something coercible to atto.compat.NonEmptyListy.
When i try providing NonEmptyList like inputs into the 3rd argument,
Atto.sepBy(Atto.int, Atto.spaceChar, NonEmptyList(1)), it tells me that I'm missing a method 'cons'. It suggests something about overloading to atto.compat.NonEmptyListy, or scala.Function0, but I'm stuck unable to figure out what the 3rd argument should be. When I look in the code for Atto, I notice there is an implicit Functor in ParseResultInstances. Is there some sort of Functor i should be passing as the third argument to let it accumulate on? or some kind of 'empty parser', like the Ok parser?
I understand that this is not the usual use of this library, but I would very much appreciate any help you can give.
The text was updated successfully, but these errors were encountered: