These are chat archives for dry-rb/chat

21st
Apr 2017
Piotr Solnica
@solnic
Apr 21 2017 13:48
dry-rb/dry-schema#1 <= such PR :scream_cat:
that so edgy version even those from us who are living on the edge cannot have it :smile:
Piotr Solnica
@solnic
Apr 21 2017 14:01
@gotar super edgy ;)
I’m cleaning this up
should be mergable in a second
Gustavo Caso
@GustavoCaso
Apr 21 2017 14:17
What a PR @solnic :smile:
John Backus
@backus
Apr 21 2017 18:53
Small gotcha that I just ran into
require 'dry/types'

type = Dry::Types::Definition.new(Object)

class Foo
end

class Decorator < SimpleDelegator
end

type.try(Foo.new).success?                # => true
type.try(Decorator.new(Foo.new)).success? # => false
Not totally sure what behavior I think is correct here!
SimpleDelegator does inherit from BasicObject so that is why this happens
The practical part of me doesn't want to think about the fact that SimpleDelegator is a BasicObject
but also it seems like special casing delegators might be weird
thoughts @solnic @flash-gordon?
Nikita Shilnikov
@flash-gordon
Apr 21 2017 19:05
@backus heh, yes, Types::Object isn't meant to do any checks, it should act as Identity, i.e. -> (v) { v }. I'd say this is a bug. I think we should rename it to Types::Any or Types::Bottom for clarity
John Backus
@backus
Apr 21 2017 19:06
We have it aliased to Types::Any it our app
so I'd endorse Any
Nikita Shilnikov
@flash-gordon
Apr 21 2017 19:06
yeah bottom is too geeky :)
John Backus
@backus
Apr 21 2017 19:07
heh
Nikita Shilnikov
@flash-gordon
Apr 21 2017 19:07
but maybe we could attract some folks from Haskell with that lol
John Backus
@backus
Apr 21 2017 19:07
I write Ruby so I don't have to read wikipedia pages about category theory :P
John Backus
@backus
Apr 21 2017 21:06
Haha same bug just bit me again