These are chat archives for ramda/ramda
reduceBy' valueAlgebra keyFn = fmap (cata valueAlgebra) . unXMap . refix . fmap(keyFn &&& id) countBy' :: (Base (f (c, a1)) ~ ListF (k, v), Recursive (f (c, a1)), Ord k, Num a, Functor f) => (a1 -> c) -> f a1 -> M.Map k a countBy' = reduceBy' $ \case Nil -> 0 Cons _ b -> b + 1 groupBy' :: (Base (f (c, a)) ~ ListF (k, a1), Recursive (f (c, a)), Ord k, Functor f) => (a -> c) -> f a -> M.Map k [a1] groupBy' = reduceBy' (embed :: ListF a [a] -> [a]) indexBy' :: (Base (f (c, a)) ~ ListF (k, M.Map k1 a1), Recursive (f (c, a)), Ord k, Functor f) => (a -> c) -> f a -> M.Map k (M.Map k1 a1) indexBy' = reduceBy' $ \case Nil -> M.empty Cons a _ -> a
dropWhile' :: (t -> Bool) -> [t] -> [t] dropWhile' p = zygo (\case Nil -> ; Cons x xs -> x: xs) $ \case Nil ->  Cons x (a, b) -> if p x then b else x : a filter' :: (t -> Bool) -> [t] -> [t] filter' p = cata $ \case Nil ->  Cons a b -> if p a then a:b else b -- takeWhile' :: (t -> Bool) -> [t] -> [t] takeWhile' :: (Base t ~ ListF t1, Recursive t) => (t1 -> Bool) -> t -> [t1] takeWhile' p = para $ \case Nil ->  Cons x (_, b) -> if p x then x : b else 
const TEMP = (f, g) => R.unapply(t => R.apply(f, R.map(g, t)))
gand returns a new function which when called an any number of arguments, each arg is first passed to
gand the result is then collected and passed to
compose? or am I missing something?
useWithwith all the functions being the same in the array
const d = TEMP( (a, b, c) => [a, b, c], R.multiply(100) ) // usage d(1, 2, 3) // [100, 200, 300]
compose(map(x => x * 100), unapply(identity))(1,2,3)
TEMP( R.equals, R.nth(2) )
unapply(identity) === (...xs) => xsbasically. That's good to know
most, or more faster don't needed because, because....
msthat I can save is of utmost importance.