Description
copilot-theorem uses the LambdaCase language extension. There is a preference for a simpler version of Copilot and minimizing the extensions used.
Since LambdaCase does not really save much code and is not really needed, it should be removed from the codebase.
Type
- Management: Compliance with style guide.
Additional context
None.
Requester
Method to check presence of bug
While we cannot programmatically check whether LambdaCase is or is not needed, we can check that it is present by running grep on the codebase:
$ grep -nHre 'LambdaCase' --include='*.hs'
copilot-theorem/src/Copilot/Theorem/TransSys/Operators.hs:3:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/Prover/SMT.hs:3:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/Prover/TPTP.hs:2:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/Prover/Z3.hs:4:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/IL/Spec.hs:3:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/IL/Transform.hs:1:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/IL/Translate.hs:2:{-# LANGUAGE LambdaCase #-}
copilot-theorem/src/Copilot/Theorem/What4.hs:5:{-# LANGUAGE LambdaCase #-}
Note that the module Copilot.Theorem.Prover.Z3 is no longer needed, so its use of LambdaCase can be ignored.
Expected result
No modules in Copilot use LambdaCase.
Desired result
No modules in Copilot use LambdaCase.
Proposed solution
Replace all uses of \case with \<variable> -> case <variable> of across the codebase, where <variable> is a variable name that matches the input to which case selection is being applied.
Remove LambdaCase from the list of extensions used by all files.
Further notes
None.
Description
copilot-theoremuses theLambdaCaselanguage extension. There is a preference for a simpler version of Copilot and minimizing the extensions used.Since
LambdaCasedoes not really save much code and is not really needed, it should be removed from the codebase.Type
Additional context
None.
Requester
Method to check presence of bug
While we cannot programmatically check whether
LambdaCaseis or is not needed, we can check that it is present by running grep on the codebase:Note that the module
Copilot.Theorem.Prover.Z3is no longer needed, so its use ofLambdaCasecan be ignored.Expected result
No modules in Copilot use
LambdaCase.Desired result
No modules in Copilot use
LambdaCase.Proposed solution
Replace all uses of
\casewith\<variable> -> case <variable> ofacross the codebase, where<variable>is a variable name that matches the input to which case selection is being applied.Remove
LambdaCasefrom the list of extensions used by all files.Further notes
None.