當我嘗試編譯代碼時,發生兩個錯誤。 第一個是: Couldn't match expected type ‘ServerPartT IO a0’
with actual type ‘[Response]’
In a stmt of a 'do' block:
msum
(map (\ (a, b) -> dir a b)
$ routes
我找不到真正的方式來捕捉純函數在happstack應用程序中拋出的異常。我試過this solution。當IO函數拋出異常時,它可以很好地工作。但是,當純函數拋出異常時,它無法處理它。我的代碼: {-# LANGUAGE DeriveDataTypeable #-}
module Main where
import Prelude hiding(catch)
import Contro
我試圖用Happstack實現一個簡單的請求處理程序: main :: IO()
main = simpleHTTP nullConf app
app :: ServerPart Response
app = msum [
dir "hello" $ method GET >> helloGet
, dir "hello" $ method POST >> he
我有一些舊的代碼暴露了基於HTTP動詞的web API上的服務。我想移動這個項目來使用超媒體控件(HATEOAS)。我想知道是否有任何庫支持根據HAL或JSON-LD規範在子資源的資源表示中嵌入鏈接。我搜索了一下,但我找不到任何東西。很高興知道像Yesod,Snap或Happstack這樣的成熟項目是否計劃支持此功能? 編輯:爲了澄清,我感興趣的REST Maturity Model
我試圖通過小集團上的Arch Linux(3.12.9)安裝包,但得到這個錯誤: Resolving dependencies...
Configuring happstack-server-tls-7.1.0...
Failed to install happstack-server-tls-7.1.0
Last 10 lines of the build log (/home/boris