morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Util.StubbedProof

Description

Utilities for (slightly unsafely) stubbing typelevel proofs.

Synopsis

Documentation

assumeKnown :: forall xs. Stubbed => KList xs Source #

Assume a KnownList by providing a fake KList. Can only be done inside a Stubbed proof. This is not entirely safe due to the existence of things like Any, and with enough effort one could theoretically get an unsafeCoerce out of a proof that uses this, but arguably it's "safe enough".

assumeSing :: forall x. Stubbed => Sing x Source #

Assume SingI by providing a fake Sing. Can only be done inside a Stubbed proof. Same caveats apply as with assumeKnown.

stubProof :: forall a b. (Stubbed => a :~: b) -> a :~: b Source #

Ignore the first argument and instead unsafeCoerce the result. It is assumed that the first argument constitutes a semi-proper proof.