From: Matthijs Kooijman Date: Mon, 2 Feb 2009 14:27:20 +0000 (+0100) Subject: Allow variables to be bound to complex expressions. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=9bffa6fd1ddc30866e7092ee477c0ee03a10a062;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Allow variables to be bound to complex expressions. Previously, variables (in let expressions for example) could only be bound to single values. This enables them to be bound to for example tuples as well. --- diff --git a/Translator.hs b/Translator.hs index 2f6a292..bdf6688 100644 --- a/Translator.hs +++ b/Translator.hs @@ -137,10 +137,10 @@ expandExpr binds lam@(Lam b expr) = do res_signal') expandExpr binds (Var id) = - return ([], [], [], Single (signal_id, ty)) + return ([], [], [], bind) where -- Lookup the id in our binds map - Single (signal_id, ty) = Maybe.fromMaybe + bind = Maybe.fromMaybe (error $ "Argument " ++ getOccString id ++ "is unknown") (lookup id binds)