1. Why is it List.filter instead of List.keepIf? With 0.14, Signal.lift was renamed into Signal.map, for the sake of correspondence to List.map. For consistency, it would also make sense to either rename Signal.keepIf to Signal.filter, or List.filter to List.keepIf. The latter of these two is the better suggestion, except for historical baggage about filtering functions in other FP languages.
2. Somewhere in the Elm library guidelines, there is advice against encoding into function names information that could be appropriately expressed through qualified use of the module name. Arguably, this means that foldp should be just Signal.fold. The "p" in the name is not needed to disambiguate that folding function from any other folding function (in the Signal module, or elsewhere - which would be the job of the "Signal." qualification anyway).
isFalse = notisFalse : Bool -> BoolisTrue = identity3. When using filtering/keepIf, an oft occurring case (seen in a lot of code) is to process a signal of Bools with either keepIf identity or keepIf not. It would be good if Basics contained two more mnemonic functions for that:isTrue : Bool -> Bool
Checking the release notes for why isJust and isNothing were removed ... they say they were removed in favor of pattern matching.
1. Typical uses of these two functions (with keepIf, say) are not really served well by pattern matching.
2. For consistency, if isJust and isNothing are removed in favor of pattern matching, then List.isEmpty "should" be removed as well, in favor of pattern matching.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Totally forgot to comment on renaming filterMap. I think it doesn't need to be renamed. It's a filter and a map in one. The Maybe type is enough of a hint as to how the filtering works.
--
Ruby uses select and reject for its filtering, something to consider if you're worried about implying mutability.But I agree that (1) I have to think about which way filter goes (2) consistency between Signal and List is important. I'm fine with keep/dropIf.
--