summaryrefslogtreecommitdiff
path: root/src/Util
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-09-27 15:40:30 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-09-27 15:40:30 +0200
commit2f22e667fbea56884d74ed27777f2e9f3fc9fd53 (patch)
tree75300c58cc7b287993887f84b2d68b9d515a9ec0 /src/Util
parent486ee1dbe21be962e89f421e1dd5f3cbb2fd2177 (diff)
Starting to separate background and popup code.
Diffstat (limited to 'src/Util')
-rw-r--r--src/Util/Array.elm34
-rw-r--r--src/Util/Html.elm6
-rw-r--r--src/Util/List.elm36
3 files changed, 0 insertions, 76 deletions
diff --git a/src/Util/Array.elm b/src/Util/Array.elm
deleted file mode 100644
index 9e57c18..0000000
--- a/src/Util/Array.elm
+++ /dev/null
@@ -1,34 +0,0 @@
-module Util.Array exposing
- (
- update,
- update_unsafe,
- filter_first
- )
-
-import Array
-
-update : (
- Int ->
- ((Maybe t) -> (Maybe t)) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update index fun array =
- case (fun (Array.get index array)) of
- Nothing -> array
- (Just e) -> (Array.set index e array)
-
-update_unsafe : (
- Int ->
- (t -> t) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update_unsafe index fun array =
- case (Array.get index array) of
- Nothing -> array
- (Just e) -> (Array.set index (fun e) array)
-
-filter_first : (t -> Bool) -> (Array.Array t) -> (Maybe t)
-filter_first fun array =
- (Array.get 0 (Array.filter fun array))
diff --git a/src/Util/Html.elm b/src/Util/Html.elm
deleted file mode 100644
index 42eadba..0000000
--- a/src/Util/Html.elm
+++ /dev/null
@@ -1,6 +0,0 @@
-module Util.Html exposing (nothing)
-
-import Html
-
-nothing : (Html.Html a)
-nothing = (Html.text "")
diff --git a/src/Util/List.elm b/src/Util/List.elm
deleted file mode 100644
index 1f914b1..0000000
--- a/src/Util/List.elm
+++ /dev/null
@@ -1,36 +0,0 @@
-module Util.List exposing (..)
-
-import List
-
-pop : List a -> (Maybe (a, List a))
-pop l =
- case
- ((List.head l), (List.tail l))
- of
- (Nothing, _) -> Nothing
- (_ , Nothing) -> Nothing
- ((Just head), (Just tail)) -> (Just (head, tail))
-
-get_first : (a -> Bool) -> (List a) -> (Maybe a)
-get_first fun list =
- (List.head (List.filter fun list))
-
-product_map : (a -> b -> c) -> (List a) -> (List b) -> (List c)
-product_map product_fun list_a list_b =
- (product_map_rec (product_fun) list_a list_b [])
-
-product_map_rec : (a -> b -> c) -> (List a) -> (List b) -> (List c) -> (List c)
-product_map_rec product_fun list_a list_b result =
- case (pop list_a) of
- Nothing -> result
- (Just (head, tail)) ->
- (product_map_rec
- (product_fun)
- tail
- list_b
- (List.append
- (List.map (product_fun head) list_b)
- result
- )
- )
-