【发布时间】:2018-01-16 20:41:36
【问题描述】:
我想在我的 Yesod 应用程序中有一个接受 ID 列表的路由
从this page 看来,您可以在路线中使用 * 来接受列表,但是当我尝试它时
/api/user/#UserId UserR GET DELETE
/api/users/display/*UserIds DisplayR GET
我收到了错误
Not in scope: type constructor or class ‘UserIds’
Perhaps you meant one of these:
‘UserId’ (imported from Import.NoFoundation),
如何接受路由中的 UserId 列表?
【问题讨论】:
-
IIRC,它必须是
UserId而不是UserIds。 -
@Sibi 将其更改为 UserId 会出现错误“由于使用‘toPathMultiPiece’而导致 (PathMultiPiece UserId) 没有实例”
-
@Qwertie,听起来像是一个不同的问题;)
标签: haskell url-routing yesod