- 2020-08-31:
  
 #Haskell #BetterWithCurry #1Liner For:>>> :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)_valis unused. Curry it away.
- 2020-08-28: 
rmFront :: Set Char -> String -> StringrmFront 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.
Pages
▼
No comments:
Post a Comment