Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Haskell 为什么tracMsg不起作用?_Haskell_Hxt - Fatal编程技术网

Haskell 为什么tracMsg不起作用?

Haskell 为什么tracMsg不起作用?,haskell,hxt,Haskell,Hxt,我在HXT库中看到,有两个功能用于在我的终端提示下发送消息,它们是: withTraceLevel 及 第一个函数“withTraceLevel”很有魅力,但第二个函数对我的代码不起作用,我是否遗漏了什么 我的代码示例: procIntersection = proc it -> do set1 <- (getChildren >>> withTraceLevel 5 traceTree >>> traceMsg 1 "*

我在HXT库中看到,有两个功能用于在我的终端提示下发送消息,它们是:

withTraceLevel

第一个函数“withTraceLevel”很有魅力,但第二个函数对我的代码不起作用,我是否遗漏了什么

我的代码示例:

procIntersection = proc it -> do
            set1 <- (getChildren >>> withTraceLevel 5 traceTree >>> traceMsg 1 "*********************************") -< it
            returnA -< Intersection { setI1 = OWLNothing, setI2 = OWLNothing{--set2--} }
通常,在第二个“content of”之后应该是一行:************ 但是那条线没有出现在那里

仅将所给箭头的跟踪级别设置为其第二个参数

在下面的代码中,withTraceLevel仅在traceTree执行期间启用跟踪并设置级别,而不是在其余执行期间

带TraceLevel 5 traceTree>>traceMsg 1“bla bla”
试试这个

withTraceLevel 5 (traceTree >>> traceMsg 1 "bla bla")
查看解释器中发生的情况:

$ghci
序曲>:m+Text.XML.HXT.Core Text.XML.HXT.Arrow.XmlState.TraceHandling
序曲…>runX$带TraceLevel 2$traceMsg 1“嗨!”
正在加载包数组-0.4.0.1。。。链接。。。完成。
加载。。。
--嗨!
[NTree(XTag”/“[])[]

你说它不工作到底是什么意思?你收到错误消息了吗?我没有收到任何来自traceMsg的消息!但是有了Tracelevel就行了!我在我的电脑上得到我的树提示terminal@Damiii虽然你已经接受了答案,但似乎你还没有获得赏金分数。它还开着,对不起!我想它会自动完成的!你明白了吗?:)@我收到了。谢谢如果它不是直接授予的,那么响应需要至少有2分才能在期末收到一半。很高兴听到这个消息!:)
content of:
============


---XTag "rdf:Description"

   |   "rdf:about"="http://www.xfront.com/owl/ontologies/camera/#Body"

content of:

============


---XTag "owl:Restriction"

    |

    +---XTag "owl:onProperty"
    |   |   "rdf:resource"="http://www.xfront.com/owl/ontologies/camera/#shutter-speed"
    |
    +---XTag "owl:cardinality"
      |   "rdf:datatype"="http://www.w3.org/2001/XMLSchema#nonNegativeInteger"
      |
      +---XText "0"




content of:

============


---XTag "rdf:Description"

 |   "rdf:about"="http://www.xfront.com/owl/ontologies/camera/#Camera"




content of:

============


---XTag "owl:Restriction"

   |

   +---XTag "owl:onProperty"

   |   |   "rdf:resource"="http://www.xfront.com/owl/ontologies/camera/#viewFinder"

   |

   +---XTag "owl:hasValue"

       |   "rdf:resource"="http://www.xfront.com/owl/ontologies/camera/#ThroughTheLens"
withTraceLevel 5 (traceTree >>> traceMsg 1 "bla bla")