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
Michael Pilquist
@mpilquist
Yeah, is all you’re doing is calling .as[Foo], then no need to lift to a tuple1 first
Soren
@srnb_gitlab
Coming from Shapeless, not needing a terminator is a bit irking
But I'll get used to it
Michael Pilquist
@mpilquist
we used to support building an hlist of codecs and then “sequencing” that to a codec of an hlist
Soren
@srnb_gitlab
Yeah, I used that quite a bit in Scodec 1
Simpler times back then :)
Soren
@srnb_gitlab
Implementing HList myself + operations on it was fun :smile:
it's a good exercise into understanding how to use shapeless
Generic and PolyFunction are absolute magic though
Michael Pilquist
@mpilquist
Yes!
Soren
@srnb_gitlab
Hmm
I wish
So
What'd really be cool @mpilquist
Is if :: worked like an applicative thingy
And errors got accumulated in a Validated instead of an Either when encoding
So if I had (uint8 :: uint8), and tried to pass (432, 1764), I'd get two errors instead of one
But I have no clue how to implement that
Michael Pilquist
@mpilquist
Decoding can’t accumulate errors due to each decode consuming input — necessarily, you can’t decode the second component until you have the remainder of the first component
Encoding might be able to do that though? Would have to think about it but seems feasible
Soren
@srnb_gitlab
Well the thing is
So
fixedSizeBytes could do it on Decoding, that'd be really hard though
:: can do it on encoding, but that shouldn't be as hard
If you get :: working, then it might be feasible to get vector and etc working with a parTraverse mechanism, but those would quickly become a pain without reasonable error messages/tracing
I'd devote some of my time to getting that to work if I wasn't so busy :(
Last question: I have a Scala 3 enum, what's the best way to assign some sort of codec to each enum value?
Michael Pilquist
@mpilquist
i think mappedEnum codec
it's kinda boring but gets the job done :)
Soren
@srnb_gitlab
image.png
hmm
Soren
@srnb_gitlab
I think it's the object that's screwing things up here
I asked in lampepfl/dotty
Michael Pilquist
@mpilquist
oh it's a typo i think -- Elf vs Efi
Soren
@srnb_gitlab
Why the heck did I type Efi
Long week
Michael Pilquist
@mpilquist
lol
Soren
@srnb_gitlab
image.png
Michael Pilquist
@mpilquist
flip the order of the number and the enum value
Soren
@srnb_gitlab
awesome
Sick
Soren
@srnb_gitlab
How should I write a codec for the elf magic?
0x7F 'E' 'L' 'F'
(sorry for lying about the "last question" thing)
Michael Pilquist
@mpilquist
constant(hex"7f...")
Soren
@srnb_gitlab
Where can I find hex? @mpilquist which import?
Michael Pilquist
@mpilquist
import scodec.bits._
Soren
@srnb_gitlab
Awesome, ty