I'm using Pux.Router
and can't get a path such as auth/facebook
to work. auth
works and facebook
works but not together. For example FacebookAuth <$> (lit "facebook" *> param "access_token") <*> (param "expires_in") <* end
works but not FacebookAuth <$> (lit "auth/facebook" *> param "access_token") <*> (param "expires_in") <* end
. It will compile but you cannot navigate to auth/facebook
.
Asked
Active
Viewed 62 times
0

torchhound
- 510
- 6
- 15
-
Could you post the code declaring the `Facebook` type, and the full matching code? – Tom Macdonald Sep 05 '17 at 12:48
-
Do you mean `FacebookAuth` or something else? – torchhound Sep 05 '17 at 18:03
1 Answers
0
I haven't used Pux.Router, but my thought is that you can only use single path components inside lit
, so having nested components in a single string won't work.
You might try separating the paths like this...
FacebookAuth <$>
(lit "auth" *> lit "facebook" *> param "access_token") <*>
(param "expires_in") <* end
Which will apply the access_token
and expires_in
parameters to the FacebookAuth constructor. So then it would match /auth/facebook/:access_token/:expires_in

Albtzrly
- 924
- 1
- 6
- 15
-
`FacebookAuth <$> (lit "auth" *> lit "facebook" *> param "access_token") <*> (param "expires_in") <* end` returns error `Could not match type Unit with type String`. – torchhound Aug 22 '17 at 03:02