Discussion:
Difference plans
Leon Grapenthin
2016-04-11 12:53:13 UTC
Permalink
Are there plans to support arbitrary differences?

I. e. (t/Difference t/Any (t/Value :foo))
Ambrose Bonnaire-Sergeant
2016-04-11 21:44:05 UTC
Permalink
Hi Leon,

Difference is half-baked at the moment. Is there a particular use-case
you're thinking of?

I added Difference to try and eliminate negation types, but I don't know
if that justifies its existence in hindsight.

eg. (I Any (Not (t/Value :foo)))

Thanks,
Ambrose
Post by Leon Grapenthin
Are there plans to support arbitrary differences?
I. e. (t/Difference t/Any (t/Value :foo))
Leon Grapenthin
2016-04-12 11:06:00 UTC
Permalink
I was trying to create a map like Kayleen Wheeler did in another thread.

The particular usecase is a user specified configuration map for component
systems. It's the second argument to this
fn https://github.com/funzt/component.config/blob/master/src/funzt/component/config.cljc#L10

The docstring says "Keys with the namespace \"setup\" are reserved options",
of which the lib currently uses one. So the best case would be sth. like

(t/U (t/Map (t/Difference t/All (t/KeywordWithNs "setup")) t/All) (t/HMap
:optional {:setup/disabled (t/Set t/Any)} :complete? true))

Obviously t/KeywordWithNs doesn't exist, so I thought I could at least try
sth. like

(t/U (t/Map (t/Difference t/All (t/Value :setup/disabled)) t/All) (t/HMap
:optional {:setup/disabled (t/Set t/Any)} :complete? true))

Kind regards,
Leon.



On Monday, April 11, 2016 at 11:44:25 PM UTC+2, Ambrose Bonnaire-Sergeant
Post by Ambrose Bonnaire-Sergeant
Hi Leon,
Difference is half-baked at the moment. Is there a particular use-case
you're thinking of?
I added Difference to try and eliminate negation types, but I don't know
if that justifies its existence in hindsight.
eg. (I Any (Not (t/Value :foo)))
Thanks,
Ambrose
Post by Leon Grapenthin
Are there plans to support arbitrary differences?
I. e. (t/Difference t/Any (t/Value :foo))
Loading...