Haskell中Bottom的概念 [英] The concept of Bottom in 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屋!