我有一个.tar.gz我需要提取的文件.我用GzipStream对象处理了gunzip位System.IO.Compression,但我找不到任何处理该命名空间中的tarball的东西.有没有办法.tar在Powershell中本地处理文件?请注意,我能够从Powershell脚本调用任何此类函数/方法/对象构造/系统二进制文件是非常重要的.它不需要实际写在powershell中.(如果重要的话我正在使用64位窗口10)
PS请不要说"使用7zip"; 那不是原生的
作为家庭作业的一部分,我正在尝试做一些非常简单的事情.我需要做的就是编写一个函数,该函数接收表示三角形的基本长度和高度长度的2元组数字列表,并返回与这些三角形对应的区域列表.其中一个要求是我通过定义一个函数并在where子句中声明其类型来实现这一点.到目前为止我尝试的所有东西都无法编译,这就是我所拥有的:
calcTriangleAreas xs = [triArea x | x<-xs]
where triArea:: (Num, Num) -> Num --this uses 4 preceding spaces
triArea (base, height) = base*height/2
Run Code Online (Sandbox Code Playgroud)
这失败了The type signature for ‘triArea’ lacks an accompanying binding,这对我来说听起来像triArea没有在where子句中定义.好吧,让我们缩进它以匹配where:
calcTriangleAreas xs = [triArea x | x<-xs]
where triArea:: (Num, Num) -> Num --this uses 4 preceding spaces
triArea (base, height) = base*height/2 --... and so does this
Run Code Online (Sandbox Code Playgroud)
这个无法编译特别无法提供的错误消息parse error on input triArea.只是为了好玩,让我们再尝试缩进它,因为idk还有什么可做的:
calcTriangleAreas xs = [triArea x | …Run Code Online (Sandbox Code Playgroud)