Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Module F#-阵列。无法访问并行模块_Module_F# - Fatal编程技术网

Module F#-阵列。无法访问并行模块

Module F#-阵列。无法访问并行模块,module,f#,Module,F#,我可以在F#Interactive中访问Array.Parallel模块,但在编译时无法访问。 可能有什么问题?(VS 2010) 此代码在FSI中编译良好,但当项目的一部分失败时: ----Erstellen-gestartet:Projekt:DELETE-TEST,Konfiguration:Debug-Any-CPU------ C:\ProgramFiles(x86)\Microsoft F\v4.0\fsc.exe-o:obj\Debug\DELETE\u TEST.dll-g--D

我可以在F#Interactive中访问
Array.Parallel
模块,但在编译时无法访问。 可能有什么问题?(VS 2010)

此代码在FSI中编译良好,但当项目的一部分失败时:

----Erstellen-gestartet:Projekt:DELETE-TEST,Konfiguration:Debug-Any-CPU------
C:\ProgramFiles(x86)\Microsoft F\v4.0\fsc.exe-o:obj\Debug\DELETE\u TEST.dll-g--Debug:full--noframework--define:Debug--define:TRACE--doc:bin\Debug\DELETE\u TEST.XML--optimize--tailcalls--r:“C:\Program Files(x86)\Reference assemblemblems\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll”-r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll-r:“C:\Program Files(x86)\Reference Assembly\Microsoft\Framework\v3.5\System.Core.dll”-r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll--目标:库--警告:3--警告错误:76--vserrors--LCID:1031--utf8output--完整路径--flaterrors Module1.fs

C:\work\Goswin\30_F#\16-135_LAD\DELETE TEST\Module1.fs(7,37):Fehler FS0039:Der Wert,Konstruktor,Namespace order Typ“Parallel”ist nicht definiert.
您的目标是.NET 2.0:
-r:“C:\Program Files(x86)\Reference Assembly\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll”

并行
模块通过
系统.Threading.Tasks
实现,直到.NET 4.0才引入。因此,
并行
模块在.NET 2.0版本的FSharp.Core.dll中的
阵列
上不存在。如果您将目标重新设定为4.0,它将起作用

它在FSI中工作,因为FSI在.NET4环境中运行

namespace X  // not sent to interactive
open Microsoft.FSharp.Collections
module M = 
  let square  (a _[]) = Array.map          (fun a ->  a*a ) // OK        
  let squareP (a:_[]) = Array.Parallel.map (fun a ->  a*a ) // Error: "Parallel" not defined