diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Revision history for mischief-render
 
+# 0.1.2.0 
+
+* Added `updateFragment` function for updating a material's fragment shader at runtime. 
+* Fixed a memory leak in relation to pipeline caching. 
+
 ## 0.1.1.0
 
 * Added `windowToWorldPos` function. 
diff --git a/mischief-render.cabal b/mischief-render.cabal
--- a/mischief-render.cabal
+++ b/mischief-render.cabal
@@ -18,7 +18,7 @@
 -- PVP summary:     +-+------- breaking API changes
 --                  | | +----- non-breaking API additions
 --                  | | | +--- code changes with no API change
-version: 0.1.1.0
+version: 0.1.2.0
 -- A short (one-line) description of the package.
 -- synopsis:
 -- A longer description of the package.
@@ -137,7 +137,7 @@
   -- Other library packages from which modules are imported.
   build-depends:
     async >=2.2.6 && <2.3,
-    base >=4.21.0.0 && <4.22,
+    base ^>=4.21,
     binary >=0.8.9 && <0.9,
     bytestring >=0.12.2 && <0.13,
     containers >=0.7 && <0.8,
@@ -221,7 +221,7 @@
   -- Test dependencies.
   build-depends:
     async,
-    base,
+    base ^>=4.21,
     bytestring,
     containers,
     data-default,
@@ -246,7 +246,7 @@
   hs-source-dirs: examples
   build-depends:
     async,
-    base,
+    base ^>=4.21,
     bytestring,
     containers,
     data-default,
@@ -321,7 +321,7 @@
   hs-source-dirs: examples/
   build-depends:
     async,
-    base,
+    base ^>=4.21,
     bytestring,
     containers,
     data-default,
@@ -360,7 +360,7 @@
 
   build-depends:
     async,
-    base,
+    base ^>=4.21,
     bytestring,
     containers,
     data-default,
@@ -396,7 +396,7 @@
   hs-source-dirs: examples/
   build-depends:
     async,
-    base,
+    base ^>=4.21,
     bytestring,
     containers,
     data-default,
diff --git a/src/Mischief/Render/Material/Pipeline.hs b/src/Mischief/Render/Material/Pipeline.hs
--- a/src/Mischief/Render/Material/Pipeline.hs
+++ b/src/Mischief/Render/Material/Pipeline.hs
@@ -14,12 +14,14 @@
 import Data.Set qualified as Set
 import Data.Text qualified as T
 import Data.Text.Encoding qualified as T
+import Data.Traversable
 import Foreign (Ptr, nullPtr, with)
 import Foreign.C.ConstPtr
 import GHC.TypeLits
 import Language.Haskell.TH (Extension (AllowAmbiguousTypes))
 import Mischief.Assets (Asset (..))
 import Mischief.ECS
+import Mischief.ECS.Resources (modifyRes, modifyRes')
 import Mischief.Math qualified as Math
 import Mischief.Render.Core
 import Mischief.Render.Material.Definition
@@ -45,6 +47,27 @@
 
 newtype PipelineCache = PipelineCache (Map PipelineKey RenderPipeline) deriving anyclass (Component)
 
+-- TODO: this is just a workaround for the sake of live updating fragment shaders without needing a major version bump.
+
+updateFragment :: forall mat. (Material mat) => (VO mat GPU -> Shader mat (Vec4 Mischief.Shader.Float)) -> System ()
+updateFragment v = do
+  Just (RenderDevice device) <- res
+  bindLayout <- liftIO $ createBindLayout (Set.toList $ collectBindings @mat) (RenderDevice device)
+
+  vertShader <- liftIO $ loadShaderFromBytes device (T.encodeUtf8 $ genShader @mat @(VI mat) @(VO mat) "vertex" (Set.toList $ collectBindings @mat) (vertex @mat))
+  fragShader <- liftIO $ loadShaderFromBytes device (T.encodeUtf8 $ genShader @mat @(VO mat) @FragmentOutput "fragment" (Set.toList $ collectBindings @mat) (convertFrag v))
+
+  cache <- res @PipelineCache
+
+  for_ cache $ \(PipelineCache cache) -> do
+    let e = filter (\(c, _) -> c.materialType Prelude.== typeRep (Proxy @mat)) . Map.toList $ cache
+    -- let e = Map.toList cache
+    e <- for e $ \(c, RenderPipeline p) -> do
+      liftIO $ wgpuRenderPipelineRelease p
+      (c,) <$> liftIO (buildPipeline bindLayout vertShader fragShader (RenderDevice device) c.format)
+
+    insertRes $ PipelineCache $ foldr (\(k, a) c -> Map.insert k a c) cache e
+
 qgetPipeline :: forall mat. (Material mat) => TextureFormat -> Query System RenderPipeline
 qgetPipeline format' = do
   let format = toWGPUFormat format'
@@ -60,12 +83,17 @@
 
     case Map.lookup key cache of
       Just pipeline -> pure pipeline
-      Nothing -> liftIO $ createPipeline @mat device format
+      Nothing -> do
+        p <- liftIO $ createPipeline @mat device format
+        insertRes $ PipelineCache $ Map.insert key p cache
+        pure p
 
-createPipeline :: forall mat. (Material mat) => RenderDevice -> WGPUTextureFormat -> IO RenderPipeline
-createPipeline (RenderDevice device) format = do
-  BindLayout bindLayout <- createBindLayout (Set.toList $ collectBindings @mat) (RenderDevice device)
+type VertexShader = Ptr WGPUShaderModule
 
+type FragmentShader = Ptr WGPUShaderModule
+
+buildPipeline :: BindLayout -> VertexShader -> FragmentShader -> RenderDevice -> WGPUTextureFormat -> IO RenderPipeline
+buildPipeline (BindLayout bindLayout) vertShader fragShader (RenderDevice device) format = do
   pipelineLayoutDesc <- with bindLayout $ \bindGroupLayout -> do
     pure $
       WGPUPipelineLayoutDescriptor
@@ -79,13 +107,6 @@
   pipelineLayout <- with pipelineLayoutDesc $ \pipelineLayoutDesc -> do
     wgpuDeviceCreatePipelineLayout device (ConstPtr {unConstPtr = pipelineLayoutDesc})
 
-  -- putStrLn $ "------------------------------------------\n" ++ T.unpack (genShader @mat @(VO mat) @FragmentOutput "fragment" (collectBindings @mat) (convertFrag $ fragment @mat))
-
-  -- putStrLn $ "------------------------------------------\n" ++ T.unpack (genShader @mat @(VI mat) @(VO mat) "vertex" (Set.toList $ collectBindings @mat) (vertex @mat))
-
-  vertShader <- loadShaderFromBytes device (T.encodeUtf8 $ genShader @mat @(VI mat) @(VO mat) "vertex" (Set.toList $ collectBindings @mat) (vertex @mat))
-  fragShader <- loadShaderFromBytes device (T.encodeUtf8 $ genShader @mat @(VO mat) @FragmentOutput "fragment" (Set.toList $ collectBindings @mat) (convertFrag $ fragment @mat))
-
   pipeline <- withWGPUString "main" $ \vertexEntry -> do
     withWGPUString "main" $ \fragmentEntry -> do
       withWGPUString "render pipeline" $ \label -> do
@@ -143,3 +164,12 @@
               with pipelineDesc $ \desc -> wgpuDeviceCreateRenderPipeline device desc
 
   pure $ RenderPipeline pipeline
+
+createPipeline :: forall mat. (Material mat) => RenderDevice -> WGPUTextureFormat -> IO RenderPipeline
+createPipeline (RenderDevice device) format = do
+  bindLayout <- createBindLayout (Set.toList $ collectBindings @mat) (RenderDevice device)
+
+  vertShader <- loadShaderFromBytes device (T.encodeUtf8 $ genShader @mat @(VI mat) @(VO mat) "vertex" (Set.toList $ collectBindings @mat) (vertex @mat))
+  fragShader <- loadShaderFromBytes device (T.encodeUtf8 $ genShader @mat @(VO mat) @FragmentOutput "fragment" (Set.toList $ collectBindings @mat) (convertFrag $ fragment @mat))
+
+  buildPipeline bindLayout vertShader fragShader (RenderDevice device) format
diff --git a/src/Mischief/Shader.hs b/src/Mischief/Shader.hs
--- a/src/Mischief/Shader.hs
+++ b/src/Mischief/Shader.hs
@@ -18,6 +18,9 @@
     module Mischief.Shader.Types,
     module Prelude,
     module Mischief.ECS,
+    Expr,
+    Types (..),
+    PrimitiveTypes (..),
   )
 where
 
@@ -26,6 +29,7 @@
 import Mischief.Shader.Internal.Bindings
 import Mischief.Shader.Internal.Buffers
 import Mischief.Shader.Internal.Params
+import Mischief.Shader.Internal.Singletons
 import Mischief.Shader.Internal.State
 import Mischief.Shader.Types
 import Prelude (const, pure, show, undefined, ($), (.), (<$>), (<*>), (=<<), (>>=), type (~))
diff --git a/src/Mischief/Shader/Internal/State.hs b/src/Mischief/Shader/Internal/State.hs
--- a/src/Mischief/Shader/Internal/State.hs
+++ b/src/Mischief/Shader/Internal/State.hs
@@ -7,6 +7,7 @@
 
 import Control.Monad.State
 import Data.Data hiding (cast)
+import Data.Kind (Type)
 import Data.Map (Map)
 import Data.Singletons (SingI, demote)
 import Data.Text (Text)
@@ -291,7 +292,7 @@
 
 -- stmtToWGSL (VLet a b) = "  var " <> nameIndex a <> " = " <> exprToWGSL b <> ";"
 
-newtype Shader m a = Shader (State ShaderState a) deriving newtype (Functor, Applicative, Monad, MonadState ShaderState)
+newtype Shader (m :: Type) a = Shader (State ShaderState a) deriving newtype (Functor, Applicative, Monad, MonadState ShaderState)
 
 typeToWGSL :: forall (a :: Types). (SingI a) => Expr a -> Text
 typeToWGSL _ = typeToWGSL' (demote @a)
