We're updating the issue view to help you get more done. 

HMap merged type

Description

It would be nice to be able to merge several HMaps in order to simulate a parent-child relationship.
For example

1 2 3 4 5 6 7 8 9 10 11 (defalias Parent (t/HMap :mandatory {:type t/Keyword})) (defalias Child1 (t/HMap :mandatory {:type (t/Value :child1) :value t/Int}) (defalias Child2 (t/HMap :mandatory {:type (t/Value :child2) :size t/Int}) (ann is-child1? Parent -> t/Bool]) (defn is-child1? [child] (= (:type child) :child1))

And have that typecheck appropriately.
As of right now, one would have to do something like

1 (defalias Parent (t/U Child1 Child2))

which means you have to keep track of the definition in two places to make it work as expected.

Environment

All

Status

Assignee

Unassigned

Reporter

import

Labels

Approval

None

Patch

None

Priority

Major