【发布时间】:2011-04-21 07:10:16
【问题描述】:
我正在使用 haskell 创建简单的 Web 应用程序。首先我在前面使用了 Snap,我能够运行应用程序,但我想向应用程序添加用户输入。
我找不到将用户输入参数获取到函数的方法。我该怎么做?
其他的,我也用了Happstack框架,我不能导入“Happstack.Server”。我使用 cabal 安装配置 Happstack。它已成功安装,但是当我尝试导入“Happstack.Server”时,它给了我一个错误:
<no location info>:
Could not find module `Happstack.Server':
it is not a module in the current program, or in any known package.
如果我使用ghc --make HelloWorld.hs -v 运行我的程序,我会得到:
Glasgow Haskell Compiler, Version 6.12.1, for Haskell 98, stage 2 booted by GHC version 6.12.1
Using binary package database: /usr/lib/ghc-6.12.1/package.conf.d/package.cache
Using binary package database: /home/udeshika/.ghc/i386-linux-6.12.1/package.conf.d/package.cache
package happstack-6.0.0-0f0c2507d590ebd01e8601c8667ec809 is unusable due to missing or recursive dependencies:
happstack-ixset-6.0.0-4e1b5476a551c4501c5734b22e0b280d happstack-server-6.0.3-6d71e7bb09489130538fb851a694b927 happstack-state-6.0.0-0e753e61d7092b6a5139e473113877a1 happstack-util-6.0.0-4156bd1331b7a0d62e0087101c9eba1c
package happstack-ixset-6.0.0-4e1b5476a551c4501c5734b22e0b280d is unusable due to missing or recursive dependencies:
happstack-util-6.0.0-4156bd1331b7a0d62e0087101c9eba1c
package happstack-server-6.0.3-6d71e7bb09489130538fb851a694b927 is unusable due to missing or recursive dependencies:
happstack-util-6.0.0-4156bd1331b7a0d62e0087101c9eba1c hslogger-1.1.4-90c801c802eec92e4e6a6f83d24d58d9 network-2.2.1.7-72dad7eb07ee7a683982f7475b8a449f network-bytestring-0.1.3.4-937fd511949a2d5ef21e86ec5306c791 sendfile-0.7.3-137cf51cc81a277d724637a7cd1e6b09
package happstack-state-6.0.0-0e753e61d7092b6a5139e473113877a1 is unusable due to missing or recursive dependencies:
happstack-util-6.0.0-4156bd1331b7a0d62e0087101c9eba1c hslogger-1.1.4-90c801c802eec92e4e6a6f83d24d58d9
package happstack-util-6.0.0-4156bd1331b7a0d62e0087101c9eba1c is unusable due to missing or recursive dependencies:
hslogger-1.1.4-90c801c802eec92e4e6a6f83d24d58d9 network-2.2.1.7-72dad7eb07ee7a683982f7475b8a449f
package hslogger-1.1.4-90c801c802eec92e4e6a6f83d24d58d9 is unusable due to missing or recursive dependencies:
...................
【问题讨论】:
-
当我们在 web 框架中时,你检查过 yesod 吗?我个人的看法是,它看起来比 snap 和 happstack 一起更有希望 100 倍。为什么?因为它更活跃,所以我每周都会看到 Yesod 的每日推送和博客文章。链接:yesodweb.com
-
1) ghc-pkg 列表 2) 如果:ghci >import Happstack.Server
-
thanxx 的回复,我尝试使用 yesod ,@Tarrasch 我无法安装 yesod,当我尝试安装时会出现配置错误
-
thaxx 回复@voidizard,我没有得到你在这里所说的,我尝试了 1) 一个它显示所有 ghci 包,2) 是什么???
-
看看下面我的回答。似乎阴谋集团的包裹被弄乱了——这种情况经常发生。我使用 cabal-dev 在 sanbox 中创建新项目,而不影响全局包。如果您不想处理沙盒,只需尝试清除所有包,安装 cabal,然后安装 Happstack。它应该工作。但是,如果您不想经常这样做,请使用 cabal-dev 或 capri
标签: haskell happstack haskell-snap-framework