- 2020-09-09: Today's #haskell exercise is to compile our book-word-net into a Haskell module. The #haskell solution compiled the August 2020 Gutenberg top 100 read books into Haskell terms.
- 2020-09-08: Data analytics on our top 100 gutenberg books is today's #haskell exercise. Did you know that there approximately 2000 English words in common usage? Today's #haskell solution: "Sounds about right."
- 2020-09-01: Today's #haskell problem is reducing a map of mapping of information to maps to a map. HOW HASKELL-Y! Yesterday's #haskell solution updated both problem and solution and made some data-discoveries along the way. Neat-o!
Wednesday, September 2, 2020
Tuesday, September 1, 2020
- February 18th, 2019:
Define ext :: (Maybe a, b) -> Maybe (a,b)
e.g.: ext (Just 5, "Hi") = Just (5, "Hi")
- Al͜l ̸͑ha͂͟il̶! @TechnoEmpress \o/
- cλementd @clementd `fmap swap. sequenceA . swap` :-)
- Raveline @Raveline bisequence . second pure
- Alexey Radkov @sheshanaag uncurry (flip $ fmap . flip (,))
- a fool @fresheyeball ext = \case (Just x, y) -> Just (x, y); _ -> Nothing
removeInfreqs :: Set String -> Ontology -> Ontology removeInfreqs infrequentWords ont = Map.map (\wordcounts -> foldl (flip ri') wordcounts infrequentWords) ont
Ontologyis a map-of-maps.
flipto get the same functional result.
- curry away
ontfrom the function
- curry away
wordcountsfrom the map-lambda function.
infrequentWordsfrom the function
n.b.: This curry may not be as straightforward as the other curries.
2020-09-01: Given all of the above, and now that you've curried the above lambda to [SPOILER]:
\key -> const (not (Set.member key stoppers))
keyfrom this new lambda.