con-kitty / categorifier

Interpret Haskell programs into any cartesian closed category.
BSD 3-Clause "New" or "Revised" License
57 stars 2 forks source link

Add a test for AxiomInstCo #73

Open zliu41 opened 2 years ago

zliu41 commented 2 years ago

I don't think we have a test case for this part of the code

Plugins.Cast from0 Plugins.AxiomInstCo {}
  | Plugins.isPredTy (Plugins.exprType from0) -> do
      inlined <- flip loopM from0 $ \from -> do
        ( \case
            Plugins.Cast from' _ ->
              if Plugins.isPredTy (Plugins.exprType from')
                then Left from'
                else Right from'
            other -> Left other
          )
          <$> (simplifyFun dflags logger [] =<\< mkInline from)
      categorifyLambda name
        =<\< simplifyFun dflags logger [] (Plugins.mkCoreApps inlined args)

outside of Heavisoft.