这个语法在Haskell中意味着什么:_ | _或(_ | _) [英] What does this syntax mean in Haskell: _|_ or (_|_)

查看:93
本文介绍了这个语法在Haskell中意味着什么:_ | _或(_ | _)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在许多受尊敬的文件中,我总是看到这个令人尴尬的事情: _ | _ (_ | _)

无法找到它的定义(Google对符号不适用)。那么究竟是什么呢?

here : -


底部



底部的数学符号是'⊥'。这是Unicode字符
22A5十六进制= 8869十进制。在HTML中也可用'⊥'和
LaTeX作为'\ bot'(在数学模式下)。在纯ASCII的情况下,它通常被写为
作为非常难看的字符序列'_ | _'


同样来自在Haskell中保留关键字



请访问wiki以了解底部和部分功能
$ b


要定义部分函数,​​我们引入一个特殊值⊥,命名为
bottom,并且通常写成 | 以打字机的字体。我们说⊥是
完全未定义的值或函数。每一个基本的数据类型
像Integer或()都包含一个⊥,除了它们通常的元素外。


href =http://blog.ezyang.com/2010/12/hussling-haskell-types-into-hasse-diagrams/ =noreferrer> here : -






I keep seeing this rather embarrassing thing in many respected documents: _|_ or (_|_)

Cannot find a definition of it (Google doesn't work well with symbols). So what is it anyway?

解决方案

From here:-

Bottom

The mathematical symbol for bottom is '⊥'. That's Unicode character 22A5 hex = 8869 decimal. Also available in HTML as '⊥' and in LaTeX as '\bot' (within math mode). In plain ASCII, it's often written as the extremely ugly character sequence '_|_'.

Also from the reserve keywords in Haskell.

Check the wiki for Bottom and Partial Functions

To define partial functions, we introduce a special value ⊥, named bottom and commonly written | in typewriter font. We say that ⊥ is the completely "undefined" value or function. Every basic data type like Integer or () contains one ⊥ besides their usual elements.

More description is given here:-

这篇关于这个语法在Haskell中意味着什么:_ | _或(_ | _)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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