These are chat archives for ramda/ramda
filter :: Filterable f => (a -> Boolean) -> f a -> f a, would it be appropriate to say that "Filterable is an abstract data structure in that it doesn't exist as something which can be instantiated, assigned to or compared with. Rather, it states that the type
a -> b, or more specific types
[a] -> Number, and then I wanted to just broadening that understanding a little more to show that we can include more generalized types, not any arbitrary
b, but also not something so specific as an
Array. Parametric polymorphism without using scary words like "parametric" or "polymorphism". Also without introducing Fantasy land. That's why I thought Filterable would be a great example because it wouldn't lead to down the 'this must implement that which must implement that' rabbit hole
stringUp :: (StringInstrument g) => [String] -> g,
StringedInstrumentcould be some form of a guitar or it could be something like Ukulele, so the signature couldn't' use
[String] -> Guitar, but it also couldn't use
[String] -> a
I like the class C example
It makes fp look fancy as well :wink:
Iterableor similar, allowing you to completely define how a 'sequence' of values is created. If a ES6 generator is as close as I can get with Ramda I might be stuck.
iteratorprotocol but ran into some sort of block. Thanks all, I realize this turns out to be a bit off topic for Ramda!