fuckeverythingggg

This commit is contained in:
2026-07-10 21:14:50 -06:00
parent 8bed7f09a5
commit 82927608d4
5 changed files with 29 additions and 343 deletions
-29
View File
@@ -30,11 +30,6 @@ import qualified Data.Vector.Strict as V
import Data.IntMap.Strict (IntMap)
type Emit = Writer (Vector Text)
runEmit :: Eff (Emit : es) a -> Eff es (a, Text)
runEmit = (mapped . _2 %~ fold) . runWriter
data Env = MkEnv { vars :: Vector Name }
deriving (Show, Generic)
@@ -49,35 +44,11 @@ instance Ixed Env where
-- countLocals :: Exp -> Int
-- countLocals (ExpPrim p rs es) = length rs + sumOf (each . to countLocals) es
-- countLocals (ExpFix bs e) =
-- sumOf (each . _2 . _MkKappa . ((_1 . each . to (const 1))
-- <> (_2 . to countLocals))) bs
-- + countLocals e
-- countLocals (ExpApply _ _) = 0
tshow :: Show a => a -> Text
tshow = T.pack . show
data Module = MkModule
{ funcs :: IntMap Func
}
deriving (Show, Generic)
data Func = MkFunc
{ code :: Text
, numLocals :: Int
}
deriving (Show, Generic)
lowerVal :: Env -> Val -> Vector Text
lowerVal g (ValLit l) =