Cosmetic: give function a more descriptive name

This commit is contained in:
Evan Czaplicki 2013-12-23 17:02:47 -08:00
parent 230c695231
commit 51ee065e6b

View file

@ -156,11 +156,11 @@ expression (L span expr) =
MultiIf branches ->
do branches' <- forM branches $ \(b,e) -> (,) <$> expression b <*> expression e
return $ case last branches of
(L _ (Var "Basics.otherwise"), _) -> els branches'
(L _ (Literal (Boolean True)), _) -> els branches'
(L _ (Var "Basics.otherwise"), _) -> safeIfs branches'
(L _ (Literal (Boolean True)), _) -> safeIfs branches'
_ -> ifs branches' (obj "_E.If" `call` [ ref "$moduleName", string (show span) ])
where
els branches = ifs (init branches) (snd (last branches))
safeIfs branches = ifs (init branches) (snd (last branches))
ifs branches finally = foldr iff finally branches
iff (if', then') else' = CondExpr () if' then' else'