哪个违反"Seq"?与"seq"一起? [英] Which defferences "Seq" with "seq" ?

查看:92
本文介绍了哪个违反"Seq"?与"seq"一起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我担心何时不知道何时可以使用"Seq","seq".你能告诉我哪些违规吗?

I'm worried when don't know when you can use "Seq" , "seq" . Can you tell me which defferences are ?

这是我的代码.为什么不使用"seq"?

This's my code . Why dont't use "seq" ?

 let s = ResizeArray<float>()
 s.Add(1.1)
 s.Add(2.2)
 s.Add(3.3)
 s.Add(4.4)
 s |> Seq.iter (fun x -> printfn("%f") x )

推荐答案

Seq是一个包含使用seq值的函数的模块:

Seq is a module that contains functions that work with seq values:

Seq.map string [ 1; 2 ]
Seq.sum [ 1; 2 ]


seq是类型名称:


seq is a type name:

let f1 (xs : seq<int>) = ()
let f2 (xs : int seq) = ()


seq也是将诸如列表之类的内容转换为类型seq的函数:


seq is also a function that converts something like a list into the type seq:

seq [ 1; 2 ]


seq { ... }计算表达式:

seq { yield 1; yield 2 }

这篇关于哪个违反"Seq"?与"seq"一起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆