您当前的位置: 首页 > 

mutourend

暂无认证

  • 0浏览

    0关注

    661博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Haskell打印调试信息

mutourend 发布时间:2019-07-10 14:51:00 ,浏览量:0

为了调试程序需要,将函数中的变量信息打印出来,支持以下方式:

import Debug.Trace
1、 IO action的情况

如 main:: IO()

main:: IO ()
main = do
  let x = 3
  print x
  putStrLn "Hello world"
2、 非 pure Monad情况,不支持IO

如:

numbers :: [Int]
numbers = do
  x             
关注
打赏
1664532908
查看更多评论
0.0390s