为什么scala无法推断方法参数的类型(why scala can't infer the type of method parameters)
我想知道为什么斯卡拉不能推断方法参数的类型。我可以看到,在haskel(它也有类型推理)可以做同样的事情。 那么为什么不为Scala?
I am wondering why scala can't infer the type of method parameters.I can see that in haskel (which also has type inference) can do the same. Then why not for scala ?
原文:https://stackoverflow.com/questions/3871051
更新时间:2021-05-10 21:05
最满意答案
You can do the following:
rm [^IN]*
The
[^IN]
is a pattern that matches any character exceptI
orN
- this syntax is described in the Pattern Matching section of the bash manual.
相关问答
更多-
通常的诀窍是 rm ./--1355509766.jpg 更新:这里是man rm对此的评论: To remove a file whose name starts with a '-', for example '-foo', use one of these commands: rm -- -foo rm ./-foo The usual trick is rm ./--1355509766.jpg Update: here's what man rm has t ...
-
如何从Linux中的shell中删除以._开头的所有文件?(How can I delete all files starting with ._ from the shell in Linux?)[2023-06-15]
尝试以下方法: cd /path/to/directory; \rm -rf ._* 或者,如果子文件夹中有递归文件,请尝试: find /path/to/directory -name "._*" -type f -print0| xargs -0 \rm -rf Try something like: cd /path/to/directory; \rm -rf ._* OR if there are recursive files with in subfolders then try: fin ... -
rm -- --testings.html --选项告诉rm将所有进一步的参数视为文件名,而不是作为选项,即使它们以-开头。 这对rm命令不是特别的。 getopt函数实现它,许多(所有?)UNIX风格的命令以相同的方式对待: --终止选项处理,任何事情都是一个常规参数。 http://www.gnu.org/software/hello/manual/libc/Using-Getopt.html#Using-Getopt rm -- --testings.html The -- option tell ...
-
你需要一个正则表达式: $text = preg_replace( '/\$[a-z]+/i', 'game', $text); You'll need a regex for this: $text = preg_replace( '/\$[a-z]+/i', 'game', $text);
-
您可以执行以下操作: rm [^IN]* [^IN]是匹配除I或N以外的任何字符的模式 - 此语法在bash手册的模式匹配部分中进行了描述。 You can do the following: rm [^IN]* The [^IN] is a pattern that matches any character except I or N - this syntax is described in the Pattern Matching section of the bash manual.
-
Java有一个完整的正则表达式实现 ,可以用一行代码解决您的问题: final String test = "123absäöü#+a"; final String result = test.replaceAll("[^\\p{IsDigit}\\p{IsAlphabetic}]", ""); System.out.println(result); [^\\p{IsDigit}\\p{IsAlphabetic}]意思是: []任何字符(基于括号内的定义) ^不是 \\p{IsDigit}一个数字 \\p ...
-
您可以使用: grep -Ev '^([A-Z]|.$)' file abjurer abkar abkari ablach ablactate ablactation 或者使用sed来保存更改: sed -i.bak -r '/^.$|[A-Z]/d' file You can use: grep -Ev '^([A-Z]|.$)' file abjurer abkar abkari ablach ablactate ablactation Or use sed to save changes ...
-
File dir = new File("."); if(!dir.isDirectory()) throw new IllegalStateException("wtf mate?"); for(File file : dir.listFiles()) { if(file.getName().startsWith("@")) process(file); } 重新审视后,事实证明你还可以做其他事情。 注意我使用的文件过滤器。 import java.io.File; class ...
-
从wordnet中提取以特定字母开头的所有单词(Extracting all the words starting with a particular letter from wordnet)[2022-05-27]
我能看到的最简单的方法是从这里下载他们的数据库,然后解析每行中第5个元素的空格分隔数据文件(data.adj,data.adv,data.noun,data.verb)并将它们放入相关的数据结构。 可能是一个Hash表,其中以起始字母为键,每个元素为以该字母开头的单词数组。 无论您使用动态数组还是常规数组,然后首先解析文件以获取每个字母的单词数(数组大小)取决于您。 下面的代码示例用C语言编写,并通过wordnet数据文件读取并打印出有问题的单词。 它绝不是抛光的,很快就会制成。 #include如何从日志文件中删除以特定字符串开头的每一行?(How to remove every line starting with specific string from log file?)[2023-11-17]
用awk : awk '/\[null/{next} 1' filename.log 或者,用awk否定匹配 awk '!/\[null/' filename.log # Thanks George Vasiliou! 或者,颠倒你对sed的意义并将其作为默认打印,但删除匹配的模式: sed '/\[null/d' filename.log 或者,没有打印sed否定打印(这有点令人困惑......) sed -n '/\[null/!p' filename.log 而grep : gre ...相关文章
更多- spark--scala-douban模仿做了个python的版本
- Scala定义变量
- Java泛型父类取得子类的泛型参数T的Class类型
- Solr的Scala客户端(scalikesolr)介绍
- Scala函数定义与调用
- scala数组操作
- scala下载与安装
- HTTP Content-Type 内容类型详解
- 研磨设计模式之工厂方法模式(Factory Method)-模式讲解2
- 研磨设计模式之工厂方法模式(Factory Method)-模式讲解3
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)