- 2021-03-23:
You have
[a]
and(a -> IO b)
.You want
IO [(a, b)]
That is, you want to pair your inputs to their outputs for further processing in the IO-domain.
- Chris Martin @chris__martin:
\as f -> traverse @ [] @ IO (\a -> f a >>= \b ->
return (a, b)) as
- cλementd Children crossing @clementd:
traverse (sequenceA . id &&& f)
(actually,
tranverse (sequence . (id &&& f))
)Or
p traverse (traverse f . dup)
- Chris Martin @chris__martin:
- 2021-03-23: You have
[([a], [b])]
You want
([a], [b])
so:
[([1,2], ["hi"]), ([3,4], ["bye"])]
becomes
([1,2,3,4],["hi","bye"])
- karakfa @karakfa:
conc xs = (concatMap fst xs, concatMap snd xs)
- karakfa @karakfa:
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.
Tuesday, March 23, 2021
March 2021 1HaskellADay 1Liners
Monday, March 1, 2021
March 2021 1HaskellADay Problems and Solutions
- 2021-03-31, Wednesday: Let's go on 50 last dates for today's #haskell problem. Today's #haskell solution shows us the fifty last dates were the fifty best dates.
- 2021-03-30, Tuesday: Directorizin' ... WITH STYLE! ... is today's #haskell problem. Today's #haskell solution: BEHOLD THE MIGHTY POWER OF THE <*>!
- 2021-03-29, Monday: Today's #haskell problem tackles plurality and connectives to list the contents of our Fruits Basket. Today's #haskell solution gives us fruits, in the basket, properly-speaking, thanks to George Boole.
- 2021-03-25, Thursday: Today's #haskell problem has me FORTHing AT THE MOUTH! ... AGAIN! ... no, ... wait ...
- 2021-03-23, Tuesday: Let's go FORTH! and conquer! for today's #haskell problem. Today's #haskell solution gives us a little FORTHer to go FORTH and FORTH! ... and also demonstrates Gauss' sum formula ... IN FORTH! ... which is nice.
- 2021-03-22, Monday: Fixing-up and validating a JSON-as-string (and don't get me started) is today's #haskell problem. Today's #haskell solution uses Data.Aeson to transform some JSON, ... typefully.
- 2021-03-19: pi. Not pie. Not tau. pi... you know, or: close enough, is served as today's #haskell problem (via @AnecdotesMaths). PI! for today's #haskell solution. And a pie recipe from Sumeria, if you're in a baking-mood.
- 2021-03-18: Today's #haskell problem is to update lookup tables with new values. Today's #haskell solution gets the indices for foo, bar, quux, and ... Joe??? Okay.
- 2021-03-16: Today's #haskell problem uses natural language processing to consolidate words in the cloud. et, voilà: Grace Hopper wikipedia entry word-cloud, trimmed and stemmed, for today's #haskell solution.
- 2021-03-15: Today's #haskell problem explores Grace Hopper's wikipedia entry as a word-cloud generated by d3js.org for #WomensHistoryMonth Today's #haskell solution removed some obvious things (punctuation and citations) to simplify Grace Hopper's word-cloud. #WomenHistoryMonth
- 2021-03-11: It's not every Tom, Dick, and Harry that can do today's #haskell exercise... In today's #haskell solution you want an id? YOU GOT AN ID! 😤
- 2021-03-09: Let's query a directory and do something with each file in that directory for today's #haskell problem. Today's #haskell solution? THAT WAS EASY! ... so! What are we doing tomorrow? 😃
- 2021-03-05: Today we're shell-scripting ... WITH HASKELL! 😤 Today's #haskell solution says: "Well, hello there, good lookin'!"
- 2021-03-04: Today's #haskell problem: you have a time-series of values, not necessary gapless, get the latest value; then, get 'yesterday's' value. Today's #haskell solution gives us some useful functions to navigate a time-series of values.
- 2021-03-03: Today's #haskell problem asks: "Where in the world are these wineries?" Then answers that question. Ooh! Wineries! Wineries all over the globe! is in today's #haskell solution.
- 2021-03-02: For today's #haskell problem, let's add approved matched data to wineries in the graph-store. The #haskell solution! ... with a pic!
- 2021-03-01: Today's #haskell problem approves matched wineries for (eventual) storage. We approve wiki-to-graph winery metaphone matches for today's #haskell solution.
Subscribe to:
Posts (Atom)