Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 01:53
    woarewe commented #439
  • 00:33
  • 00:27
    woarewe commented #439
  • 00:27
    woarewe commented #439
  • 00:02
    woarewe commented #439
  • Nov 28 06:13
    erik-brueggemann starred dry-rb/dry-monads
  • Nov 28 00:42
    hangsu starred dry-rb/dry-monads
  • Nov 27 13:58
    fapdash starred dry-rb/dry-types
  • Nov 26 08:40
    solnic commented #34
  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:24

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:23

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

  • Nov 26 08:17

    action-hero[bot] on main

    Update CODE_OF_CONDUCT.md from … (compare)

Philip Arndt
@parndt
rather than putting keys with null values into the store, the key is just not added to the node
so then I see this:
Dry::Struct::Error: [Entities::Page.new] :myTestOptionalKey is missing in Hash input
from /home/parndt/.gem/ruby/2.6.2/bundler/gems/dry-struct-6a56dcac248d/lib/dry/struct/class_interface.rb:233:in `rescue in new'
Caused by Dry::Types::MissingKeyError: :myTestOptionalKey is missing in Hash input
from /home/parndt/.gem/ruby/2.6.2/bundler/gems/dry-types-438161862ed5/lib/dry/types/schema.rb:265:in `block in resolve_missing_keys'
Philip Arndt
@parndt
so I'm guessing I need to somehow tell it that key is not always going to be there at the entity level, hence my wee hack:
module Entities
  class Page < ROM::Struct
    transform_types { |type| type.optional? ? type.required(false) : type }
  end
end
@solnic does that help?
Peter Solnica
@solnic
@parndt yes, I think we want a no-schema struct in the core for cases like this
Philip Arndt
@parndt
yep - I'd still like to define a schema at the repository level, primarily so that weird data can't be saved
I've been working on writing a library for ROM called rom-firebase :smile: :scream:
Peter Solnica
@solnic
@parndt yeah this is a perfectly legit use case. We should have a nice support for this in the core so that various adapters can leverage it
Philip Arndt
@parndt
I'll be pushing my library to GitHub really soon, as soon as I get the example in the readme working :wink:
keen to see what you think... I've been writing it as someone who's not has his head in the dry-rb game for a little while so it's been quite fun
Tim Riley
@timriley
@parndt that’s exciting!
Philip Arndt
@parndt
yeah, my over-eager refactor broke some things so I'll have to keep you in suspense
:grimacing:
Peter Solnica
@solnic

@/all Hey folks, we've been testing Zulip as a Gitter replacement for the last few days. So far it feels really great and we'd like more people to sign up and check it out. We did not decide yet if we want to switch but it's likely that we will, because of this please sign up and let's chat there whether you like it or not.

You can sign up right here: https://dry-rb.zulipchat.com/register/

If you haven't heard about Zulip, it's an OSS communication platform. Something between a chat and email, with a unique communication model based on streams and topics. The company behind it was acquired by Dropbox, but they open sourced the project back in 2015. Its development is very active and it looks promising in general.

Check out Why Zulip here: https://zulipchat.com/why-zulip/

Philip Arndt
@parndt
awesome - zulip's great!
Peter Solnica
@solnic
it's pretty awesome indeed, looks so-so but functionality-wise it's fantastic
Nick Sutterer
@apotonick
Cool, I will check it out
Oh wow, they address so many things I hate about Slack :grimacing:
Philip Arndt
@parndt
@apotonick exactly!
Nick Sutterer
@apotonick
Phil!!!!! :heart_eyes:
Philip Arndt
@parndt
:heart: :heart: :heart:
Christopher Swasey
@endash
Maybe I'm dumb but I can't figure out how just to say something
Christopher Swasey
@endash
bonus feature
Nikita Shilnikov
@flash-gordon
it’s not on you, find the reply button
Spencer Goh
@dymaxionuk
Hi, I'm trying out the Dry::Monads::Do notation, but I get LocalJumpError: yield called out of block. Any ideas why?
Nikita Shilnikov
@flash-gordon
Mind to share an example?
Spencer Goh
@dymaxionuk

@flash-gordon , I've figured it out! seems like a clash between the mixin Dry::Transaction::Operation as soon as I include that it breaks. That Operation mixin includes...

Dry::Matcher.for(:call, with: Dry::Matcher::ResultMatcher)

which wraps :call and clashed with the Do wrapping.

Tim Riley
@timriley
@dymaxionuk hmm, we have an integration test in dry-matcher to ensure it works with dry-monads do notation IIRC
Spencer Goh
@dymaxionuk
Hi Tim, that's suprising... cos I just typed out an example and flattened all the Dry::Transaction::Operation includes into the top level of my class
and it blew up with that ResultMatch
Tim Riley
@timriley
Hmm, could you please file an issue with your gem versions and example case?
Spencer Goh
@dymaxionuk
class MyOp
  include Dry::Monads::Result::Mixin
  include Dry::Matcher.for(:call, with: Dry::Matcher::ResultMatcher)
  include Dry::Monads::Do.for(:call)

  def call
    _should_fail_fast = yield one('hello')
    Success(:yesyesyes)
  end

  def one(param)
    Failure(:nonono)
  end
end

MyOp.new.call
Nikita Shilnikov
@flash-gordon
it can fail if you include modules in the wrong order
Spencer Goh
@dymaxionuk
I'll raise an issue, it might be some clash with the versions I'm using...
Nikita Shilnikov
@flash-gordon
first do, then matcher
this is the right way
Spencer Goh
@dymaxionuk
aah but problem is I'm extending a base class MyOperation
and so the matcher gets included first
Nikita Shilnikov
@flash-gordon
it won’t work
you may want to use included or something like this as a workaround
Spencer Goh
@dymaxionuk
it's ok I'll push up the Do wrap higher up the chain in my base class.
it migjht silently catch other ppl off guard in a similar way if they are usiung Dry::Transaction::Operation and not conscious of the ordering
thanks for help guys
Tim Riley
@timriley
tbh I wonder about the value of Dry::Transaction::Operation in the first place
Spencer Goh
@dymaxionuk
yeah agreed - the monads cover all, and give far more flexibility.
I'm in teh process of ripping out dry-web / dry-web roda (since they dont do much anyway other than some pre config + deprecated) just ripped out dry-transactio from my project (it's slow also) and just removing operations... all I need is the Matcher realy..
and that's clean... and far more powerful composing actions with fmap bind or etc.
the biggest limitation of transactions imo, is of having to chain the parameters from step to step.... so step 1 has 5 params.. of which onky 2 are pertinent for step 2, and diff 2 are useful for step 3 etc... end up passing through in hash, most of the unused params
seems kinda pointless... and once you have the DO notation, the usefulness of step: adapters goes away
Tim are you thinking of deprecating Dry::Transaction one day?