Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 20 10:17
    scala-steward opened #211
  • Oct 20 06:22

    alexarchambault on master

    Update sbt to 1.4.1 (#210) (compare)

  • Oct 20 06:22
    alexarchambault closed #210
  • Oct 19 22:09
    scala-steward opened #210
  • Oct 17 22:04
    scala-steward opened #209
  • Oct 15 12:53
    alexarchambault closed #206
  • Oct 15 12:53

    alexarchambault on master

    Update sbt-mdoc to 2.2.9 (#206) (compare)

  • Oct 15 12:52
    alexarchambault closed #208
  • Oct 15 12:52

    alexarchambault on master

    Update sbt-scalajs, scalajs-com… (compare)

  • Oct 15 12:05
    scala-steward opened #208
  • Oct 05 13:33

    alexarchambault on master

    Update sbt to 1.4.0 (#207) (compare)

  • Oct 05 13:33
    alexarchambault closed #207
  • Oct 05 00:08
    scala-steward opened #207
  • Sep 18 18:53
    scala-steward opened #206
  • Sep 14 09:58

    alexarchambault on master

    Update sbt-mdoc to 2.2.8 (#205) (compare)

  • Sep 14 09:58
    alexarchambault closed #205
  • Sep 14 09:58

    alexarchambault on master

    Update sbt-scalajs, scalajs-com… Add compatibility rules Merge pull request #203 from sc… (compare)

  • Sep 14 09:58
    alexarchambault closed #203
  • Sep 14 09:45
    alexarchambault synchronize #203
  • Sep 11 10:04
    scala-steward opened #205
Simon Hafner
@reactormonk
Bug.
Alexandre Archambault
@alexarchambault
FYI, I've been postponing a new release for some time now because of some obscure doc related errors I'm running into when doing publish... I'll have a closer look at it soon.
Abhishek Srivastava
@abhishes_twitter
I added the following line to my build.sbt "com.github.alexarchambault" %% "argonaut-shapeless_6.1" % "1.1.1" but still when I do import argonaut.derive._ it cannot find derieve. am I missing an sbt dependency?
Simon Hafner
@reactormonk
abhishes_twitter, the names changed a bit.
ah no, should work.
You sure did did sbt refresh and all the magic?
right, this is gitter, @abhishes_twitter
Simon Hafner
@reactormonk
Any way to make argonaut-shapeless write default values?
Alexandre Archambault
@alexarchambault
@reactormonk Writing or not the default value is handled by the JsonProductCodecs. The default one handles that around here.
By supplying a custom JsonProductCodec (like described here), you should be able to have those be written no matter what.
Simon Hafner
@reactormonk
@alexarchambault got a release with @JsonCodec?
Alexandre Archambault
@alexarchambault
1.2.0-M3 is on its way to Central (and on Sonatype releases since a few minutes).
I still have to update the README.
Simon Hafner
@reactormonk
Nice, thanks.
So 6.2?
Alexandre Archambault
@alexarchambault
Yeah, 6.2.
Simon Hafner
@reactormonk
Hmm, can't find some implicits generated by @JsonCodec - I guess it's my job to debug that.
Simon Hafner
@reactormonk
Did you remove codecs for Seq?
Or rather, argonaut.
Alexandre Archambault
@alexarchambault
@reactormonk JsonCodec is around (says unzip $(coursier fetch --intransitive com.github.alexarchambault::argonaut-shapeless_6.2:1.2.0-M3))
yeah, argonaut seems to have removed the codecs for Seq
those for List are still around
Simon Hafner
@reactormonk
Yeah, implemented that manually quick.
Simon Hafner
@reactormonk
implicit val JsonProductObjCodecFieldsAlwaysThere = new JsonProductObjCodec {
    override def encodeField(field: (String, Json), obj: Json, default: => Option[Json]): Json = {
      val (name, content) = field
      (toJsonName(name) -> content) ->: obj
    }
  }
... somehow doesn't get picked up.
Alexandre Archambault
@alexarchambault
it should be something like
val JsonProductObjCodecFieldsAlwaysThere = ...

implicit def jsonProductObjCodecFieldsAlwaysThereFor[T]: JsonProductCodecFor[T] = JsonProductCodecFor(JsonProductObjCodecFieldsAlwaysThere)
a bit like serpentCaseCodecFor in the README
Simon Hafner
@reactormonk
Nice, works. Thanks.
How come you need the carrier?
Alexandre Archambault
@alexarchambault
It's made this way so that different codecs can be supplied for different types.
Simon Hafner
@reactormonk
Pretty good idea.
Ross A. Baker
@rossabaker
Hi. Is the plan to release with alexarchambault/argonaut-shapeless#82 soon? I’m down to two missing dependencies, and this is one of them. :)
Simon Hafner
@reactormonk
It's only in there for tut IIRC
Ross A. Baker
@rossabaker
That’s true. It makes a nice example, but we can work around it if it’s the final blocker.
It’s been a long road to 2.12. :)
Simon Hafner
@reactormonk
Is there an argonaut-shapeless version that works with scalaz 7.2?
Let's see if "com.github.alexarchambault" %% "argonaut-shapeless_6.2" % "1.2.0-M3" works
Leon Clark
@leclark

would anyone object to a PR that adds a trait for ArgonautShapeless?

object ArgonautShapeless extends ArgonautShapeless

trait ArgonautShapeless
  extends SingletonInstances
  with DerivedInstances {

  object Cached
    extends SingletonInstances
    with CachedDerivedInstances
}

alexarchambault/argonaut-shapeless#89

Paul Snively
@PaulAtBanno
Hi everyone. Has anyone ever tackled adding support for certain Scalaz types, e.g. NonEmptyList?
Simon Hafner
@reactormonk
@PaulAtBanno not sure, shouldn't be too hard though.
Take a look at the list one, that should give you a good starting point.
Ben Kyrlach
@bkyrlach
Is there a way to make argonaut-shapeless work for ADTs where the base is a sealed class instead of a sealed trait?
I have a model that I want to be able to work with both in Argonaut and in MongoDB. The Mongo Scala macro for deriving a codec off of my ADT seemingly requires the base to be a class, and argonaut shapeless seemingly requires the base to be a trait.
Kevin Meredith
@kevinmeredith
Hi - is v1.2.0-M9 backwards compatible with v1.2.0-M6?
Mark Galea
@cloudmark
Hey guys, new to shapeless here, so I have a case class and used the LabelledGeneric to get the field names. I also managed to get all the field attributes for a particular annotation. What I would like is to merge the two. I used zip in this case, what's the recommended way of using the result, should I use the poly here? Code sample below
  implicit def genericObjectEncoder[A, H <: HList, AL <: HList, ZL <: HList, K <: HList](implicit
                                          gen: LabelledGeneric.Aux[A, H],
                                          keys: Keys.Aux[H, K],
                                          annots: Annotations.Aux[FieldName, A, AL],
                                          zip: Zip.Aux[K :: AL :: HNil, ZL],
                                          hEncoder: Lazy[CmsObjectEncoder[H]]
                                         ): CmsEncoder[A] = {

    println(zip(keys() :: annots() :: HNil))
    createObjectEncoder(hEncoder.value.encode)
  }
3 replies
Mark Galea
@cloudmark

so I've reach this point

implicit def hlistObjectEncoder[K <: Symbol,
                                  H,
                                  T2 <: Option[FieldName],
                                  T <: HList](implicit
                                  classTag: ClassTag[K],
                                  witness: Witness.Aux[K],
                                  hEncoder: Lazy[CmsEncoder[H]],
                                  tEncoder: CmsObjectEncoder[T]
             ): CmsObjectEncoder[(FieldType[K, H], T2) :: T] = {

    val fieldName: String = witness.value.name
    println(fieldName)

    createObjectEncoder {
      val head: CmsMeta = hEncoder.value.encode
      val tail: CmsObject = tEncoder.encode
      CmsObject((fieldName, head) :: tail.fields)
    }
  }

now my problem is this T2 is of type Option[FieldName], how do I get the Witness for that so I can read the data inside

Any ideas?
Mark Galea
@cloudmark

Hey everyone, is there a way in shapeless to detect class.type annotations e.g.

@CmsPostType("cms-game")
case class Game (name: String, gameId: Long)

I want to detect whether there is a CmsPostType annotation present

Mark Galea
@cloudmark
I'll rephrase a bit the question here, is there a way to make the CmsPostType optional without having two code paths.
Mark Galea
@cloudmark
I was thinking of using a classTag really but did not want to anger the Shapeless gods if there is a better way