Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:41
    esparta commented #366
  • 08:39
    flash-gordon commented #366
  • 08:39

    flash-gordon on master

    Fix error on Dry::Types::Array#… Merge pull request #366 from es… (compare)

  • 08:39
    flash-gordon closed #366
  • 08:38
    flash-gordon closed #362
  • 08:38
    flash-gordon commented #362
  • 08:37
    flash-gordon closed #361
  • 08:37
    flash-gordon commented #361
  • 07:48

    solnic on master

    Adding missing built-in predica… Merge pull request #65 from esp… Merge branch 'release-1.0' (compare)

  • 07:47

    solnic on release-1.0

    Adding missing built-in predica… Merge pull request #65 from esp… (compare)

  • 07:47
    solnic closed #65
  • 07:29
    esparta opened #65
  • 07:06
  • 06:23
    robturtle starred dry-rb/dry-monads
  • 05:15
    Travis esparta/dry-types (array_try_specs) passed (4)
  • 05:12
    esparta opened #366
  • Oct 21 20:38
    patrickclery commented #361
  • Oct 21 19:47
    samdindyal starred dry-rb/dry-container
  • Oct 21 17:19
    ekremkaraca starred dry-rb/dry-configurable
  • Oct 21 13:32
    flash-gordon commented #361
Andy Holland
@AMHOL
Nice, didn't think of that :)
Andy Holland
@AMHOL
Sorry @solnic meant a Dry::Data::Type::Hash
Piotr Solnica
@solnic
@AMHOL nope, at least not yet
Andy Holland
@AMHOL
Ahh OK
Peter Leitzen
@splattael
@solnic thoughts about my perf eval hack? Too ugly? Is it worth to follow that path?
Andy Holland
@AMHOL
It's still pretty ugly @solnic rom-rb/rom-http#7
If I used structs it would be much simpler, but I want to get hashes and maintain the DSL
Piotr Solnica
@solnic
@AMHOL which part is ugly?
It's basically repeating the struct DSL
Piotr Solnica
@solnic
we can generalize this dsl
Andy Holland
@AMHOL
Do you think it makes sense for a hash?
Piotr Solnica
@solnic
ie extend Dry::Data::AttributeDSL
Andy Holland
@AMHOL
That would be cool
Piotr Solnica
@solnic
@splattael I’d like to avoid such solutions, at least for now :)
Peter Leitzen
@splattael
Damn, but you're right. I thought I could lure you with perf boost ;)
There is a lot room for perf improvement at those kind of use-cases.
Peter Leitzen
@splattael
Data definition is static therefore most (maybe all?) code pathes which depend on those definitions could be pre-compiled avoiding tedious (hash) iterations.
Hash.strict_constructor could benefit from those "solutions" too
(I've done too much Elixir and Crystal lately, dammit)
Piotr Solnica
@solnic
@splattael in this case it defines a new constructor every time you call attribute so I dunno, feels "wrong"
and btw we have dry-constructor that I would like to use there soon
Peter Leitzen
@splattael
@solnic true, you could define this constructor only once in self.new
I know my patch is just a hack but it improved perf a lot
Piotr Solnica
@solnic
Just to make it clear, I am all for perf improvements :) to a point where I want to write various extensions in rust for dry and transproc :joy:
Peter Leitzen
@splattael
o^O nice! :D
Piotr Solnica
@solnic
ie form coercions in dry-data or those heavy transformations in transproc...imagine dat speed boost
Peter Leitzen
@splattael
over nine thousand! at least :D
we should do more code compilation in Ruby. read "macros" :D
Piotr Solnica
@solnic
Word
Peter Leitzen
@splattael
@solnic https://gist.github.com/splattael/41a87cbde4cf08efa479 <- idea might boost Type::Hash.*_constructor because we know the attributes upfront
Piotr Solnica
@solnic
:D
Peter Leitzen
@splattael
I like @plexus' macros: https://github.com/plexus/macros
Peter Leitzen
@splattael
@solnic regarding redefining initializer over and over again: splattael/dry-data@922dc4a
gonna stop stealing your time - just my 2 cents :D
Piotr Solnica
@solnic
:ok I see what you did there
Peter Leitzen
@splattael
:D
Lorenzo Arribas
@larribas
Hello guys! I've been toying a bit with dry-validation and I haven't found a way to validate that a Hash has EXACTLY the keys I define in the schema (i.e no extra keys)
Am I missing it? I could try contributing something, otherwise
Krzysztof Wawer
@wafcio
you have key method and optional method for hash keys
Lorenzo Arribas
@larribas
yes, but take for instance the example in the IO page. If you try to validate:
schema.call(email: 'jane@doe.org', age: nil, extra_parameter: "I'm in!")
that would work, right?
Krzysztof Wawer
@wafcio
what do you want validate ?
you can write key(:email) … , key(:age) …, optional(:extra_parameter) … if I good understand
Lorenzo Arribas
@larribas
The thing is, I want to validate a Hash of settings, and I want the settings to be accurate so I can store them in my DB
And I don't want to store extra keys I don't use for anything
That is, I want to validate that what the client is sending me is exactly what I am asking. No more, no less
Krzysztof Wawer
@wafcio
so if hash contains more keys you want to return error, right ?
Lorenzo Arribas
@larribas
yep!
that's right