我想测试用户是否已通过身份验证并显示“登录”或“注销”链接,具体取决于状态。测试用户是否已登录哈姆雷特模板
到目前为止,我有
$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