fluid-idl 0.0.1 → 0.0.2
raw patch · 3 files changed
+22/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- fluid-idl.cabal +2/−2
- library/Fluid/Server/Expr.hs +19/−10
- package.yaml +1/−1
fluid-idl.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.17.0.+-- This file has been generated from package.yaml by hpack version 0.17.1. -- -- see: https://github.com/sol/hpack name: fluid-idl-version: 0.0.1+version: 0.0.2 synopsis: Fluid | The Programmatic IDL description: Fluid | The Programmatic IDL category: Web
library/Fluid/Server/Expr.hs view
@@ -770,32 +770,41 @@ mapListExpr = Expr'Fn . Fn $ \args -> case args of (_:[]) -> runtimeThrow RuntimeError'TooFewArguments- [Expr'Fn (Fn f), Expr'List (List list)] -> Expr'List . List <$> mapM (f . (:[])) list+ [Expr'Fn (Fn f), Expr'List (List list)] -> go f list+ [Expr'Fn (Fn f), Expr'Val (Val'List list)] -> go f (map Expr'Val list) (_:_:[]) -> runtimeThrow RuntimeError'IncompatibleType _ -> runtimeThrow RuntimeError'TooManyArguments+ where+ go f list = Expr'List . List <$> mapM (f . (:[])) list filterListExpr :: RuntimeThrower m => Expr m filterListExpr = Expr'Fn . Fn $ \args -> case args of (_:[]) -> runtimeThrow RuntimeError'TooFewArguments- [Expr'Fn (Fn f), Expr'List (List list)] -> Expr'List . List <$>- filterM- (\x -> do- res <- f [x]- case res of- Expr'Val (Val'Prim (Prim'Bool b)) -> return b- _ -> runtimeThrow RuntimeError'IncompatibleType) -- Bool- list+ [Expr'Fn (Fn f), Expr'List (List list)] -> go f list+ [Expr'Fn (Fn f), Expr'Val (Val'List list)] -> go f (map Expr'Val list) (_:_:[]) -> runtimeThrow RuntimeError'IncompatibleType _ -> runtimeThrow RuntimeError'TooManyArguments+ where+ go f list = Expr'List . List <$>+ filterM+ (\x -> do+ res <- f [x]+ case res of+ Expr'Val (Val'Prim (Prim'Bool b)) -> return b+ _ -> runtimeThrow RuntimeError'IncompatibleType) -- Bool+ list reduceListExpr :: RuntimeThrower m => Expr m reduceListExpr = Expr'Fn . Fn $ \args -> case args of (_:[]) -> runtimeThrow RuntimeError'TooFewArguments- [Expr'Fn (Fn f), a, Expr'List (List list)] -> foldlM (\x y -> f [x, y]) a list+ [Expr'Fn (Fn f), a, Expr'List (List list)] -> go f a list+ [Expr'Fn (Fn f), a, Expr'Val (Val'List list)] -> go f a (map Expr'Val list) (_:_:[]) -> runtimeThrow RuntimeError'IncompatibleType _ -> runtimeThrow RuntimeError'TooManyArguments+ where+ go f a list = foldlM (\x y -> f [x, y]) a list i8Expr :: RuntimeThrower m => (Int8 -> Int8 -> Int8) -> Expr m i8Expr op = Expr'Fn . Fn $ \args ->
package.yaml view
@@ -1,5 +1,5 @@ name: fluid-idl-version: '0.0.1'+version: '0.0.2' category: Web synopsis: Fluid | The Programmatic IDL description: Fluid | The Programmatic IDL