NonEmptyList map gives me :: Seq<'b>
See original GitHub issuegiven a NonEmptyList<'a>
and running that thru FSharpPlus.Operators.map
I am getting a Seq<'b>
where as I expected it to return a NonEmptyList<'b>
. What am I doing wrong?
Only when I fully qualify the call to map like
NonEmptyList.map transform someNonEmptyList
the result is the correct type of functor
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
NonEmptyList
A data type which represents a non empty list of A, with single element (head) and ... to the Order of the keys...
Read more >Collapse / Flatten cats Seq / List of cats.Validated
I've tried foldMap and traverse but invarialby run into issues that I don't have a Monoid in scope, and I feel like cats...
Read more >.filter(_.nonEmpty).map(_.get)
I quite often need to create a list of objects of a initial sequence of data where not all elements results in newly...
Read more >NonEmptyList (FSharpPlus)
Returns a list that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given...
Read more >Map Labeling Algorithms with Application in Graph ...
In this thesis, we propose an alternative formulation to the map labeling problem, which addresses these ... who gave me help and support...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mausch the instance is within the class. Although now that FsControl was merged, we can put it in the Invokable, I have the impression that is good to keep the separation and only specify instances for primitive types in the Invokables.
@robkuz I think this issue was recently solved here but probably you are using the latest nuget which is previous to that fix.
The problem is that in some cases interfaces “eat” all instances before the instance declared in the type. This happens because F# does some automatically conversions (upcasts) in some situations.
So I did some workarounds to give either less priority to the interfaces overload, in cases where it’s still usable, or to reject compiling it unless it’s explicitly upcasted as an interface, which is the case of the functor for
NonEmptyList
.Try the latest code and let me know if it works in your scenario. If so I will see if I can upload a new nuget tonight.
Seems to work!