This commit is contained in:
crumbtoo
2024-02-02 19:15:39 -07:00
parent 38d1044f5d
commit 21d13ea73b
2 changed files with 34 additions and 4 deletions

View File

@@ -59,8 +59,9 @@ import Data.Char
import GHC.Generics
-- Lift instances for the Core quasiquoters
import Language.Haskell.TH.Syntax (Lift)
import Lens.Micro.TH (makeLenses)
import Lens.Micro
-- import Lens.Micro.TH (makeLenses)
-- import Lens.Micro
import Control.Lens
----------------------------------------------------------------------------------
data Expr b = Var Name
@@ -152,6 +153,12 @@ makeLenses ''Program
makeBaseFunctor ''Expr
pure []
-- this is a weird optic, stronger than Lens and Prism, but weaker than Iso.
programTypeSigsP :: (Hashable b) => Prism' (Program b) (HashMap b Type)
programTypeSigsP = prism
(\b -> mempty & programTypeSigs .~ b)
(Right . view programTypeSigs)
type ExprF' = ExprF Name
type Program' = Program Name