我有以下剧本,Playbook和输出
目前没有错误,运行正常.但是,它不会将输出显示到控制台.我通过其他剧本遇到了这个并通过在剧本中添加以下任务来解决这个问题:
-debug: var=output.stdout_lines
Run Code Online (Sandbox Code Playgroud)
它打印输出.但是,我试图在上面的剧本中做同样的事情并且它说变量是未定义的(代码未显示,因为它不起作用).
是否有人知道更好的方法来输出打印到控制台而不使用-debug?任何ansible引用将不胜感激.
我有以下haskell代码处理添加多项式:
module PolyLA2 where -- defines the module name so you can import from another haskell file
type Coeff = Int
type Exp = Int
type Polynomial = [(Coeff, Exp)] -- a list of terms in a polynomial formula
addpoly::Polynomial -> Polynomial -> Polynomial
addPoly [] ys = ys -- Base case
addPoly xs [] = xs -- Base case
addPoly ((a,b):xs) ((c,d):ys)
| a == c = ((a, b + d) : (addPoly xs ys))
| a < c …Run Code Online (Sandbox Code Playgroud)