Navigation Menu

Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Generalize SortedPolyTransforms into EvidenceGuidedPolyTransforms #28

Closed
julienrf opened this issue Feb 13, 2017 · 0 comments
Closed

Generalize SortedPolyTransforms into EvidenceGuidedPolyTransforms #28

julienrf opened this issue Feb 13, 2017 · 0 comments

Comments

@julienrf
Copy link
Contributor

julienrf commented Feb 13, 2017

See #24 (comment)

The idea would be to reuse the same trait definition for polymorphic transformation methods (e.g. map) that take an additional implicit evidence parameter (e.g. Ordering[B], ClassTag[B], etc.).

retronym added a commit to retronym/collection-strawman that referenced this issue Mar 27, 2018
```
⚡ scala
Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_162).
Type in expressions for evaluation. Or try :help.

scala> class OfDim { Array.ofDim[Any](32) }
defined class OfDim

scala> :javap -c OfDim
Compiled from "<console>"
public class $line3.$read$$iw$$iw$OfDim {
  public $line3.$read$$iw$$iw$OfDim();
    Code:
       0: aload_0
       1: invokespecial scala#17                 // Method java/lang/Object."<init>":()V
       4: getstatic     scala#23                 // Field scala/Array$.MODULE$:Lscala/Array$;
       7: bipush        32
       9: getstatic     scala#28                 // Field scala/reflect/ClassTag$.MODULE$:Lscala/reflect/ClassTag$;
      12: invokevirtual scala#32                 // Method scala/reflect/ClassTag$.Any:()Lscala/reflect/ClassTag;
      15: invokevirtual scala#36                 // Method scala/Array$.ofDim:(ILscala/reflect/ClassTag;)Ljava/lang/Object;
      18: pop
      19: return
}

scala> class NewArray { new Array[Object](32) }
defined class NewArray

scala> :javap -c NewArray
Compiled from "<console>"
public class $line4.$read$$iw$$iw$NewArray {
  public $line4.$read$$iw$$iw$NewArray();
    Code:
       0: aload_0
       1: invokespecial scala#17                 // Method java/lang/Object."<init>":()V
       4: bipush        32
       6: anewarray     scala#4                  // class java/lang/Object
       9: pop
      10: return
}
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant