Closed mlegenhausen closed 5 years ago
Absolutely! I would also like to port fp-ts-routing
to classless because I use it in conjunction with hyper-ts
.
@gcanti could you provide a 0.5.0-lib
version? I would like to use it directly in my project.
could you provide a 0.5.0-lib version?
done
I would also like to port fp-ts-routing to classless because I use it in conjunction with hyper-ts
Is there a problem with the current APIs?
@gcanti thanks I will try it out :)
Not a "problem" but having a mix of class and classless api is harder to read and understand for newcomers. I am planing to onboard a few of my team members with no FP experience (which is already hard) and giving them some patterns (use pipe
) to work with fp-ts
with a minimum amount of exceptions.
I think it would be enough to have the pipe operators available. So I can define routes like this
const home = pipe(
M.lit('home')
M.then(end)
)
const user = pipe(
M.lit('user'),
M.then(str('userId')),
M.then(end)
)
const router: Parser<Location> = fold(getParserMonoid<Location>())([
pipe(home.parser, P.map(...)),
pipe(user.parser, P.map(...))
])
Closing in favour of https://github.com/gcanti/hyper-ts/pull/21
Thanks @mlegenhausen, I'm working on an upgrade as well (branch
0.5.0
). I was thinking of removing theclass
encoding, what do you think?