更改

跳到导航 跳到搜索
添加258字节 、 2021年10月12日 (二) 16:24
无编辑摘要
第3行: 第3行:     
== 笔记 ==
 
== 笔记 ==
 +
 +
=== printf debugging ===
 +
 +
<syntaxhighlight lang=haskell>
 +
import Debug.Trace
 +
 +
dbg :: Show a => String -> a -> a
 +
dbg msg x = trace (msg ++ " " ++ show x) x
 +
</syntaxhighlight>
 +
 +
使用方法:把变量 <code>x</code> 换成 {{code|haskell|2=(dbg "x =" x)}}。
    
=== <code>let</code> 与 <code>where</code> ===
 
=== <code>let</code> 与 <code>where</code> ===

导航菜单