diff --git a/.github/workflows/ci-full-bootstrap.yml b/.github/workflows/ci-full-bootstrap.yml index e523651e3..575b72092 100644 --- a/.github/workflows/ci-full-bootstrap.yml +++ b/.github/workflows/ci-full-bootstrap.yml @@ -2,7 +2,7 @@ name: Idris bootstrap on: push: branches: - - master + - '*' tags: - '*' diff --git a/src/Compiler/ES/Imperative.idr b/src/Compiler/ES/Imperative.idr index 39fc993b2..53939fb88 100644 --- a/src/Compiler/ES/Imperative.idr +++ b/src/Compiler/ES/Imperative.idr @@ -54,14 +54,17 @@ genName = pure $ MN "imp_gen" i mutual + ifThenElse : Bool -> a -> a -> a + ifThenElse True t e = t + ifThenElse False t e = e pairToReturn : (toReturn : Bool) -> (ImperativeStatement, ImperativeExp) -> - Core (if toReturn then ImperativeStatement else (ImperativeStatement, ImperativeExp)) + Core (ifThenElse toReturn ImperativeStatement (ImperativeStatement, ImperativeExp)) pairToReturn False (s, e) = pure (s, e) pairToReturn True (s, e) = pure $ s <+> ReturnStatement e expToReturn : (toReturn : Bool) -> ImperativeExp -> - Core (if toReturn then ImperativeStatement else (ImperativeStatement, ImperativeExp)) + Core (ifThenElse toReturn ImperativeStatement (ImperativeStatement, ImperativeExp)) expToReturn False e = pure $ (DoNothing, e) expToReturn True e = pure $ ReturnStatement e @@ -78,7 +81,7 @@ mutual pure (concat (map fst a), map snd a) impExp : {auto c : Ref Imps ImpSt} -> (toReturn : Bool) -> NamedCExp -> - Core (if toReturn then ImperativeStatement else (ImperativeStatement, ImperativeExp)) + Core (ifThenElse toReturn ImperativeStatement (ImperativeStatement, ImperativeExp)) impExp toReturn (NmLocal fc n) = expToReturn toReturn $ IEVar n impExp toReturn (NmRef fc n) = expToReturn toReturn $ IEVar n impExp toReturn (NmLam fc n e) = expToReturn toReturn $ IELambda [n] !(impExp True e)