Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 31 16:15
    scala-steward closed #231
  • Mar 31 16:14
    scala-steward commented #231
  • Mar 31 16:05
    scala-steward opened #240
  • Mar 29 22:13
    scala-steward closed #232
  • Mar 29 22:13
    scala-steward commented #232
  • Mar 29 22:13
    scala-steward opened #239
  • Mar 23 11:08
    scala-steward closed #237
  • Mar 23 11:08
    scala-steward commented #237
  • Mar 23 11:08
    scala-steward opened #238
  • Mar 11 13:10
    scala-steward opened #237
  • Mar 10 05:07
    scala-steward closed #235
  • Mar 10 05:07
    scala-steward commented #235
  • Mar 10 05:07
    scala-steward opened #236
  • Mar 08 05:10
    scala-steward closed #229
  • Mar 08 05:10
    scala-steward commented #229
  • Mar 08 05:10
    scala-steward opened #235
  • Feb 26 21:10
    scala-steward opened #234
  • Feb 26 21:10
    scala-steward opened #233
  • Feb 17 23:08
    scala-steward closed #230
  • Feb 17 23:08
    scala-steward commented #230
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