packages feed

dhall 1.4.1 → 1.4.2

raw patch · 10 files changed

+226/−1 lines, 10 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+1.4.2++* Fix missing `Prelude` files in package archive uploaded to Hackage+ 1.4.1  * Fix missing `tests/Tutorial.hs` module in package archive uploaded to Hackage
+ Prelude/Optional/all view
@@ -0,0 +1,19 @@+{-+Returns `False` if the supplied function returns `False` for a present element+and `True` otherwise:++Examples:++```+./all Natural Natural/even ([+3] : Optional Natural) = False++./all Natural Natural/even ([] : Optional Natural) = True+```+-}+let all : ∀(a : Type) → (a → Bool) → Optional a → Bool+    =   λ(a : Type)+    →   λ(f : a → Bool)+    →   λ(xs : Optional a)+    →   Optional/fold a xs Bool f True++in  all
+ Prelude/Optional/any view
@@ -0,0 +1,19 @@+{-+Returns `True` if the supplied function returns `True` for a present element and+`False` otherwise++Examples:++```+./any Natural Natural/even ([+2] : Optional Natural) = True++./any Natural Natural/even ([] : Optional Natural) = False+```+-}+let any : ∀(a : Type) → (a → Bool) → Optional a → Bool+    =   λ(a : Type)+    →   λ(f : a → Bool)+    →   λ(xs : Optional a)+    →   Optional/fold a xs Bool f False++in  any
+ Prelude/Optional/filter view
@@ -0,0 +1,31 @@+{-+Only keep an `Optional` element if the supplied function returns `True`++Examples:++```+./filter Natural Natural/even ([+2] : Optional Natural)+= [+2] : Optional Natural++./filter Natural Natural/odd ([+2] : Optional Natural)+= [] : Optional Natural+```+-}+let filter : ∀(a : Type) → (a → Bool) → Optional a -> Optional a+    =   λ(a : Type)+    →   λ(f : a → Bool)+    →   λ(xs : Optional a)+    →   Optional/build+        a+        (   λ(optional : Type)+        →   λ(just : a → optional)+        →   λ(nil : optional)+        →   Optional/fold+            a+            xs+            optional+            (λ(x : a) → if f x then just x else nil)+            nil+        )++in  filter
+ Prelude/Optional/length view
@@ -0,0 +1,17 @@+{-+Returns `+1` if the `Optional` value is present and `+0` if the value is absent++Examples:++```+./length Integer ([2] : Optional Integer) = +1++./length Integer ([] : Optional Integer) = +0+```+-}+let length : ∀(a : Type) → Optional a → Natural+    =   λ(a : Type)+    →   λ(xs : Optional a)+    →   Optional/fold a xs Natural (λ(_ : a) → +1) +0++in  length
+ Prelude/Optional/null view
@@ -0,0 +1,17 @@+{-+Returns `True` if the `Optional` value is absent and `False` if present++Examples:++```+./null Integer ([2] : Optional Integer) = False++./null Integer ([] : Optional Integer) = True+```+-}+let null : ∀(a : Type) → Optional a → Bool+    =   λ(a : Type)+    →   λ(xs : Optional a)+    →   Optional/fold a xs Bool (λ(_ : a) → False) True++in  null
+ Prelude/Text/concatMap view
@@ -0,0 +1,20 @@+{-+Transform each value in a `List` into `Text` and concatenate the result++Examples:++```+./concatMap Integer (λ(n : Integer) → "${Integer/show n} ") [0, 1, 2]+= "0 1 2 "++./concatMap Integer (λ(n : Integer) → "${Integer/show n} ") ([] : List Integer)+= ""+```+-}+let concatMap : ∀(a : Type) → (a → Text) → List a → Text+    =   λ(a : Type)+    →   λ(f : a → Text)+    →   λ(xs : List a)+    →   List/fold a xs Text (λ(x : a) → λ(y : Text) → f x ++ y) ""++in  concatMap
+ Prelude/Text/concatMapSep view
@@ -0,0 +1,47 @@+{-+Transform each value in a `List` to `Text` and then concatenate them with a+separator in between each value++Examples:++```+./concatMapSep ", " Integer Integer/show [0, 1, 2] = "0, 1, 2"++./concatMapSep ", " Integer Integer/show ([] : List Integer) = ""+```+-}+let concatMapSep+    :   ∀(separator : Text) → ∀(a : Type) → (a → Text) → List a → Text+    =   λ(separator : Text)+    →   λ(a : Type)+    →   λ(f : a → Text)+    →   λ(elements : List a)+    →   let status+            =   List/fold+                a+                elements+                < Empty : {} | NonEmpty : Text >+                (   λ(element : a)+                →   λ(status : < Empty : {} | NonEmpty : Text >)+                →   merge+                    {   Empty+                        =   λ(_ : {})+                        →   < NonEmpty = f element+                            | Empty : {}+                            >+                    ,   NonEmpty+                        =   λ(result : Text)+                        →   < NonEmpty = f element ++ separator ++ result+                            | Empty : {}+                            >+                    }+                    status : < Empty : {} | NonEmpty : Text >+                )+                < Empty = {=} | NonEmpty : Text >+    in  merge+        { Empty    = λ(_ : {}) → ""+        , NonEmpty = λ(result : Text) → result+        }+        status : Text++in  concatMapSep
+ Prelude/Text/concatSep view
@@ -0,0 +1,43 @@+{-+Concatenate a `List` of `Text` values with a separator in between each value++Examples:++```+./concatSep ", " ["ABC", "DEF", "GHI"] = "ABC, DEF, GHI"++./concatSep ", " ([] : List Text) = ""+```+-}+let concatSep : ∀(separator : Text) → ∀(elements : List Text) → Text+    =   λ(separator : Text)+    →   λ(elements : List Text)+    →   let status+            =   List/fold+                Text+                elements+                < Empty : {} | NonEmpty : Text >+                (   λ(element : Text)+                →   λ(status : < Empty : {} | NonEmpty : Text >)+                →   merge+                    {   Empty+                        =   λ(_ : {})+                        →   < NonEmpty = element+                            | Empty : {}+                            >+                    ,   NonEmpty+                        =   λ(result : Text)+                        →   < NonEmpty = element ++ separator ++ result+                            | Empty : {}+                            >+                    }+                    status : < Empty : {} | NonEmpty : Text >+                )+                < Empty = {=} | NonEmpty : Text >+    in  merge+        { Empty    = λ(_ : {}) → ""+        , NonEmpty = λ(result : Text) → result+        }+        status : Text++in  concatSep
dhall.cabal view
@@ -1,5 +1,5 @@ Name: dhall-Version: 1.4.1+Version: 1.4.2 Cabal-Version: >=1.8.0.2 Build-Type: Simple Tested-With: GHC == 7.10.2, GHC == 8.0.1@@ -63,15 +63,23 @@     Prelude/Natural/show     Prelude/Natural/sum     Prelude/Natural/toInteger+    Prelude/Optional/all+    Prelude/Optional/any     Prelude/Optional/build     Prelude/Optional/concat+    Prelude/Optional/filter     Prelude/Optional/fold     Prelude/Optional/head     Prelude/Optional/last+    Prelude/Optional/length     Prelude/Optional/map+    Prelude/Optional/null     Prelude/Optional/toList     Prelude/Optional/unzip     Prelude/Text/concat+    Prelude/Text/concatMap+    Prelude/Text/concatMapSep+    Prelude/Text/concatSep  Source-Repository head     Type: git