Require `WellTyped` in `sampleTypedValue`
Clarification and motivation
This sounds good because whenever we get a type in typed representation (some Sing (t :: T.T)
), we can expect it to have WellTyped t
constraint alongside. So
-
sampleTypedValue
should requireWellTyped
. However, this is quite hard to do because of how our types are distributed across modules, for that you first need to find a way: 1.1. to moveWellTyped
outside fromMichelson.Typed.Haskell.Value
, probably to someMichelson.Typed.WellTyped
1.2. to moveComparable
fromMichelson.Typed.Haskell.Value
toMichelson.Typed.Scope
- Most cases when we are currently producing
Nothing
will not be possible anymore, e.g.STSet
case will always produce some value. We have to refactor the code to avoid producingNothing
; for GHC it must be clear that key type ofSTSet
is comparable.
Acceptance criteria
-
WellTyped
constraint is properly added tosampleTypedValue
.