我想測試用戶是否已通過身份驗證並顯示「登錄」或「註銷」鏈接,具體取決於狀態。測試用戶是否已登錄哈姆雷特模板
到目前爲止,我有
$maybe muid <- maybeAuthId
<a [email protected]{AuthR LogoutR} >Logout
$nothing
<a [email protected]{AuthR LoginR} >Login
,但我得到一個錯誤:
Couldn't match expected type `Maybe v0'
with actual type `GHandler s0 m0 (Maybe (AuthId m0))'
In the first argument of `Text.Hamlet.maybeH', namely `maybeAuthId'
很酷的謝謝。一般來說,我慢慢獲得monad和haskell的竅門。 – 2012-08-02 16:01:32