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
Jakub Kozłowski
@kubukoz
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? ;)
Jakub Kozłowski
@kubukoz
I have an enum of 9 values, so I need only 4 bits to encode any value
but the derived codec gives me 8 bits
not sure if this is intentional...
mpilquist
@mpilquist:matrix.org
[m]
Ah yeah
Jakub Kozłowski
@kubukoz
codecs.uint8.sizeBound + sizeBoundCases[s.MirroredElemTypes]
mpilquist
@mpilquist:matrix.org
[m]
Idea there was a single byte would cover up to 256 case adts
Jakub Kozłowski
@kubukoz
that's the size of sums
yeah
what's scala's limit? hah
mpilquist
@mpilquist:matrix.org
[m]
we could be smarter there but generally folks like byte alignment
Jakub Kozłowski
@kubukoz
if they own the protocol :sweat_smile:
okay found a test case for my thing
mappedEnum(uint8, Color.Red -> 10, Color.Green -> 20, Color.Blue -> 30)
mpilquist
@mpilquist:matrix.org
[m]
right but then use discriminated combinator
Jakub Kozłowski
@kubukoz
that works.
given Codec[Arrows] = mappedEnum(
  uint4,
  Arrows.Up -> 0,
  Arrows.UpRight -> 1,
  Arrows.Right -> 2,
  Arrows.DownRight -> 3,
  Arrows.Down -> 4,
  Arrows.DownLeft -> 5,
  Arrows.Left -> 6,
  Arrows.UpLeft -> 7,
  Arrows.Neither -> 8
)
even better than relying on definition order :D
mpilquist
@mpilquist:matrix.org
[m]
Yeah exactly
Jakub Kozłowski
@kubukoz
I like that I don't need to care about the uint conversion
mpilquist
@mpilquist:matrix.org
[m]
I have a complicated history with implicits ;)
There are some downsides there where you could forget to map a case but I think the simplicity outweighs the exhaustiveness
Jakub Kozłowski
@kubukoz
yeah
Jakub Kozłowski
@kubukoz
that was some fun mind bending tuple work...
Jakub Kozłowski
@kubukoz:matrix.org
[m]
is there a scaladoc published for 1.x somewhere?
Jakub Kozłowski
@kubukoz:matrix.org
[m]
ah sorry, I meant 2.x :(
and the shiny new scaladoc
mpilquist
@mpilquist:matrix.org
[m]
Oh ha, no, I think scala3doc is still disabled in sbt-spiewak? Or if not, then it should be published
Rad Rares
@radRares1
hello do you have any examples on how should I build a StreamEncoder from scodec-stream? I have a large binary file which I want to encode/decode that contains a huge list of elements, so I would like to be able to stream encode-decode those elements, but I cannot get a hold of how should I approach it. I do have codecs defined for the items in the file which compose a product codec that represent the whole file. Sorry if this is trivial.
mpilquist
@mpilquist:matrix.org
[m]
Generally, use the constructors on the StreamEncoder companion object - e.g., StreamEncoder.many(myCodec).toPipe[IO]
Rad Rares
@radRares1
That's what I first tried, using the example provided in scala-stream for the StreamDecoder. But, it just tells me that the symbol many cannot be resolved and as I went inside to see what StreamEncoder contained, indeed the companion object had only the apply and instance methods. Maybe I imported the wrong thing? though I added to my build file the latest dependency from the releases page.
mpilquist
@mpilquist:matrix.org
[m]
hm what version are you using?