- 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.
- 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.

# Typed Logic

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.

## Monday, March 1, 2021

### March 2021 1HaskellADay Problems and Solutions

## Monday, February 1, 2021

### February 2021 1HaskellADay Problems and Solutions

- 2021-02-26: Today's #haskell problem we will be matching the metaphone'd-wineries from wikidata and from the graph-store. Today's #haskell solution gave us 16 good matches from 30 candidates.
- 2021-02-25: For today's #haskell problem we load the wineries' metaphones to the graph-store. Today's #haskell solution: MWA-HAHA! I HAVE METAPHONES FOR WINERIES!
- 2021-02-24: "What's today's date?" is today's #haskell problem. For today's #haskell solution, I think I found the successor to "Hello, world!"
- 2021-02-23: Today's #haskell exercise involves calling an external process with a winery and reading the double-metaphone encoded result. Today's #haskell solution tied our wiki- and graph-winery data to an external name-categorizing app.
- 2021-02-22: We now have a graph-store of wines, wineries, and wine-reviews, and wikidata, too! One Direction (no, not the boy-band) we can go is to merge the wikidata to our knowledge base. Project! Today's #haskell solution: (graph) wineries and (wikidata) wineries.
- 2021-02-19: Okay, we have our ~120k wine-reviews uploaded to a graph-store, great! Did we do it correctly? Hm. Today's Haskell problem. Today's #haskell solution asks: "Duplicate wine reviews? What duplicate wine reviews? Blink, blink."
- 2021-02-18: Adding prices and scores to the unicoded wine-reviews in the graph-store is today's #haskell problem. Boom! Today's #haskell solution gives us prices, scores, and wine-reviews now in the graph-store.
- 2021-02-17: Today's #haskell problem is yesterday's Haskell problem: saving out a CSV-file, but this time, we're going to save the unicode points: 'good'! Today's #haskell solution: Yay! Properly encoded unicode!
- 2021-02-16: Today's #haskell problem is to correct unicoded wine-reviews, then to save them in a CSV file for eventual upload to a graph-store. For today's #haskell solution, we came, we saw, we saved CSV, ... unicode points not quite properly encoded.
- 2021-02-15: Today's #haskell problem looks for errors in the wine-reviews JSON file which makes it invalid. Today's #haskell solution fixes JSON with a custom-build scanner.
- 2021-02-12: Today's #haskell problem: unicode, properly encoded for Text. Imagine that. Today's #haskell solution SOLVES the unicoding-problem ... except that it doesn't. :/
- 2021-02-08: In today's #haskell problem we tackle wading through wine-reviews to upload to the graph-store. Today's #haskell solution: we are able to upload some (1600+) wine-reviews so far.
- 2021-02-05: Now that we've identified duplicates in our wine graph-store, today's #haskell problem is to eliminate duplicates. In today's #haskell solution we removed duplicate wine-labels and verified no duplicate wineries, as well.
- 2021-02-04: For today's #haskell problem with look at data duplication in the graph-store (particularly: duplicated wine-labels). Today's #haskell solution shows which wines are duplicates (and triplicates, and ... megalons?)
- 2021-02-03: Today's #haskell problem looks at adding wine reviews (with some optional data) to the graph-store. Today's #haskell solution we uploaded a (very (very)) small subset of wine-reviews, prices and ratings to the graph-store.
- 2021-02-02: Enhancing graph-store data. From the @kaggle wine-taster data-set, let's extract and add the twitter handles of those who have them. Today's #haskell solution adds the wine-reviewers' twitter handles to the graph-store.
- 2021-02-01: Today's #haskell problem: counting 'dupe?' rows in a CSV file over HTTPS. Today's #haskell solution ponders: what is that 'dupe?' column for, anyway?

## Thursday, January 21, 2021

### January 2021 1HaskellADay 1Liners

- 2021-01-28: Opposite problem:

You have: [(a, Set b)]

you want: [(a, b)]

e.g.: [("hi", fromList [1,2,3]), ("bye", fromList [4,6,7]) ->

[("hi",1),("hi",2),("hi",3),("bye",4),("bye",6),("bye",7)]

Interestingly, Set is not a Monad. wut. How do you get around that problem? - D Oisín Kidney @oisdk (>>= traverse toList)
- mine: concatMap (sequence . second Set.toList)
- 2021-01-28:

We have [(Set a, b)]

we want [(a, b)]

where each element of Set a is paired with b, e.g.:

[(fromList [1,2,3], 'a'), (fromList [4,5,6], 'b')]

becomes

[(1,'a'),(2,'a'),(3,'a'),(4,'b'),(5,'b'),(6,'b')] - Steve "wash your hands" Trout @strout:

concatMap (uncurry (liftA2 (,)) . bimap toList pure) - insatiable mask wearer @tim_1729

[(a,b) | (s,b) <- xs, a <- (toList s)] - Today, 2021/01/21, is:
- Can be written with only 3 digits, What other dates can be so written? Also:
- a day where the month and day are NOT amalgamation the year. But which dates are amalgamations?

## Wednesday, January 20, 2021

### January 2021 1HaskellADay Problems and Solutions

- 2021-01-29: Ambitious! Let's upload some indexed wineries with geo-locations to the graph-store for today's #haskell problem! For today's #haskell solution we added geo-locations and wikidata QNames for some wineries, with shout-outs to @oisdk and @tim_1729, incorporating their #1Liner answers into the solution.
- 2021-01-27: We continue updating our wine-graph with wikidata. Today we update countries in the graph with wikidata QName values. Today's #haskell solution corrects the names of the countries and adds their wikidata QNames, or, put another way: O? Canada?!? NANI???
- 2021-01-26: For today's #haskell problem we compare neo4j graph data to wikidata for wineries now, and what is the "No Country"? And how do I get citizenship there?
- 2021-01-25: Okay, looking at countries aliased between wikidata and a neo4j graph for today's #haskell problem. Today's #haskell solution loads then uses a graph to resolve aliased country names.
- 2021-01-22: Today's #haskell problem: we inject countries of wineries extracted from @wikidata into the mix to ... simplify (?) things? ... wait? There're countries mismatched, too? How ... surprising. 🙄 Today's #haskell solution shows us that wine is "No Country" for old men. ... wait ... wut?
- 2021-01-21: Today's #haskell problem is to compare wineries from @wikidata to those in a @neo4j graph. Also. Did you know that there's a winery in Oregon named "Sweet Cheeks"? Now you do. You're welcome. Today's #haskell solution shows that 125 wineries match, more than 400 don't. Lots of aliasing work ahead of us.
- 2021-01-20: Today's #haskell problem asks you to parse wineries and their geo-locations from a JSON file. Simple problem; simple solution. Also: wine a bit. It helps.

## Tuesday, December 1, 2020

### December 2020 1HaskellADay Problems and Solutions

- 2020-12-22: Monads are burritos, but today's #haskell problem brings together the whole enchilada! In today's #haskell solution we find that whole enchilada is a hot tamale! ... and also map all the air bases of an alliance.
- 2020-12-21: Collecting the airbases for all the countries of an alliance from the graph-store is today's #haskell exercise. Today's #haskell solution shows how to work with the `withArray` Aeson function.
- 2020-12-18: For today's #haskell problem, we extract an alliance, its member countries, and their capitals from the graph-store to display these data on a global-viewer, such as google Earth. For today's #haskell solution, with #KML and @neo4j, we see that this is an alliance that nearly spans the globe!
- 2020-12-16: Extracting an alliance and its member countries from a graph store is today's #haskell problem. In today's #haskell solution we find that, hm, marshalling aggregated data is more than a bit of work!
- 2020-12-15: "What is the capital of Singapore?" for today's #haskell problem. Today's #haskell solution shows that the capital of Singapore is ... well: SINGAPORE! YAY!
- 2020-12-11: For today's #haskell problem we will be adding lats and longs to country capitals in our graph-store. Capitals now have lats/longs in the graph-store.
- 2020-12-10: Today's #haskell problem is to relink capitals from aliases to source countries. Today's #haskell solution clarified the problem, then provided a data-correction-solution.
- 2020-12-09: Reassociating alliances from alias nodes to their source country nodes. Today's #haskell solution: and we update aliased-alliances-... oops! Unicode. Joy.
- 2020-12-07: For today's #haskell problem, we filter out unicode points in both countries and their aliases, ... but we also ask: is filtering the right way to go, or are unicode points being properly represented in JSON by Data.Aeson? Today's #haskell solution provides aliases to country names (... even as we add some manually ... *cough* #PleaseIgnoreTheManBehindTheCurtain)
- 2020-12-03: Today's #haskell problem: adding alias names to a country ...
*should*be simple? BUT UNICODE! :( Today's #haskell solution: UNICODE FIXED FOR ALIASES! WOOT! ... but what about for the source countries? IM CRIE! 😭 - 2020-12-02: Yesterday, we triaged data for correction. Today #haskell problem is data correction, part I: adding `new` countries we missed before. Today's #haskell solution: o, Guinea-Bissau, be ye no longer an orphan, but be home, now, in Africa!
- 2020-12-01: Data correction. Half the problem of data-correction is to realize that you must do a data-correction. The other half of half the problem is to gather the data that needs to be corrected, along with the context of the correction: today's #haskell problem. Today's #haskell solution shows that the concept of triage is so helpful in setting up to solve data-correction problems.

## Friday, November 13, 2020

### November 2020 1HaskellADay 1Liner problems and solutions

- In my Data.XHTML
library

Curry away the`printXML xml = (\elt -> printElementWithOffset elt 0 >> return elt) (rep xml)`

`xml`

-argument to the`printXML`

-function

## Tuesday, November 3, 2020

### November 2020 Haskell Problems and Solutions

- 2020-11-27: Is the morse code table generated from a graph better than by-hand? In today's #haskell problem, WE FIND OUT! 😤 Today's #haskell solution shows I did code the morse table by hand correctly! *whew* and also show how to extract data from a graph-store. And! has Konami's super-secret cheat-code! ^^vv<><>ba (shh! Don't tell anyone!)
- 2020-11-25: 'Lorem Ipsum' never looked so good ... IN MORSE CODE! :< Today's #haskell problem. Today's #haskell solution shows that Cicero had words. Yes, he did.
- 2020-11-23: Today's #haskell problem: ALLIANCES o' the WORLD! UNITE! (like Wonder Twin powers). As today IS Tuesday, it IS Belgium! Displaying the countries of NATO.
- 2020-11-20: If today WERE Tuesday, it would be ... Belgium. Today is Friday, however. (whispered: but it's still Belgium). Today's #haskell problem: render a country's air-power as KML to display on earth.google.com, or some such-like. Today is Friday, so this must be ... Bruxelles! ... I'll allow it. Today's #Haskell solution maps Brussels and all the air bases of Belgium.
- 2020-11-18: As yesterday's problem of enhancing countries with additional information was SO EASY 🙄 for today's #haskell we'll take what we learned yesterday and enhance our stored continents with wikidata.org information. I'll let the band Toto explain today's #Haskell solution. "I BLESSED THE QID IN AAAAAAFRICA!" 🎵🎶 Thanks, fellahs. 🙄😎
- 2020-11-17: We find out capitals of ... um: 'thingies' (?) from wikidata.org for today's #haskell problem. Belgium has a wikidata.org q-id; captured in our knowledge graph. Belgium has a capital, too: Brussels, along with a lat/long coordinate; also captured. Today's #haskell solution was to map all q-id's and capitals to countries of the world.
- 2020-11-13: Today's #haskell problem? We convert our alliances and airbases graph into XML (specifically, KML). Why? you ask? BECAUSE WE CAN! ... and to get ready for ... this: #geodesicmapping Today's #haskell solution is our first two folders in KML. I'M SO PROUD OF YOU! ... hey! I can see my house from here!
- 2020-11-12: How big is our unicode-... dare I call it a 'problem'? It's not a 'problem,' but it's stopping us from talking with the REST endpoint successfully. So, today's #haskell problem is: how many non-ASCII unicode points do we have in our Alliances? You want alliances-as-a-graph? You got alliances-as-a-graph!
- 2020-11-11: For today's #haskell problem we attempt to upload our alliances to our Continent/Country/Airbase graph. HOW WILL THIS ATTEMPT TURN't OUT? The suspense. It's killing me. IT TURN't OUT BAD! IT TURN't OUT BAD! Bad unicode! Bad! le sigh. Today's #haskell solution (which was for yesterday's problem) leads to tomorrow's (today's, actually) Haskell problem. So it goes.
- 2020-11-10: The BIG KAHUNA: the military alliances of the world, derived from both wikidata and wikitext. Bringing it all together with the Organization of American States is today's #haskell problem. #BigKahuna Today's #haskell solution: and here we ... [wait for it] ... go!
- 2020-11-09: In today's #haskell exercise, we add the United Nations to the AllianceMap. Today's #haskell solution adds the United Nations to the map of world military alliances.
- 2020-11-06: For today's #haskell problem we add the European Union to the list of military alliances. Today's #haskell solution: European Union from wikidata.org JSON, GET!
- 2020-11-05: Today's #haskell problem: rolling in missing alliances and aliases (and implementing alias-parsing). 42. That's the number of alliances today's #haskell solution collected from wikitext. Coincidence? I THINK NOT! #DeepThought
- 2020-11-04: "We have work to do!" el geophf declares. And so, the #haskell work: missing alliances. The good news is that there's bad news: today's #haskell solution shows that we've missed 35 alliances in our parsing.
- 2020-11-03: Today's #haskell problem: I give you a new, funky parser for new, funky alliances! ... and who was it who said that Haskell is no fun? We refine our parsed results, by hand-parsing missed results for today's #haskell solution.

Subscribe to:
Posts (Atom)