Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ghost
    @ghost~540393fe163965c9bc2018ce
      def coapplyX[Z, L <: TList, FL <: TList](
        tcs: Prod[FL]
      )(
        f: Cop[L] => Z
      )(
        implicit
        ev1: λ[a => Name[Default[a]]] ƒ L ↦ FL
      ): F[Z]
    in this type signature, how can I say that each of the as have an Inject[A, L]
    or is that sort of implied already
    Andy Scott
    @andyscott
    I've been slammed these last few days. I hope to catch up on this conversation this weekend.
    Ghost
    @ghost~540393fe163965c9bc2018ce
    :-D
    ignore everything else that I've wittered about... this is the only remaining issue I have
    although probably a bunch of my asInstanceOf usages should be folded into iota as libs, or utilities
    Ghost
    @ghost~540393fe163965c9bc2018ce
    I tried adding a TMap to a new new A, and then asking for the evidence InjectL[A, L] but it broke code that called it
    I may have a hack...
    it might involve casting, but I've convinced myself that there is enough evidence to do it.
    there is rather a lot of .asInstanceOf going on here that I'd like to see moved into library code
    Ghost
    @ghost~540393fe163965c9bc2018ce
    should Prod be represented by Array rather than Seq?
    Andy Scott
    @andyscott
    I think there was a reason I used seq. I'll have to double check.
    Prod hasn't had much love until now
    Ghost
    @ghost~540393fe163965c9bc2018ce
    I have a big list of requests now :-) basically, everywhere I'm using asInstanceOf with a big comment to explain why I think it's ok. :-D
    Let me know when you're all settled and have some time and I'll walk you through it.
    Andy Scott
    @andyscott
    Tomorrow PM at the earliest, Pacific Time
    Ghost
    @ghost~540393fe163965c9bc2018ce
    is there any evidence for "non empty TList"?
    Andy Scott
    @andyscott
    No, but you could write one temporarily using inductive implicits
    Ghost
    @ghost~540393fe163965c9bc2018ce
    btw, I think I now have the complete list of features that scalaz-deriving needs from iotaz... it is a simple case of grepping my codebase for .asInstanceOf :stuck_out_tongue:
    I think I used mathematical reasoning correctly everywhere (except the assumption of non-empty TList where Coproducts are concerned)
    but my priority right now is a Generic thing... any chances of you writing something like that anytime soon? Or should I take it on?
    Andy Scott
    @andyscott
    There's a stale PR for generic derivation of types. I need to write the value level transformations now.
    Sorry. Representations of types, not derivation.
    Ghost
    @ghost~540393fe163965c9bc2018ce
    when you say generic derivation, do you mean Generic or are you trying to do something like scalaz-deriving?
    btw... I think you only need to read IotaHelpers.scala here to see everything I'd like https://gitlab.com/fommil/scalaz-deriving/tree/master/scalaz-deriving/src/main/scala/scalaz
    although I do a couple of .asInstanceOf calls in Derivez.scala too...
    probably I should move that into the common layer
    the only reasonably complex method is mapMaybe on Cop which probably should be composed into several parts
    Andy Scott
    @andyscott
    I mean something like Generic
    Ghost
    @ghost~540393fe163965c9bc2018ce
    hmm, actually the .asInstanceOf uses in Derivez.scala look pretty trivial... I think it might just be the zip I asked for before and a .get on a Cop
    Andy Scott
    @andyscott
    I don't aspire to do ant generic derivation in iota
    Any*
    Ghost
    @ghost~540393fe163965c9bc2018ce
    ah sweet, ok well I'll take a look at that... it's exactly what I need
    and I think the Generic macro belongs in iotaz
    but I'll be relying on it heavily
    worst case scenario, I can write a converter to/from shapless.Generic for now
    Andy Scott
    @andyscott
    frees-io/iota#53
    Ghost
    @ghost~540393fe163965c9bc2018ce
    I seen it already but didn1't look at the code
    Andy Scott
    @andyscott
    Aah got it. 😀
    Ghost
    @ghost~540393fe163965c9bc2018ce
    ok I had a look at the code in the PR @andyscott I'm not sure I understand a lot of it. Maybe I need to look with a clean head
    Ghost
    @ghost~540393fe163965c9bc2018ce
    I might be able to write a custom macro just for my uses in the meantime, probably not considering any of the corner cases, e.g.
        implicit val equal: Equal[Bar] = {
          import iotaz._
          import iotaz.TList._
          import scala.Predef.implicitly
    
          val tcs = Prods.from1T(Name(implicitly[Equal[String]]))
          val from = (ts: Prod[String :: TNil]) =>
            Bar(ts.values(0).asInstanceOf[String])
          val to = (bar: Bar) => Prods.from1T(bar.s)
    
          Derivez[Equal].xproductz(tcs)(from, to)
        }
    that seems very regular
    is there a way to do the index lookup and get the correct type?
    oh, and you have the macro for the creation side, I should use that instead
    Ghost
    @ghost~540393fe163965c9bc2018ce
    yeah, a macro to use the literal type of the integer passed to a Prod and expand it into the relevant .value call would be pretty awesome
    Andy Scott
    @andyscott
    Let's move to the https://gitter.im/frees-io/iota room
    Ghost
    @ghost~540393fe163965c9bc2018ce
    There's another room? :-O