-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strict types for applicatives #207
Conversation
See if type inference improves like this
This reverts commit cb2f49f.
I tested with fea4b08 but it seems to failing to redirect. Microsoft (R) F# Interactive version 10.2.3 for F# 4.5
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> open FSharpPlus.TypeLits;;
> let v = vector ((fun i -> i + 1), (fun i -> i * 2));;
[<Struct>]
val v : Vector<(int -> int),S<S<Z>>> = [|<fun:v@2>; <fun:v@2-1>|]
> let u = vector (2, 3);;
[<Struct>]
val u : Vector<int,S<S<Z>>> = [|2; 3|]
> v <*> u;;
[<Struct>]
val it : Vector<int,S<S<Z>>> = [|3; 6|]
> open FSharpPlus;;
> v <*> u;;
val it : seq<int> = seq [3; 4; 4; 6] |
Another update. |
This is passing now, but there are some breaking specially in the idiom brackets section. Now, if we put in the balance this regression against not having externally defined applicatives implementing interfaces working decently (namely something along a plain How we rollout this change? Possibly we would have to skip a 1.1 version and move directly to a 2.0 The open question is whether this could be improved in order minimize the regression. I spent a crazy amount of time looking at this, if I add the time accumulated in fighting applicatives it's probably the time required to fix the F# compiler to make them work properly for once. If I have more time, I will keep trying, but otherwise this would have to be merged. Thoughts? |
It's working now! Microsoft (R) F# Interactive version 10.2.3 for F# 4.5
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> open FSharpPlus.TypeLits;;
> let v = vector ((fun i -> i + 1), (fun i -> i * 2));;
[<Struct>]
val v : Vector<(int -> int),S<S<Z>>> = [|<fun:v@2>; <fun:v@2-1>|]
> let u = vector (2, 3);;
[<Struct>]
val u : Vector<int,S<S<Z>>> = [|2; 3|]
> v <*> u;;
[<Struct>]
val it : Vector<int,S<S<Z>>> = [|3; 6|]
> open FSharpPlus;;
> v <*> u;;
[<Struct>]
val it : Vector<int,S<S<Z>>> = [|3; 6|] I suppose very few people seriously uses idiom brackets, so these breaking changes are acceptable. |
Thanks for your feedback. #185 and #192 are not minor things, but at the same time they don't break anything. Regarding #205 it's not breaking 1.0 since it didn't exists at that time. So far this is the first serious reason to break 1.0, however I can think of other upcoming breaking changes:
|
105ed2c
to
d80a4ad
Compare
f92d910
to
39638fb
Compare
9b34ece
to
b2f3c8c
Compare
961285c
to
7979273
Compare
Continued in #569 |
This will switch to use the internal technique of
tuplingwrapping in order to avoid flexible types in overloads for the Applicative dispatcher.Right now there are 2 issues:
Types implementing
IEnumerable<_>
would default to theseq<_>
instance. This might be arguably desired.Types implementing
IEnumerable<_>
would default to theseq<_>
instance, even if they implement their own applicative instance. This is not acceptable.