Haskell中Bottom的概念 [英] The concept of Bottom in Haskell

查看:113
本文介绍了Haskell中Bottom的概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里描述的 Haskell的底部据说是任何有错误的计算,没有终止,或涉及无限循环,是任何类型...这是Haskell特有的?我们知道,在格点理论中,还有一个底部的概念,并且不应该根据定义的顺序来定义底部吗?

解决方案

确实存在定义的顺序,其中bottom是最小定义的值。查看该页面,了解关于Haskell中的指称语义,以获得更详细的解释。



以下是来自Wiki页面的 Maybe Bool 值的格子。它显示 Just True 的定义比更多地定义了⊥,它比




Bottom in Haskell described here is said to be any computation that have errors, is unterminated, or involves infinite loop, is of any type... is this specific to Haskell? We know in Lattice theory, there is also a notion of Bottom there.....and shouldn't Bottom be defined based on what's the order defined?

解决方案

Indeed there is an order of definedness, where bottom is the least defined value. Have a look at this page about denotational semantics in Haskell for a more thorough explanation.

Here is a lattice for the values of Maybe Bool taken from the wiki page. It shows that Just True is more defined than Just ⊥ which is more defined than .

这篇关于Haskell中Bottom的概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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