用-hy-GHC堆分析-什么是*(星号)? [英] GHC heap profiling with -hy - What is * (star)?

查看:69
本文介绍了用-hy-GHC堆分析-什么是*(星号)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用-hy标志来分析程序的堆使用情况时,

When I profile my program's heap usage with -hy flag like

./prog +RTS -hy

我经常在结果中看到构造函数*以及其他构造函数,例如[]Word8.

I often see the constructor * in the results, along with other constructors such as [] and Word8.

在这种情况下,*是什么类型?与kinds有关吗?

What is the type * in this context? Is it related to kinds?

推荐答案

引自现实世界中的Haskell :

还有一些未知类型的堆分配数据(表示为"*"类型的数据).

There's also some heap allocated data of unknown type (represented as data of type "*").

并在 GHC用户指南中:

对于具有函数类型或未知/多态类型的闭包,字符串将代表实际类型的近似值.

For closures which have function type or unknown/polymorphic type, the string will represent an approximation to the actual type.

因此,这基本上意味着配置文件没有足够的信息来告诉它是什么类型.

So, it means basically that the profiling doesn't have enough information to tell what type it is.

这篇关于用-hy-GHC堆分析-什么是*(星号)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆