egison 2.3.5 → 2.3.6
raw patch · 2 files changed
+11/−7 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- egison.cabal +1/−1
- hs-src/Language/Egison/Core.hs +10/−6
egison.cabal view
@@ -1,5 +1,5 @@ Name: egison-Version: 2.3.5+Version: 2.3.6 Synopsis: An Interpreter for the Programming Language Egison Description: An interpreter for the programming language Egison. A feature of Egison is the strong pattern match facility.
hs-src/Language/Egison/Core.hs view
@@ -354,6 +354,7 @@ expandLoop :: Env -> Object -> IOThrowsError Object expandLoop env (Loop loopVar indexVar rangeObjRef loopExpr tailExpr) = do+ cRefEval1 rangeObjRef b <- isEmptyCollection rangeObjRef if b then cEval1 $ Closure env tailExpr@@ -548,9 +549,9 @@ mPpmRet <- helper pclss case mPpmRet of Nothing -> throwError $ Default "inductiveMatch: not matched any primitive clauses"- Just tgtObjRefs -> do+ Just tgtObjRefss -> do typObjRefs <- tupleToObjRefs typObjRef- return (typObjRefs, patObjRefs, tgtObjRefs)+ return (typObjRefs, patObjRefs, tgtObjRefss) where helper [] = return Nothing helper ((env, ppat, expr):pclss2) = do mPpmRet <- primitivePatternMatch ppat tgtObjRef@@ -642,11 +643,13 @@ else return Nothing _ -> return Nothing primitivePatternMatch PEmptyPat objRef = do+ cRefEval1 objRef b <- isEmptyCollection objRef if b then return (Just []) else return Nothing primitivePatternMatch (PConsPat carPat cdrPat) objRef = do+ cRefEval1 objRef b <- isEmptyCollection objRef if b then return Nothing@@ -659,6 +662,7 @@ Nothing -> return Nothing Just cdrFrame -> return (Just (carFrame ++ cdrFrame)) primitivePatternMatch (PSnocPat rdcPat racPat) objRef = do+ cRefEval1 objRef b <- isEmptyCollectionForSnoc objRef if b then return Nothing@@ -695,7 +699,7 @@ isEmptyCollection :: ObjectRef -> IOThrowsError Bool isEmptyCollection objRef = do- obj <- cRefEval1 objRef+ obj <- liftIO $ readIORef objRef case obj of Intermidiate (ICollection []) -> return True Intermidiate (ICollection ((IElement _):_)) -> return False@@ -709,7 +713,7 @@ isEmptyCollectionForSnoc :: ObjectRef -> IOThrowsError Bool isEmptyCollectionForSnoc objRef = do- obj <- cRefEval1 objRef+ obj <- liftIO $ readIORef objRef case obj of Intermidiate (ICollection innerRefs) -> do case reverse innerRefs of@@ -725,7 +729,7 @@ consDestruct :: ObjectRef -> IOThrowsError (ObjectRef, ObjectRef) consDestruct objRef = do- obj <- cRefEval1 objRef+ obj <- liftIO $ readIORef objRef case obj of Intermidiate (ICollection []) -> throwError $ Default "consDestructInnerRefs: empty collection" Intermidiate (ICollection ((IElement carObjRef):rest)) -> do@@ -743,7 +747,7 @@ snocDestruct :: ObjectRef -> IOThrowsError (ObjectRef, ObjectRef) snocDestruct objRef = do- obj <- cRefEval1 objRef+ obj <- liftIO $ readIORef objRef case obj of Intermidiate (ICollection innerRefs) -> do case reverse innerRefs of