packages feed

fay 0.23.1.0 → 0.23.1.1

raw patch · 5 files changed

+25/−5 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -2,7 +2,11 @@  See full history at: <https://github.com/faylang/fay/commits> -#### 0.23.1.0+### 0.23.1.1++* Allow do let bindings of newtypes.++### 0.23.1.0  * Add `--show-ghc-calls` and `configShowGhcCalls` to print invocations to GHC. 
fay.cabal view
@@ -1,5 +1,5 @@ name:                fay-version:             0.23.1.0+version:             0.23.1.1 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,
src/Fay/Compiler/Decl.hs view
@@ -98,9 +98,13 @@     compilePatBind' pat rhs = do       exp <- compileExp rhs       name <- withScopedTmpJsName return-      [JsIf t b1 []] <- compilePat (JsName name) pat []-      let err = [throw ("Irrefutable pattern failed for pattern: " ++ prettyPrint pat) (JsList [])]-      return [JsVar name exp, JsIf t b1 err]+      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  -- | Compile a normal simple pattern binding. compileUnguardedRhs :: Bool -> S.X -> S.Name -> S.Exp -> Compile [JsStmt]
tests/doLet.hs view
@@ -7,6 +7,7 @@   fourth   fifth   sixth+  newtyp  first = do   let x = 123@@ -43,3 +44,11 @@   let y = 777   print y   print x++newtype I = I Int+newtyp = do+  putStrLn "newtype"+  I i <- return (I 1)+  print i+  let I j = I 2+  print j
tests/doLet.res view
@@ -11,3 +11,6 @@ 10 777 123+newtype+1+2