Change Collections.fs functions to use the Result type instead of the Choice type
dam5s opened this issue · 2 comments
dam5s commented
I was wondering why the Choice type is used in this file:
https://github.com/SuaveIO/suave/blob/master/src/Suave/Utils/Collections.fs
I was trying to use the HttpRequest.header function and was having a hard time going up the chain to find out what was actually returned. In the end I found the Collections functions.
Is there a particular reason for the usage of the Choice type instead of the Result type for these functions? It would be a lot easier to understand the API if it was returning a Result instead.
If there is a specific reason why Result is not good enough in that case, I would really like to know. Feel free to close the issue if that's the case too.
Thanks!
ademar commented
Because the type `Result` did not existed when the API was designed; it
was introduced with F# 4.1
Nevertheless in the upcomming v3 we will be dropping `Choice` in favour of
`Result` and will be introducing many performance enhacements with the help
of `Span<'T>` and friends.
…On Tue, Dec 4, 2018, 12:26 PM Damien LeBerrigaud ***@***.*** wrote:
I was wondering why the Choice type is used in this file:
https://github.com/SuaveIO/suave/blob/master/src/Suave/Utils/Collections.fs
I was trying to use the HttpRequest.header function and was having a hard
time going up the chain to find out what was actually returned. In the end
I found the Collections functions.
Is there a particular reason for the usage of the Choice type instead of
the Result type for these functions? It would be a lot easier to understand
the API if it was returning a Result instead.
If there is a specific reason why Result is not good enough in that case,
I would really like to know. Feel free to close the issue if that's the
case too.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#718>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIl_GudQzfpq4SEUXriYK-nXVBlbLo2ks5u1rA4gaJpZM4ZBI63>
.
dam5s commented
Oh great, thanks for the quick feedback!