Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 20:32

    dry-bot on master

    [devtools] sync (compare)

  • Feb 22 17:27
    dskecse starred dry-rb/dry-monads
  • Feb 21 12:45
    sadjow commented #344
  • Feb 20 17:31
    jswanner commented #141
  • Feb 20 06:15
    lazebny starred dry-rb/dry-types
  • Feb 19 22:35
    solnic commented #141
  • Feb 19 22:32

    solnic on v0.17.0

    (compare)

  • Feb 19 22:32

    solnic on master

    Bump dry-system to 0.17.0 (compare)

  • Feb 19 22:31

    solnic on 141-fix-compat-with-dry-configurable

    Bump dry-system to 0.17.0 (compare)

  • Feb 19 22:31

    dry-bot on master

    [devtools] update changelog.yml… [devtools] sync (compare)

  • Feb 19 22:27

    solnic on 141-fix-compat-with-dry-configurable

    (compare)

  • Feb 19 22:27

    solnic on master

    Fix compatibility with dry-conf… Merge pull request #142 from dr… (compare)

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"
Benjamin Klotz
@tak1n
hehe so exactly what I need
Piotr Solnica
@solnic
we really really need a system that would allow us to define things like that
Benjamin Klotz
@tak1n
empty string -> date?
ah fuck "".to_i is zero
this to Date is a valid Date
:D
FUN
irb(main):009:0> Date.new("".to_i)
=> #<Date: 0000-01-01 ((1721058j,0s,0n),+0s,2299161j)>
irb(main):010:0> Date.new("")
ArgumentError: comparison of String with 0 failed
        from (irb):10:in `<'
        from (irb):10:in `new'
        from (irb):10
        from /usr/bin/irb:11:in `<main>'