Reputation: 1
I am a beginner in yesod. I am trying to add a piece "/designmulti/key/#Int/name/#String/finished/#Bool PutDesignMultiR PUT" in the routes file of yesod, but get an error:
Foundation.hs:46:1:
No instance for (PathPiece Bool)
arising from a use of `toPathPiece'
Possible fix: add an instance declaration for (PathPiece Bool)
Does that mean that yesod only supports Int and String, but not Bool? How to fix it? Any hints will be appreciated! Thanks.
Upvotes: 0
Views: 84
Reputation: 186
Yesod parses url path parameters using PathPieces instances of the corresponding type. In order to parse a Bool param you need to add instance PathPiece Bool
which should describe the way you want to parse a bool from a piece of uri path.
Upvotes: 1