Haskell:ghci显示“Chunk .. Empty”吗? [英] Haskell: Does ghci show "Chunk .. Empty"?

查看:150
本文介绍了Haskell:ghci显示“Chunk .. Empty”吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

学习你一个Haskell 有这样的代码示例:

  ghci> B.pack [99,97,110] 
大块可以空白

B 代表 Data.ByteString.Lazy



但是我的 ghci 不显示 Chunk 数据构造函数。 p>

 > B.pack [99,97,110] 
can

Haskell开发者是否改变了方式打印 ByteString 的值是如何打印的?

显示实例 ByteString 介于 0.9.2.1 和 0.10.0.1 。请参阅 http:// hackage .haskell.org / packages / archive / bytestring / 0.10.2.0 / doc / html / src / Data-ByteString-Lazy-Internal.html#ByteString

添加:这里 a>是相关的补丁

Learn You a Haskell has a code example like this:

ghci> B.pack [99,97,110]  
Chunk "can" Empty  

(B stands for Data.ByteString.Lazy)

But my ghci does not show Chunk and Empty data constructors.

> B.pack [99,97,110]  
"can"

Did Haskell developers change the way the values of ByteString are printed?

解决方案

Looks like Duncan added hand-written Show instance for lazy ByteString somewhere between 0.9.2.1 and 0.10.0.1. See http://hackage.haskell.org/packages/archive/bytestring/0.10.2.0/doc/html/src/Data-ByteString-Lazy-Internal.html#ByteString

Add: Here is the relevant patch

这篇关于Haskell:ghci显示“Chunk .. Empty”吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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