如果我有一个像这样的解析器:
notZeroOrOne :: Parser Char
notZeroOrOne = noneOf ['0' , '1']
Run Code Online (Sandbox Code Playgroud)
有没有办法我可以结合另一个解析器的规则,如digitChar,所以我可以得到一个只有两个解析器都会通过的解析器?
就像是
biggerThanOne :: Parser Char
biggerThanOne = digitChar && notZeroOrOne
Run Code Online (Sandbox Code Playgroud) 在堆栈外运行美味测试时,我需要将字符串“失败日志”作为美味模式参数传递。
这在 bash 中非常简单:
PS C:\Pyrethrum> stack test --fast --ta "-p \"fail log\""
但尝试使用 Powershell 实现同样的目标让我抓狂:
PS C:\Pyrethrum> stack test --fast --ta "-p ""fail"" "
当没有空间时可以工作(运行测试)
PS C:\Pyrethrum> stack test --fast --ta "-p ""fail log"" "
解析目标时出错:找不到目录:日志
PS C:\Pyrethrum> stack test --fast --ta "-p `"fail log`""
尝试安装一个名为 log 的包
PS C:\Pyrethrum> stack test --fast --ta "-p \"fail log\""
选项 --ta:未终止的字符串:endOfInput
PS C:\Pyrethrum> stack test --fast --ta "-p /fail log/ "
...构建但模式需要引号
除虫菊-0.1.0.0:测试(套件:除虫菊测试,参数:-p /失败日志/)
选项-p:无法解析模式
让它在 Powershell 中运行的正确命令行是什么?
使用基于“Purescript by Example”第 5 章中的示例的函数,并且对如何声明多态行类型感到有些困惑。
以下编译正常
type Student = {
first :: String,
last :: String,
class :: String
}
type GymMember = {
first :: String,
last :: String,
benchPressPB :: Int
}
daveG :: GymMember
daveG = {
first: "Dave",
last: "Bro",
benchPressPB: 300
}
philS :: Student
philS = {
first : "Dave",
last : "Swat",
class : "1A"
}
schoolRollName :: forall t15.
{ last :: String
, first :: String
| t15
} -> String …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 TypeScript 启动并运行 VSCode,但收效甚微。
我正在查看以下内容:
https://code.visualstudio.com/docs/languages/typescript
看起来一旦你安装了编译器 VSCode 应该就可以工作了,但给出了以下内容:
配置文件
{
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"esModuleInterop": true
}
}
Run Code Online (Sandbox Code Playgroud)
包.json
{
"name": "blahh",
"version": "1.0.0",
"description": "tryme",
"main": "index.js",
"author": "ghost",
"license": "MIT",
"devDependencies": {
"typescript": "^3.4.5"
}
}
Run Code Online (Sandbox Code Playgroud)
任务文件
{
"version": "2.0.0",
"tasks": [
{
"label": "tsc-watch",
"command": "tsc",
"args": ["-w", "-p", "."],
"type":"shell",
"isBackground": true,
"group":"build",
"problemMatcher": "$tslint5",
"presentation":{
"reveal": "always",
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
项目
HelloWorld.ts
function sayHello(name: string): void {
console.log(`Hello ${name}!`);
} …Run Code Online (Sandbox Code Playgroud)