同时过滤和映射
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了同时过滤和映射相关的知识,希望对你有一定的参考价值。
The `filtermap` functional below allows to perform the standard `map` and `filter` operations in one go. The mapping function has to return a `Maybe` monad, and values of `Nothing` are filtered out.
-- Prepend an element to a list if available. Leave the list as it is if the -- first argument is Nothing. maybecons Nothing l = l maybecons (Just e) l = e : l -- Variant of map which deletes elements if the map function returns Nothing. filtermap _ [] = [] filtermap f (a:as) = maybecons (f a) $ filtermap f as
以上是关于同时过滤和映射的主要内容,如果未能解决你的问题,请参考以下文章
使用 Spring Security 在同一个 URI 映射上同时支持 Basic 和 Digest 身份验证