- 2020-08-31:
>>> :t Map.filterWithKey Map.filterWithKey :: (k -> a -> Bool) -> Map k a -> Map k a
we have this filtering function:
\key _val -> not (Set.member key stoppers)
_val
is unused. Curry it away. - 2020-08-28:
rmFront :: Set Char -> String -> String
rmFront weirds str = dropWhile (flip Set.member weirds) strSimple currying questions: can this function-implementation be simplified with currying? Can it be simplified ... MORE? Answers: yes, and yes. Show your implementation. - 2020-08-26: We have this:
\info -> importBook info >>= return . (info,)
There are way too manyinfo
-references. What's a better way to write this expression? - Five solutions from @noaheasterly:
- runKleisli (id &&& Kleisli importBook)
- liftA2 (liftA2 (,)) return importBook
- liftA2 (fmap . (,)) id importBook
- traverse importBook . join (,)
- traverse importBook . (id &&& id)
Incorporates strong typing over predicate logic programming, and, conversely, incorporates predicate logic programming into strongly typed functional languages. The style of predicate logic is from Prolog; the strongly typed functional language is Haskell.
Wednesday, August 26, 2020
August 2020 1HaskellADay 1Liners
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment