Lambda F#在字符串数组上使用List.map

Lambda F#在字符串数组上使用List.map,lambda,f#,functional-programming,Lambda,F#,Functional Programming,我试图使用F#的List.map函数调用我在数组中的每个字符串上编写的函数。这是我写的函数 (*Takes a string and filters it down to common text characters*) let filterWord wordToFilter = Regex.Replace(wordToFilter, "[^a-zA-Z0-9/!\'?.-]", ""); 这是我的主要方法,我称之为 (*Main method of the program*) [&

我试图使用F#的List.map函数调用我在数组中的每个字符串上编写的函数。这是我写的函数

(*Takes a string and filters it down to common text characters*)
let filterWord wordToFilter = 
    Regex.Replace(wordToFilter, "[^a-zA-Z0-9/!\'?.-]", "");
这是我的主要方法,我称之为

(*Main method of the program*)
[<EntryPoint>]
let main argsv =
    let input = File.ReadAllText("Alice in Wonderland.txt"); //Reads all the text into a single string
    let unfilteredWords = input.Split(' ');
    let filteredWords = unfilteredWords |> List.map(fun x -> filterWord(x));
    0;
将input.split更改为硬编码字符串数组可以修复错误,因此它与F#未实现input.split的结果有关,因为它是字符串数组,因此可以与map函数一起使用。我只是不知道如何更改代码,使其实现我想要实现的目标。我对F#还比较陌生,所以如果能得到任何帮助,我将不胜感激

F#未实现input.split的结果可以与map函数一起使用,因为它是一个字符串数组

List.map
作用于
List
s,因此F#意识到结果不能与
List.map
一起使用。改为使用(适用于阵列)

F#未实现input.split的结果可以与map函数一起使用,因为它是一个字符串数组

List.map
作用于
List
s,因此F#意识到结果不能与
List.map
一起使用。改为使用(适用于阵列)

Error       Type mismatch. Expecting a
    string [] -> 'a    
but given a
    'b list -> 'c list    
The type 'string []' does not match the type ''a list'