如何打印类型(字符串(IO字符串))?

编程入门 行业动态 更新时间:2024-10-21 09:25:18
本文介绍了如何打印类型(字符串(IO字符串))?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 这是一个非常非常长的故事,我不会让你感到厌烦,但基本上,我设法让自己处于一种需要能够打印类型的情况。字符串(IO字符串)。任何帮助?

解决方案

解决方案是一个单线程....

print(print =<)

如果你想划分它是 Left 还是 Right 则需要更多介入,请参阅@ jamsihdh的答案。

请注意,这不能作为 Show 实例,因为对于类型 IO a 。

It's a very, very long story, and I won't bore you with it, but basically, I managed to get myself in a situation in which I need to be able to print the type Either String (IO String). Any help?

解决方案

The solution is a one liner....

either print (print =<<)

If you want to demarcate whether it was Left or Right it's a bit more involved, see @jamsihdh's answer.

Note that this cannot be made a Show instance, since nothing can be purely observed about values of type IO a.

更多推荐

如何打印类型(字符串(IO字符串))?

本文发布于:2023-11-08 13:51:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569552.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   类型   IO

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!