Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 26 2019 21:07
    scala-steward synchronize #139
  • Jan 26 2019 14:33

    mpilquist on v1.11.0

    (compare)

  • Jan 26 2019 14:32

    mpilquist on 1.11.x

    Setting version to 1.11.0 Updated version to 1.11.1-SNAPS… (compare)

  • Jan 25 2019 10:28
    billpcs starred scodec/scodec
  • Jan 22 2019 22:01
    benhanna starred scodec/scodec
  • Jan 21 2019 20:36
    scala-steward opened #139
  • Jan 21 2019 14:51
    mpilquist closed #130
  • Jan 21 2019 14:48
    mpilquist closed #119
  • Jan 21 2019 14:48
    mpilquist commented #119
  • Jan 21 2019 14:48

    mpilquist on 1.11.x

    Scala 2.13.0-M4 Merge branch 'series/1.10.x' in… Upgraded to latest scala-collec… and 2 more (compare)

  • Jan 21 2019 14:48
    mpilquist closed #138
  • Jan 21 2019 14:40
    mpilquist opened #138
  • Jan 21 2019 14:37

    mpilquist on 1.11.x

    Created 1.11 branch (compare)

  • Jan 21 2019 14:31

    mpilquist on xuwei-k

    Upgraded to 2.13.0-M5 (compare)

  • Jan 21 2019 14:19

    mpilquist on xuwei-k

    Scala 2.13.0-M4 Merge branch 'series/1.10.x' in… Upgraded to latest scala-collec… (compare)

  • Jan 21 2019 14:03

    mpilquist on 1.10.x

    Update sbt-scalajs, scalajs-com… Merge pull request #129 from sc… (compare)

  • Jan 21 2019 14:03
    mpilquist closed #129
  • Jan 21 2019 14:03
    mpilquist closed #126
  • Jan 21 2019 14:03

    mpilquist on 1.10.x

    Pad-left on pbcd codec. Fixes #… Using padLeft in pbcd instead o… Merge pull request #133 from lJ… (compare)

  • Jan 21 2019 14:03
    mpilquist closed #133
jilen
@jilen
Hi, how can I framing (param used by checksummed) a fixed(N bytes) + variableSizeBytes + checksum(1 byte) message?
Shubham Girdhar
@girdharshubham
Hi
I have a noob-ish question.
How do we write conditional codecs?
What I mean is, if the condition evaluates to true I decode a byte if it doesn't I don't.
I can put an if expression. but the type ultimately comes out as Codec[Nothing]
mpilquist
@mpilquist:matrix.org
[m]
take a look at scodec.codecs.conditional
Shubham Girdhar
@girdharshubham
Makes sense.
Thanks.
Kinda like this?
xCodec flatPrepend { (_: String, seqId: Int) =>
              conditional(seqId == 127, "PCM Id" | uint8L.withKey("pcmId"))
}
Thanks
btw withKey is just an xmap
Shubham Girdhar
@girdharshubham
Thanks @mpilquist
It works.
Rad Rares
@radRares1
Hello, do you know any good resources besides the documentation for someone who is just starting to learn how to use scodec? Thanks
mpilquist
@mpilquist:matrix.org
[m]
scodec-protocols has a bunch of "real world" examples
Rad Rares
@radRares1
thanks a lot!! :D
Jakub Kozłowski
@kubukoz
hi, is there a method corresponding to the pre-dotty sizedList? As in, a statically known number of values
encoded as a tuple, I suppose
mpilquist
@mpilquist:matrix.org
[m]
Hm, no I guess we lost that
Jakub Kozłowski
@kubukoz
natural numbers are in stdlib, right? Maybe we can get it back :D
mpilquist
@mpilquist:matrix.org
[m]
Yeah would be cool to return a TupleN
Jakub Kozłowski
@kubukoz
also having a hard time navigating to the sources, but that's probably on metals...
Is there a .choice?
mpilquist
@mpilquist:matrix.org
[m]
Codec.choice but there’s an open issue for a union type version
Jakub Kozłowski
@kubukoz
thanks
mpilquist
@mpilquist:matrix.org
[m]
Jakub Kozłowski
@kubukoz
hmm can't find that symbol on main
I have like 8 codecs of subtypes and want to combine them into the parent, not sure if that can still be done
used to have a shapeless coproduct of them, which I guess was proof that it was exhaustive
mpilquist
@mpilquist:matrix.org
[m]
Oh discriminator codecs
Jakub Kozłowski
@kubukoz
not really... I think I want .orElse semantics
I have the bit sequence for every case and just want to pick the one that matches
so kind of like codecs.fallback with N cases
mpilquist
@mpilquist:matrix.org
[m]
Whoops scodec.codecs.choice(a, b, …)
Jakub Kozłowski
@kubukoz
hmm, maybe mappedEnum...
it does seem to work on discriminators though
I might be able to use a derived codec, actually. Just need to see what rules they follow lol
I think that'll do it.
mpilquist
@mpilquist:matrix.org
[m]
The biggest change is definitely the removal of all the coproduct codec stuff
Partially because they no longer exist
But also because they were too clunky
Jakub Kozłowski
@kubukoz
I kind of wish there was a scala3-compatible shapeless with all the old stuff though...
thankfully I don't use scodec at work but folks definitely do. You probably know that best ;)
and the migration of everything at once might be a pain
mpilquist
@mpilquist:matrix.org
[m]
There’s a Google summer of code project for that
Jakub Kozłowski
@kubukoz
oh seriously? That's awesome.
mpilquist
@mpilquist:matrix.org
[m]
The port shapeless 2 to Dotty part
Jakub Kozłowski
@kubukoz
yeah
were there other issues in upgrading scodec?
mpilquist
@mpilquist:matrix.org
[m]
I honestly don’t know how much the coproduct stuff was used but looking back now, the Discriminated/Discriminator implicit stuff was too fancy
Main issue was replacing HList with tuples
But that’s a trivial port in most cases - 0 changes needed in common cases
Jakub Kozłowski
@kubukoz
cool
hmm I think I'll have an idea, or maybe a contribution, for the derived codecs
mpilquist
@mpilquist:matrix.org
[m]
Cool! What is it? ;)