From 101ed72e9f97a8f68b5f678854c992dff18d8f9f Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 8 Sep 2019 14:00:56 +0200 Subject: Init: basic command line abstraction for fish’s complete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/profpatsch/dhallsh/List/filterOptional.dhall | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pkgs/profpatsch/dhallsh/List/filterOptional.dhall (limited to 'pkgs/profpatsch/dhallsh/List') diff --git a/pkgs/profpatsch/dhallsh/List/filterOptional.dhall b/pkgs/profpatsch/dhallsh/List/filterOptional.dhall new file mode 100644 index 00000000..810599b0 --- /dev/null +++ b/pkgs/profpatsch/dhallsh/List/filterOptional.dhall @@ -0,0 +1,23 @@ +let filterOptional + : ∀(a : Type) → ∀(b : Type) → (a → Optional b) → List a → List b + = λ(a : Type) + → λ(b : Type) + → λ(f : a → Optional b) + → λ(l : List a) + → List/build + b + ( λ(list : Type) + → λ(cons : b → list → list) + → λ(nil : list) + → List/fold + a + l + list + ( λ(x : a) + → λ(xs : list) + → Optional/fold b (f x) list (λ(opt : b) → cons opt xs) xs + ) + nil + ) + +in filterOptional -- cgit 1.4.1