Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:01
    Travis dry-rb/dry-view (master) errored (636)
  • 09:58
    Travis dry-rb/dry-view (master) errored (635)
  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • 09:54

    dry-bot on master

    [devtools] config sync (compare)

Piotr Solnica
@solnic
it's easier to TDD when mostly you care about inputs/outputs right? :)
Fran Worley
@fran-worley
@solnic thats my plan. What do you think about the AST change?
Piotr Solnica
@solnic
I like it, this is a pretty useful piece of info
we're gonna allocate more arrays but that shouldn't hurt esp that we can simplify code in dry-v thanks to this change
Fran Worley
@fran-worley
I don't think we can loose the input value from the result ast just yet as it isn't always exactly the same. but for error messages in dry-v it means that you can just focus on the predicate part as that has all the info including the input
Piotr Solnica
@solnic
right, the result part of dry-logic is the complicated part
I hope we can improve this over time
I esp don't like that we evaluate input two times :(
Fran Worley
@fran-worley
and when you recreate the predicate it causes all sorts of issues as I keep loosing the argument names...
Piotr Solnica
@solnic
wow wait, wdym by 'recreate predicate'?
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