Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 07:42

    flash-gordon on master

    Add note about Do::All caveat … Merge pull request #134 from ma… (compare)

  • 07:42
    flash-gordon closed #134
  • 07:42
    flash-gordon commented #134
  • 07:37
    flash-gordon closed #130
  • 07:37
    flash-gordon commented #130
  • Nov 28 22:36

    dry-bot on master

    [devtools] sync (compare)

  • Nov 28 22:35

    flash-gordon on keep-method-visibility

    (compare)

  • Nov 28 22:35

    flash-gordon on master

    Add specs that demonstrate the … When wrapping methods, be expli… Visbility-preserving API for Do… and 3 more (compare)

  • Nov 28 22:35
    flash-gordon closed #136
  • Nov 28 22:10
    flash-gordon synchronize #136
  • Nov 28 22:10

    flash-gordon on keep-method-visibility

    Update changelog (compare)

  • Nov 28 22:01
    flash-gordon ready_for_review #136
  • Nov 28 22:01
    flash-gordon commented #136
  • Nov 28 21:58
    flash-gordon synchronize #136
  • Nov 28 21:58

    flash-gordon on keep-method-visibility

    Keep visibility without changin… (compare)

  • Nov 28 21:34
    flash-gordon synchronize #136
  • Nov 28 21:34

    flash-gordon on keep-method-visibility

    Keep visibility without changin… (compare)

  • Nov 28 21:28
    flash-gordon edited #136
  • Nov 28 21:01
  • Nov 28 19:53
    arempe93 starred dry-rb/dry-monads
Andy Holland
@AMHOL
I haven't
Wanted to add more built-in validations, but haven't had time or enthusiasm to work on stuff lately
Feel free to release it as-is though
Piotr Solnica
@solnic
I’ll be working on it after dry-data is released and usable
Piotr Solnica
@solnic
irb(main):009:0> t = Dry::Data.method(:[])
irb(main):010:0> maybe_coercible_string = t.('strict.nil') | t.('coercible.string')
irb(main):011:0> maybe_coercible_string[nil]
=> None
irb(main):012:0> maybe_coercible_string[123]
=> Some("123")
oh haters gonna hate so much <3
Andy Holland
@AMHOL
Lol
Does None pass a nil check?
Piotr Solnica
@solnic
@AMHOL nope it doesn't pretend to be a nil
Andrew Kozin
@nepalez

@AMHOL @solnic As far as i inderstood, you've implemented namespace in dry-container as... well, namespace :)
I mean, it seems like a syntax sugar for long keys like "namespace.name" added via namespaced(key) method, innit?

I think, why not (re)implement it as a nested container(s), whose methods are available from the "parent" container via nested name.
This would allow importing "namespaces - containers" from one to another. Like in case:

foo = Dry::Container.new
foo.namespace(:bar) do
  register(:baz) { :BAZ }
end

qux = Dry::Container.new do
  import foo.namespace(:bar), as: :fbar # here resolve has to be reloaded to work with both variables and namespaces
                                        # also namespace w/o block would just return the namespace
end

qux.resolve("fbar.baz") # => :BAZ

I think about this feature in connection to dry-data. When I read dry-data, the first thing I asked myself is: how to take some types defined inside one module and inject them to another. Just like in Haskell:

import Data.Char (toLower, toUpper)

or in transproc (the same haskell-inspired mechanism)

import :camelize, from: Inflecto, as: :up
Piotr Solnica
@solnic
@nepalez yeah I totally thought about exact some thing the other day /c @AMHOL
Piotr Solnica
@solnic
I should be able to release dry-data later today btw
Piotr Solnica
@solnic
class Address < Dry::Data::Struct
  define do
    attr :city, "strict.string"
    attr :zipcode, "coercible.string"
  end
end
wdyt about this dsl ^ ??
:+1: or :-1: ?
Benjamin Klotz
@tak1n
why not attr on class level?
Luca Guidi
@jodosha
@solnic I have the same question, of @tak1n: why not at the class level (aka w/o define)? Is that because you want the block to be lazily eval'd?
Hannes Nevalainen
@kwando
@solnic I don't like that define block tbh
but I'll use it anyway =P
Piotr Solnica
@solnic
ended up with the same as virtus
Hannes Nevalainen
@kwando
:thumbsup:
Piotr Solnica
@solnic
the block gives you an opportunity to set some additional stuff common for all attr definitions, but that would be premature
so whatever ;)
Hannes Nevalainen
@kwando
I like the API virtus has, it "feels right"
Piotr Solnica
@solnic
ok ;)
the attribute options are horrible though, dry-data won’t have that
Hannes Nevalainen
@kwando
maybe horrible on the backside =P
Piotr Solnica
@solnic
I think it’s horrible on both sides
Hannes Nevalainen
@kwando
tbh I'm only using the :default option anyway =P
stupid markdown
Piotr Solnica
@solnic
btw I ported my app to dry-data for domain entities, so I guess I could push 0.0.1
@kwando ^
Hannes Nevalainen
@kwando
woho! =D
Piotr Solnica
@solnic
@kwando not sure how usable it’s gonna be for you, there’s a lot of rough edges wrt error handling
Piotr Solnica
@solnic
so I just pushed dry-data 0.0.1 to rubygems /cc @kwando
Luca Guidi
@jodosha
:clap:
Benjamin Klotz
@tak1n
:clap: :shipit:
Piotr Solnica
@solnic
lol ;)
Benjamin Klotz
@tak1n
:D
Piotr Solnica
@solnic
it’s an early alpha, I’m sure it’s gonna crash for you :joy:
otoh my app is working so that gives some level of confidence ;0
Benjamin Klotz
@tak1n
hehe for sure :P
now Ill ask u twice as often
another lib from u I want to use :D
solnic QA team -> open position
Piotr Solnica
@solnic
haha :)
I mean it’s a good start, so please try it out :) I didn’t mean to discourage you
I think the really tricky part will be APIs for defining types that are suitable for form-input
Benjamin Klotz
@tak1n
u didn't discourage me ;)
Piotr Solnica
@solnic
with nasty stuff like “something that can be an empty string, which then we want to turn into nil unless it’s a string parsable to a date"