diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-01-26 23:43:23 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-01-26 23:43:40 +0100 |
commit | fb7156b4aa11f154c3673504ac1f44407ccb0439 (patch) | |
tree | b5b112a97dbbf016d3eed5dbda9805c7913d7afc /src/AST.hs | |
parent | b90cc8077492d56989b06e6da947ab5c40badef8 (diff) |
Linear-time tape reconstruction
A tutorial of the method here: https://play.haskell.org/saved/uHuGLfHZ
Diffstat (limited to 'src/AST.hs')
-rw-r--r-- | src/AST.hs | 16 |
1 files changed, 0 insertions, 16 deletions
@@ -72,12 +72,6 @@ deriving instance Show (SScalTy t) type TIx = TScal TI64 -type Idx :: [k] -> k -> Type -data Idx env t where - IZ :: Idx (t : env) t - IS :: Idx env t -> Idx (a : env) t -deriving instance Show (Idx env t) - type family ScalRep t where ScalRep TI32 = Int32 ScalRep TI64 = Int64 @@ -219,16 +213,6 @@ vecLength :: Vec n t -> SNat n vecLength VNil = SZ vecLength (_ :< v) = SS (vecLength v) -infixr @> -(@>) :: env :> env' -> Idx env t -> Idx env' t -WId @> i = i -WSink @> i = IS i -WCopy _ @> IZ = IZ -WCopy w @> (IS i) = IS (w @> i) -WPop w @> i = w @> IS i -WThen w1 w2 @> i = w2 @> w1 @> i -WClosed _ @> i = case i of {} - weakenExpr :: env :> env' -> Expr x env t -> Expr x env' t weakenExpr w = \case EVar x t i -> EVar x t (w @> i) |