Implement addErrorContext as id

This commit is contained in:
Domen Kožar 2018-08-05 22:58:52 +01:00
parent a556443aea
commit 6033a49e6d
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246

View file

@ -148,6 +148,7 @@ builtinsList = sequence [
, add0 Normal "nixPath" nixPath
, add TopLevel "abort" throw_ -- for now
, add2 Normal "add" add_
, add2 Normal "addErrorContext" addErrorContext
, add2 Normal "all" all_
, add2 Normal "any" any_
, add Normal "attrNames" attrNames
@ -982,6 +983,10 @@ trace_ msg action = do
traceEffect . Text.unpack =<< fromValue @Text msg
action
-- TODO: remember error context
addErrorContext :: forall e m. MonadNix e m => m (NValue m) -> m (NValue m) -> m (NValue m)
addErrorContext _ action = action
exec_ :: forall e m. MonadNix e m => m (NValue m) -> m (NValue m)
exec_ xs = do
ls <- fromValue @[NThunk m] xs