From 6368bcbe38de237d99a81efea9b8cbeb86fd2dea Mon Sep 17 00:00:00 2001 From: Brian Huffman Date: Wed, 12 Nov 2014 13:27:49 -0800 Subject: [PATCH] Make evaluation of lists of bits non-strict in the elements. This means that e.g. [True, error "foo"]@0 evaluates to True, similar to how [0x1, error "foo"]@0 evaluates to 0x1. --- src/Cryptol/Eval.hs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Cryptol/Eval.hs b/src/Cryptol/Eval.hs index 796d7e16..00fb0daf 100644 --- a/src/Cryptol/Eval.hs +++ b/src/Cryptol/Eval.hs @@ -43,7 +43,7 @@ evalExpr env expr = case expr of ECon con -> evalECon con - EList es ty -> evalList env es (evalType env ty) + EList es ty -> VSeq (isTBit (evalType env ty)) (map (evalExpr env) es) ETuple es -> VTuple (map eval es) @@ -208,15 +208,3 @@ evalMatch env m = case m of -- they are typechecked that way; the read environment to evalDecl is the same -- as the environment to bind a new name in. Let d -> [evalDecl env d env] - - --- Lists ----------------------------------------------------------------------- - --- | Evaluate a list literal, optionally packing them into a word. -evalList :: EvalEnv -> [Expr] -> TValue -> Value -evalList env es ty = toPackedSeq w ty (map (evalExpr env) es) - where - w = TValue $ tNum $ length es - - -