所以我从FParsec示例中运行以下代码,但它似乎不想运行。
namespace Test
open FParsec.CharParsers
module Stuff =
let main = run pfloat "1.25E3"
let str s = pstring s
let floatBetweenBrackets = str "[" >>. pfloat .>> str "]"
问题是最后一行 - 我收到此错误:
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
代码来自这里:
http://www.quanttec.com/fparsec/tutorial.html#parsing-a-float-between-brackets
如果重要,我正在运行的F#版本是:
Microsoft (R) F# Interactive version 12.0.30110.0