diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 See full history at: <https://github.com/faylang/fay/commits>
 
+#### 0.23.1.7
+
+* Fix panic when compiling irrefutable pattern matches on lists (thanks Christopher Parks)
+
 #### 0.23.1.6
 
 * Allow `syb 0.5.*`
diff --git a/fay.cabal b/fay.cabal
--- a/fay.cabal
+++ b/fay.cabal
@@ -1,5 +1,5 @@
 name:                fay
-version:             0.23.1.6
+version:             0.23.1.7
 synopsis:            A compiler for Fay, a Haskell subset that compiles to JavaScript.
 description:         Fay is a proper subset of Haskell which is type-checked
                      with GHC, and compiled to JavaScript. It is lazy, pure, has a Fay monad,
diff --git a/src/Fay/Compiler/Decl.hs b/src/Fay/Compiler/Decl.hs
--- a/src/Fay/Compiler/Decl.hs
+++ b/src/Fay/Compiler/Decl.hs
@@ -99,12 +99,20 @@
       exp <- compileExp rhs
       name <- withScopedTmpJsName return
       m <- compilePat (JsName name) pat []
-      case m of
-        [JsIf t b1 []] -> do
-          let err = [throw ("Irrefutable pattern failed for pattern: " ++ prettyPrint pat) (JsList [])]
-          return [JsVar name exp, JsIf t b1 err]
-        [JsVar n _] -> return [JsVar n exp]
-        x -> error $ "Fay bug! Can't compile pat bind for: " ++ show x
+      m2 <- interleavePatternMatchFailures m pat m
+      return (JsVar name exp : m2)
+
+    interleavePatternMatchFailures :: [JsStmt] -> S.Pat -> [JsStmt] -> Compile [JsStmt]
+    interleavePatternMatchFailures original pat = walk
+      where
+        walk m = case m of
+          [JsIf t b1 []] -> do
+            b2 <- walk b1
+            return [JsIf t b2 err]
+          [JsVar n exp2] -> return [JsVar n exp2]
+          stmt:stmts -> (stmt:) <$> walk stmts
+          [] -> error $ "Fay bug! Can't compile pat bind for pattern: " ++ show original
+        err = [throw ("Irrefutable pattern failed for pattern: " ++ prettyPrint pat) (JsList [])]
 
 -- | Compile a normal simple pattern binding.
 compileUnguardedRhs :: Bool -> S.X -> S.Name -> S.Exp -> Compile [JsStmt]
diff --git a/tests/VarPtr.hs b/tests/VarPtr.hs
new file mode 100644
--- /dev/null
+++ b/tests/VarPtr.hs
@@ -0,0 +1,11 @@
+module VarPtr where
+
+import Data.Var
+
+data Record = Record Int
+
+main = do 
+  v <- newVar $ Record 5
+  subscribeAndRead v $ \y -> case y of
+    Record a -> putStrLn . show $ a
+  set v $ Record 10
diff --git a/tests/VarPtr.res b/tests/VarPtr.res
new file mode 100644
--- /dev/null
+++ b/tests/VarPtr.res
@@ -0,0 +1,2 @@
+5
+10
diff --git a/tests/patternMatchLet.hs b/tests/patternMatchLet.hs
new file mode 100644
--- /dev/null
+++ b/tests/patternMatchLet.hs
@@ -0,0 +1,10 @@
+module PatternMatchLet where
+
+first3 :: String -> Fay ()
+first3 cs = do
+  let (a:b:c:_) = cs
+  putStrLn [a, b, c]
+
+main :: Fay ()
+main = first3 "abcd"
+
diff --git a/tests/patternMatchLet.res b/tests/patternMatchLet.res
new file mode 100644
--- /dev/null
+++ b/tests/patternMatchLet.res
@@ -0,0 +1,1 @@
+abc
