ЗП
data SchemaKind :: forall k. k -> Type
data SchemaKind a
foreign import data Prim :: forall a. a -> SchemaKind a
foreign import data Obj :: forall a. SchemaKind a
foreign import data Arr :: forall a. SchemaKind a
foreign import data Null :: forall a. SchemaKind a
newtype Leibniz :: forall k. k -> k -> Type
newtype Leibniz a b = Leibniz (forall f. f a -> f b)
infix 4 type Leibniz as ~
data Primitive a
= SInt (a ~ Int)
| SString (a ~ String)
| SBool (a ~ Boolean)
| SNumber (a ~ Number)
data Lens a b = Lens (a -> b) (b -> a -> a)
data Schema t r t2
= SPrimitive (Primitive t) (Lens r t) (t ~ Prim t)
пока не могу понять как скастить правильно каинды