diff options
author | Yorhel <git@yorhel.nl> | 2019-11-04 11:52:45 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-11-10 12:44:55 +0100 |
commit | de6df4ab815a4f4447122d7f19888afd1b3e50ec (patch) | |
tree | 2eb3ce6ba9ebaf0d6c5fa588b7d2e4c4f87bc684 /elm/Lib/Util.elm | |
parent | 6821b9ab3f3b24e4d635a0763122d0ed2b1c0b72 (diff) |
ulist: Add (nonfunctional) releases + options UI; More consistent naming
Diffstat (limited to 'elm/Lib/Util.elm')
-rw-r--r-- | elm/Lib/Util.elm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/elm/Lib/Util.elm b/elm/Lib/Util.elm index 186cf365..b86fcbad 100644 --- a/elm/Lib/Util.elm +++ b/elm/Lib/Util.elm @@ -30,3 +30,8 @@ hasDuplicates l = case List.foldr step (Just Dict.empty) l of Nothing -> True Just _ -> False + + +-- Haskell's 'lookup' - find an entry in an association list +lookup : a -> List (a,b) -> Maybe b +lookup n l = List.filter (\(a,_) -> a == n) l |> List.head |> Maybe.map Tuple.second |