fuckeverythingggg
This commit is contained in:
@@ -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) =
|
||||
|
||||
Reference in New Issue
Block a user