Skip to content

Instantly share code, notes, and snippets.

@emmanueldenloye
Created November 29, 2018 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmanueldenloye/23c40e291ed2b98a61fc03ccc6d3f7d2 to your computer and use it in GitHub Desktop.
Save emmanueldenloye/23c40e291ed2b98a61fc03ccc6d3f7d2 to your computer and use it in GitHub Desktop.
Code golfing??
guardTable :: Show n => FunApp -> Term n -> Eval e ()
guardTable i TTable {..} = do
r <- uses evalCallStack (alaf Last foldMap (firstOf (sfApp . _Just . _1 . faModule . _Just)))
case r of
(Just mn) | mn == _tModule -> enforceBlessedHashes i _tModule _tHash
_ -> do
m <- getModule (_faInfo i) _tModule
enforceKeySetName (_faInfo i) (_mKeySet m)
guardTable i t = evalError' i $ "Internal error: guardTable called with non-table term: " ++ show t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment