-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
There are some things you can construct by using the constructors directly that don't make sense, aren't useful, or can be represented in several ways
Choice [] -- Doesn't match anything
Choice [foo,foo] = foo
Choice [Choice foo] = Choice [foo]
Tuple [] = Constant (Aeson.Array Vector.empty) = Array (LengthtBound (Just 0) (Just 0))
Null -- Same as Constant Aeson.Null
LengthBound (Just -2) (Just -1) -- Doesn't match anythingSome of these are hard to fix we can not (afaict) use a (Hash)Set for Choice since Aeson doesn't implement Ord or Hashable.
We can fix some of this by unexposing the constructors and only using smart constructors instead, <|> for Choice, <+> for Tuple, Value etc could have a Maybe Bound instead so you can create one by doing mkBound <$> foo 1 <*> foo 2.
I'm going to remove Null in the next release, but I'll let the rest air out for a bit.
Reactions are currently unavailable