mblink / AndXor

macro free typeclass composition over cheaply defined product and coproduct types
Apache License 2.0
0 stars 2 forks source link

try putting inject and lift instances in companion objects #2

Open beezee opened 6 years ago

beezee commented 6 years ago

if it works it eliminates need for imports and sets precedent for other provided typeclasses.

beezee commented 6 years ago

first crack - https://github.com/beezee/ldr/compare/fuck_a_duck

I don't think it's right, specifically I don't think that LDRK3[?[_], A1, A2, A3] matches constraint on H[_[_]] to be a subtype of LDR. BUT that's not what has the compiler complaining.

What I'm seeing is this https://github.com/scala/bug/issues/9445 and whether or not the concern in prior paragraph is waiting behind it or not, I'm not sure I have a path to even find out.

beezee commented 6 years ago

oh ha this was an attempt to put transform in companion not inject and lift. Those are probably (hopefully? simpler)

beezee commented 6 years ago

LOLOLOLOLOLOLOL - https://github.com/beezee/ldr/compare/fuck_another_duck

proven it works, tested ok when manually added to 3 arity. generate whole cloth, compiler doesn't terminate.

motherfucker.

compile performance is always going to be a top fucking priority for this. it's methadone for scala devs.

side note, why I needed to import companion object for resolution to work, idk. am I stupid or is it a broken promise?

beezee commented 6 years ago

AHAHAHAHAHAHAHAHA non terminate spoke too soon.

image

beezee commented 6 years ago

for posterity, master branch:

image

beezee commented 6 years ago

look back at this with compiler statistics on. there's some interesting data to take. hunch right now is that iota wouldn't even have been an issue, mainly the matches on \/ in the iota helpers were costing time in patmat.