Created
November 27, 2015 21:27
-
-
Save timsgardner/ee02efbfb5265931274a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; works | |
(-> [[1 0] [1 0]] | |
(System.Linq.Enumerable/SelectMany identity) | |
vec) | |
;; doesn't | |
(-> [[1 0] [1 0]] | |
(System.Linq.Enumerable/SelectMany identity) | |
(System.Linq.Enumerable/Distinct (type-args System.Linq.Enumerable)) | |
vec) |
nasser
commented
Nov 27, 2015
ah right forgot order of type-args
still doesn't work, different error tho
(-> [[1 0] [1 0]]
(System.Linq.Enumerable/SelectMany identity)
(#(System.Linq.Enumerable/Distinct (type-args System.Collections.IEnumerable) %))
vec)
Ah, the type-arg for Distinct is the type of element in the collection, Object
in this case. This does it
(->> (System.Linq.Enumerable/SelectMany [[1 0] [1 0]] identity)
(System.Linq.Enumerable/Distinct (type-args System.Object))
vec)
;; [1 0]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment