Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 15 16:19

    alexarchambault on github_actions

    (compare)

  • Aug 15 16:19
    alexarchambault closed #308
  • Aug 15 16:19

    alexarchambault on main

    Bump coursier/setup-action from… (compare)

  • Aug 15 14:13
    dependabot[bot] labeled #308
  • Aug 15 14:13
    dependabot[bot] opened #308
  • Aug 15 14:13

    dependabot[bot] on github_actions

    Bump coursier/setup-action from… (compare)

  • Aug 12 16:09

    alexarchambault on main

    Update utest to 0.8.0 (#306) (compare)

  • Aug 12 16:09
    alexarchambault closed #306
  • Aug 12 12:08
    scala-steward opened #307
  • Aug 12 12:07
    scala-steward opened #306
  • Aug 11 09:05

    alexarchambault on master

    (compare)

  • Aug 11 09:05

    alexarchambault on 0.1.x

    (compare)

  • Aug 11 09:05

    alexarchambault on orphans

    (compare)

  • Aug 11 09:05

    alexarchambault on 1.1.x

    (compare)

  • Aug 11 09:05

    alexarchambault on 1.0.x

    (compare)

  • Aug 11 09:05

    alexarchambault on 0.3.x

    (compare)

  • Aug 11 09:05

    alexarchambault on 0.2.x

    (compare)

  • Aug 11 09:05

    alexarchambault on travis-scala-2.10

    (compare)

  • Aug 11 09:04

    alexarchambault on v1.3.1

    (compare)

  • Aug 11 09:03
    alexarchambault closed #303
Srepfler Srdan
@schrepfler
sorry :)
new to gitter
Alexandre Archambault
@alexarchambault
no worries :-)
Alexandre Archambault
@alexarchambault
do you have the definition of ReqClientAuth? (grepping in the generated code, or ctrl+B from intellij)
Srepfler Srdan
@schrepfler
yup
case class ReqClientAuth(reqclientauthoption: scalaxb.DataRecord[Any],
  attributes: Map[String, scalaxb.DataRecord[Any]] = Map()) {
  lazy val returnToken = attributes("@returnToken").as[String]
  lazy val trustedMethod = attributes.get("@trustedMethod") map { _.as[TrustedMethod] }
  lazy val trustedHost = attributes.get("@trustedHost") map { _.as[String] }
}
Alexandre Archambault
@alexarchambault
maybe you could provide you own argonaut codec for DataRecord[Any]
then argonaut-shapeless will use it
Srepfler Srdan
@schrepfler
it's that Any which is worrying me
any example how the codecs are made?
Srepfler Srdan
@schrepfler
cheers
I'll try to convice first the scalaxb guys if they can bundle it as a util
Alexandre Archambault
@alexarchambault
(the argonaut API is not most accessible then, but once you learned to master it, it's nice)
Srepfler Srdan
@schrepfler
as a dev dealing mostly with Java, any Scala API looks like magical writings by some alchemist
Alexandre Archambault
@alexarchambault
it can feel this way at the beginning, type level libraries in particular :-D
bundling what btw? generation of json instead of xml?
Srepfler Srdan
@schrepfler
yes, being able to generate both JSON and XML from the same set of scalaxb model
Srepfler Srdan
@schrepfler
looking at the scalaxb sources
there are two definitons, one a trait
trait DataRecord[+A] {
  val namespace: Option[String]
  val key: Option[String]
  val value: A

  def as[B] = value.asInstanceOf[B]

  override def toString: String = {
    "DataRecord(" +
    ((namespace, key, value) match {
      case (None, Some(k), _) => k + "," + value.toString
      case (Some(n), Some(k), _) => "{" + n + "}" + k + "," + value.toString
      case _ => value.toString
    }) + ")"
  }
}
and a singleton
object DataRecord extends XMLStandardTypes {
  private case class DataWriter[+A](
    namespace: Option[String],
    key: Option[String],
    xstypeNamespace: Option[String],
    xstypeName: Option[String],
    value: A,
    writer: CanWriteXML[_]) extends DataRecord[A] {
    override def equals(o: Any): Boolean =
      o match {
        case that: DataWriter[_] =>
          namespace == that.namespace &&
          key == that.key &&
          value == that.value
        case _ => false
      }

    override def hashCode: Int = {
      var result = 17
      result = result + 31 * namespace.hashCode
      result = result + 31 * key.hashCode
      result = result + 31 * value.hashCode
      result
    }
  }
I get the feeling if this is implemented properly one would have to consider how do two namespaces share the projected names, possibly via a prefix
and omitting prefixes for the default namespace
Alec Zorab
@AlecZorab
@alexarchambault / @milessabin For reasons I don't wish to delve too deeply into, I have a 45 field case class that is primarily Strings, Doubles or Options of those. I'm seeing compile times on the order of 250seconds to derive a DecodeJson, using 0.2.0-SNAPSHOT (and therefore shapeless 2.2-M6). Is that to be expected?
Alexandre Archambault
@alexarchambault
possibly, I ran into similar compile time even not going as far as that (but with coproducts involved)
Wound ensuring the derived implicits aren't derived too often through proxying be an option for you?
Alec Zorab
@AlecZorab
uh. I'm not sure what you mean, so I don't know ;)
Alec Zorab
@AlecZorab
@alexarchambault could you give me an example?
Alexandre Archambault
@alexarchambault
@AlecZorab The tests illustrates that a bit, this is how I do it:
The goal is to have incremental compilation compile once the definitions and derivations, and that's it.
If you don't modify the definitions or derivations, or their dependencies, they shouldn't be recompiled. You can work freely on the other files.
This doesn't speed up compilation per se, this just avoids unnecessary recompilations.
Alec Zorab
@AlecZorab
Gotcha. The CI server won't love it, but it's a decent enough workaround for development. I'll give it a go
Alexandre Archambault
@alexarchambault
@ijuma argonaut-shapeless 0.2.0-SNAPSHOT on sonatype now depends on shapeless 2.2.0 final - I'll do a release soon (should be in the coming days)
Ismael Juma
@ijuma
@alexarchambault thank you
Miles Sabin
@milessabin
@alexarchambault thanks :-)
Alexandre Archambault
@alexarchambault
@/all Just published argonaut-shapeless 0.2.0, which is simply an update to shapeless 2.2.0.
Alexandre Archambault
@alexarchambault
Development will go on towards 0.3.0, with hopefully support for shapeless 2.2 orphan derivation, and more varied / customisable codecs (ability to change the way products are encoded - e.g. to transform the keys' case, or to put the product in a json array rather than an object, or change the way coproducts are encoded - e.g. to encode eithers directly as their right or left values rather than nesting them in { "Left" / "Right": ... }, or to add a custom field for the type, ...)
(see the discussion here: alexarchambault/argonaut-shapeless#5)
Ismael Juma
@ijuma
@alexarchambault awesome
Miles Sabin
@milessabin
Fantastic ... thanks :-)
Miles Sabin
@milessabin
WRT customisable codecs, I'm open to having a parameterized variant of LabelledGeneric in shapeless ... IIRC you were asking for that a while back?
Alexandre Archambault
@alexarchambault
You're welcome :-)
Alexandre Archambault
@alexarchambault
@milessabin About variants of LabelledGeneric, I'm less opiniated about it now. If this can be handled in a slick way from shapeless, let's go for that. But libraries using labels can handle it directly else.
Miles Sabin
@milessabin
Are you going to be in Amsterdam next week?
Alexandre Archambault
@alexarchambault
@milessabin Nope, I wasn't expecting tickets to get sold out that early :-(
Miles Sabin
@milessabin
:-(
Miles Sabin
@milessabin
Any ETA on a release with orphan handling?
ie. something along the lines of test/orphans.