Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 12 21:34
    flash-gordon commented #376
  • Dec 12 21:34
    flash-gordon labeled #376
  • Dec 12 21:34
    flash-gordon opened #376
  • Dec 12 19:32
    RyanLafferty starred dry-rb/dry-types
  • Dec 12 05:53
    technofreak starred dry-rb/dry-monads
  • Dec 12 00:14
    thekuwayama starred dry-rb/dry-monads
  • Dec 11 09:29
    blasterun starred dry-rb/dry-monads
  • Dec 11 08:34
    flash-gordon closed #115
  • Dec 11 08:34
    flash-gordon commented #115
  • Dec 11 08:31

    flash-gordon on v1.3.3

    (compare)

  • Dec 11 08:30

    flash-gordon on master

    Bump version to 1.3.3 (compare)

  • Dec 11 08:30

    flash-gordon on master

    Update CHANGELOG (compare)

  • Dec 10 23:46
    johnmaxwell commented #116
  • Dec 10 21:54

    flash-gordon on master

    Halt with mutable backtrace Ex… Merge pull request #116 from jo… (compare)

  • Dec 10 21:54
    flash-gordon closed #116
  • Dec 10 21:54
    flash-gordon commented #116
  • Dec 10 21:49
    johnmaxwell commented #116
  • Dec 10 21:47
    johnmaxwell commented #116
  • Dec 10 21:43
    johnmaxwell commented #116
  • Dec 10 21:39
    johnmaxwell commented #116
Fran Worley
@fran-worley
When you call predicate.curry it intern calls Predicate.new passing in the curried version as the block
Therefore it's not enough to get the argument names on initialisation as calling block.parameters after it has been curried simply returns :rest not the actual parameters
Piotr Solnica
@solnic
ah shit
yeah that's what I'm talking about when I say that it'd be great to see MRI getting better FP features rather than some rails-inspired nonsenses
Gregory Huczynski
@greghuc
@solnic thanks for the code. Will start on API refactor with dry-validation and dry-type soon.
Piotr Solnica
@solnic
well, we have no other choice than to extend predicate with options and store needed data there
Fran Worley
@fran-worley
@solnic thats what I figured is it a significant performance hit?
Piotr Solnica
@solnic
shouldn't be, we're gonna have more stuff stored in predicates but we don't create predicate instances at runtime in dry-v so
won't affect it too much
the biggest perf gain we can get is to simplify error/hint compilers anyway
Fran Worley
@fran-worley
Ok cool. If you try and call an argument without having provided all args should it raise an error? I think at the moment it just fills the unknowns in with nil instead
Piotr Solnica
@solnic
we curry predicates when building rules for a schema, then it's just calling predicates with the remaining args
once you get the arity in, you can raise an error
this would be a good improvement, i thought about it already but didn't bother as I was focused more on dry-v
it even crossed my mind to make it auto-curry like in rom relations but thought I won't do it since I don't have an immediate use-case yet
Chris Richards
@cmrichards
Hey. Dry-validation will tell me if my form params are valid, but how would I then create an object representing the form that has attributes with the correct types?
Luca Guidi
@jodosha
@solnic @timriley @fran-worley @AMHOL @tak1n here's the PR that integrates dry-validation with hanami-validations: hanami/validations#100 :100: - It will land in master next week, the release will happen after dry-v 0.8. Thank you all for your support! :green_heart: :blue_heart: :yellow_heart:
Fran Worley
@fran-worley
@jodosha looks great! :thumbsup:
@timriley @solnic Any objections to merging dry-rb/dry-validation#155 into master ?
Luca Guidi
@jodosha
:)
Piotr Solnica
@solnic
@fran-worley looks good
Fran Worley
@fran-worley
@solnic I'd love to have your thoughts on this: dry-rb/dry-logic#13
Piotr Solnica
@solnic
I'll check it out later today, busy working atm
Fran Worley
@fran-worley
@solnic no worries, I have to say now that I actually understand how the gem works I love it even more. :smiley_cat:
Piotr Solnica
@solnic
oh thanks :)
Fran Worley
@fran-worley
It really is rather clever!
(not that I was expecting anything less!)
Piotr Solnica
@solnic
I'm glad you liked it, I hope it's not that bad-type-of-clever though ;)
Fran Worley
@fran-worley
I don't think so, it is a bit hard to follow in places because there are no comments anywhere but I think I get it now!
Piotr Solnica
@solnic
sorry about that, I stopped writing yard comments in early-stage projects
the only really complex part is dealing with results, the rest is pretty simple
the good part though, is that we can continue improving it separately from types and validation, as long as ast stays the same we don't have to update validation/types
there are two things we rely on, ast format and result api, in dry-v a schema result implements logic's result api
Fran Worley
@fran-worley
@solnic it really was a stroke of genius to separate it. I am starting to use it to process non validation rules.
I had written something myself but it was not nearly as elegant or powerful
Piotr Solnica
@solnic
I can't wait to implement dry-v's equivalent in Clojure with 50LOC :laughing:
Piotr Solnica
@solnic
@fran-worley yeah this is a general purpose library, I'm pretty sure I will use it in other places too
Don Morrison
@elskwid
Now we just need to figure out how to get the big-refactors and other stuff out of Piotr’s head and into issues so we can help. :wink:
Fran Worley
@fran-worley
@solnic I think it's safe to say that changing the ast is a breaking change...
Finished in 6.18 seconds (files took 0.9631 seconds to load)
2256 examples, 1040 failures, 68 pending
Piotr Solnica
@solnic
@fran-worley yes it is
@fran-worley but this change isn't a big one, should be simple to fix
Phil Schalm
@pnomolos
For anyone using dry-types with Rails, dry-types-rails 0.3.0 was just released, which should (hopefully) solve a bunch of issues with using custom types in development :) https://rubygems.org/gems/dry-types-rails/
Thanks to @jeromegn and @AMHOL in making it happen
Andy Holland
@AMHOL
:+1: Nice one
Phil Schalm
@pnomolos
I am aware of issues if you have tendencies to mash reload and edit really rapidly (likely a race condition) but I don’t know if I’m going to bother fixing that. The better fix is to drink less coffee and calm down ;)
Andy Holland
@AMHOL
lol
Probably needs a mutex around the REGISTERED_TYPES stuff?
Phil Schalm
@pnomolos
I’m not sure, it actually may be a race condition with respect to the reloading code, since we’re doing the type re-registration out-of-band (only after ActiveSupport::Dependencies has completed its reload cycle)
I’ll try adding a mutex, though, to see if that fixes the problem