嵌入更高的kinded类型(monads!)到无类型的lambda演算中 [英] Embedding higher kinded types (monads!) into the untyped lambda calculus

查看:135
本文介绍了嵌入更高的kinded类型(monads!)到无类型的lambda演算中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 例子:
zero可以通过高阶函数在无类型的lambda微积分中编码各种类型。 =λfx。 x
one =λfx。 fx
two =λfx。 f(fx)
three =λfx。 f(f(fx))


true =λtf。 t
false =λtf。 f

tuple =λxyb。 b x y
null =λp。 p(λxy。false)

我想知道是否有任何研究嵌入了其他不太常规的类型。如果存在一些断言可以嵌入任何类型的定理,那将是非常光明的。也许有限制,例如只有类型*可以被嵌入。



如果确实可以表示不太常规的类型,那么看到一个例子就太棒了。我非常希望看到monad类型类的成员是什么样的。

你正在混合类型级别与价值水平。在无类型的lambda微积分中,没有单子。可以有monadic操作(值级别),但不是monad(类型级别)。但是,操作本身可以是相同的,所以你不会失去任何表达力。所以这个问题本身并不合理。


It's possible to encode various types in the untyped lambda calculus through higher order functions.

Examples:
zero  = λfx.      x
one   = λfx.     fx
two   = λfx.   f(fx)
three = λfx. f(f(fx))
etc

true  = λtf. t
false = λtf. f

tuple = λxyb. b x y
null  = λp. p (λxy. false)

I was wondering if any research has gone into embedding other less conventional types. It would be brilliant if there is some theorem which asserts that any type can be embedded. Maybe there are restrictions, for example only types of kind * can be embedded.

If it is indeed possible to represent less conventional types, it would be awesome to see an example. I'm particularly keen on seeing what the members of the monad type class look like.

解决方案

You are mixing up the type level with the value level. In untyped lambda calculus there are no monads. There can be monadic operations (value level), but not monads (type level). The operations themselves can be the same, though, so you don't lose any expressive power. So the question itself doesn't really make sense.

这篇关于嵌入更高的kinded类型(monads!)到无类型的lambda演算中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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