You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The functors here don't align, which leads to a compilation error. But on my machine, it took the compiler 21 seconds to arrive to that conclusion. This gets exponentially worse the more elements the list has, which makes sequence, sequenceGeneric etc. a pain to use for large structures.
This might be caused by the overly general derivation for Sequencer that has cases for Invariant and InvariantMonoidal typeclasses in addition to the obvious Apply. In comparison, with this stripped-down version of Sequencer the example takes less than a second to (fail to) compile:
Maybe we could keep the invariant versions and do a pattern match on the type class for the applicative ones.
The only reason to have both is optimization. Edit - I mean runtime optimization.
joroKr21
changed the title
Sequencer: Implicit complexity explodes when there is no common functor
[Scala 2] Sequencer: Implicit complexity explodes when there is no common functor
Sep 12, 2022
Consider this example:
The functors here don't align, which leads to a compilation error. But on my machine, it took the compiler 21 seconds to arrive to that conclusion. This gets exponentially worse the more elements the list has, which makes
sequence
,sequenceGeneric
etc. a pain to use for large structures.This might be caused by the overly general derivation for
Sequencer
that has cases forInvariant
andInvariantMonoidal
typeclasses in addition to the obviousApply
. In comparison, with this stripped-down version ofSequencer
the example takes less than a second to (fail to) compile:The text was updated successfully, but these errors were encountered: