So I'm running the following code from the FParsec sample, but it doesn't seem to want to run.
namespace Test
open FParsec.CharParsers
module Stuff =
let main = run pfloat "1.25E3"
let str s = pstring s
let floatBetweenBrackets = str "[" >>. pfloat .>> str "]"
The problem is the last line - I get this error:
Error 1 Expecting a type supporting the operator '>>.' but given a function type. You may be missing an argument to a function. C:\Users\...\Documents\Visual Studio 2013\Projects\Solution2\ConsoleApplication1\load.fs 6 42 Formatting
The code is from here:
http://www.quanttec.com/fparsec/tutorial.html#parsing-a-float-between-brackets
If it matters, the version of F# I'm running is:
Microsoft (R) F# Interactive version 12.0.30110.0
>>.
is defined in FParsec.Primitives
, so you need to open that as well. Alternatively, you can just open FParsec
, since
Opening the FParsec namespace also automatically opens the Primitives, CharParsers and Error modules.
This answer explains why the error you're seeing is what it is.