문제

My issue is:

No instance for (Monad (FormInput (HandlerT App IO)))

is such code:

postTest :: Handler Value
postTest = requireAuthId 
           >>= \ pId -> runInputPost $ (,) <$> ireq intField "a" 
                                           <*> ireq intField "b" 
           >>= \ (a, b) -> return $ toJSON $ object []

How can I solve this issue? How will the instance look like?

도움이 되었습니까?

해결책

Looks like a syntax issue to me, I think you just need to wrap runInputPost..."b" inside parentheses. But is there a reason you're not using do-notation for this? I'd find it more natural, and less likely to lead to these syntax errors.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top