[Haskell-cafe] [announcement] filtrable: class of filtrable containers
mail at joachim-breitner.de
Wed Feb 17 12:28:37 UTC 2016
Am Mittwoch, den 17.02.2016, 15:21 +0300 schrieb Kosyrev Serge:
> Does this monster
> liftA2 (<$) id (guard ∘ f)
> really stand for
> \x -> if f x then Just x else Nothing
> Is there really no simpler "compact" representation for this trivial
> idea in Haskell?
I vaguely remember a discussion about adding a combinator doing that to
the libray, and some googling turned out that there was a proposal 6
years ago by... me: https://ghc.haskell.org/trac/ghc/ticket/3446
(Well, not quite, the type was
justIf :: a -> Bool -> Just a
justIf :: a -> (a -> Bool) -> Just a
and this shows that there are probably too many variants to warrant an
addition of some or all of them to the standard library).
The corresponding discussion on the libraries¹ list discussed some of
the variants, and also turned up an even older equivalent proposal by
Henning Thielemann² from 12 years ago.
Joachim “nomeata” Breitner
mail at joachim-breitner.de • https://www.joachim-breitner.de/
XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: This is a digitally signed message part
More information about the Haskell-Cafe