真实世界使用GADT [英] Real world use of GADT

查看:94
本文介绍了真实世界使用GADT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在实际使用广义代数数据类型时是否有很好的资源?



haskell wikibook 太短,无法让我深入了解GADT的真正可能性。

谢谢

解决方案

我已经在几个地方找到了提示monad(来自MonadPrompt包)以及来自运作软件包的等效程序monad,并结合GADT(它是如何使用它的),它使您可以非常便宜和非常灵活地制作嵌入式语言。 Monad Reader第15期,名为Three Monads冒险,它有一个很好的介绍Prompt monad以及一些现实的GADT。


Is there any good resource on real use of Generalized Algebraic Data Type?

The example given in the haskell wikibook is too short to give me an insight of the real possibilities of GADT.

Thanks

解决方案

I have found the "Prompt" monad (from the "MonadPrompt" package) a very useful tool in several places (along with the equivalent "Program" monad from the "operational" package. Combined with GADTs (which is how it was intended to be used), it allows you to make embedded languages very cheaply and very flexibly. There was a pretty good article in the Monad Reader issue 15 called "Adventures in Three Monads" that had a good introduction to the Prompt monad along with some realistic GADTs.

这篇关于真实世界使用GADT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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