PacketP
PacketP[]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify an object or model.
PacketP[types]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify an object that is one of types or their sub-types.
PacketP[types, fields]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify an object of types, and contains fields.
PacketP[type]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify an object or model of type or it's sub-types.
PacketP[types, field]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify an object or model that is one of types or their sub-types, and contains the field.
PacketP[Object]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify an object.
PacketP[Model]⟹pattern
returns a pattern which describes a packet that can be uploaded to modify a model.
Examples
Basic Examples (5)
Matches a packet that can be uploaded:
An empty Association is not a valid ChangePacket:
Returns a pattern that matches a ChangePacket with any sub-type of the specified types:
Does not match any expression which is not an Association:
Does not evaluate if not given an expression in the form of an Object/Model type:
Additional Examples (11)
Returns a pattern that matches any Object:
Returns a pattern that matches any Model:
Fields (6)
Does not match an Association with keys that are not symbols:
If you try a bad operation that is going to match the pattern but will not be Uploaded so tread carefully:
Fields can be specified as required:
Single fields can be specified:
Operations can be specified as required:
Specifying a field will match an operation on that field:

