- January 30th, 2018: For Tuesday's #haskell problem we look at triaging articles downloaded from a REST endpoint against our PostgreSQL database. Who knew putting things into three bins could be so much fun? Today's #haskell solution triages work for us.
- January 29th, 2018: Monday's #haskell problem is to fetch when the last set of articles were stored; two approaches. Monday's #haskell solution: two approaches to extract 'last entry' from the database, wanted; two approaches to extract 'last entry' from the database, GOT!
- January 26th, 2018: Friday's #haskell problem is to pull a week's worth of data from a REST endpoint when we don't know a priori how many calls we have to make. Friday's #haskell solution fetches then reads/parses blocks of articles from a REST endpoint.
- January 24th, 2018: Wednesday's #haskell problem is solving three more #Prolog-y list problems from P99: pack / encode / decode. It's great when #haskell has grouping / 'un'grouping functions in the library already.
- January 23rd, 2018: Tuesday's #haskell problem: groups and grouper ... I like grouper blackened, please! Solving today's #haskell problem with Qubits?!? Nah, not really, but that would be cool if we did!
- January 22nd, 2018: Monday's #haskell problem is a problem from P99: problem P21, list insertion. Monday's #haskell solution is inserting an element into a list, PROLOG-STYLE!
- January 18th, 2018: The whole enchilada! Today's #haskell problem ties it all together to make an ETL. Today's #haskell solution defines etl: Looping over calls to the REST endpoint then database insertions.
- January 17th, 2018: For today's #haskell problem we use PostgreSQL data store and Haskell to pick up where we left off on an application run. Today's #haskell solution: the audit log has what our program last did, so now we know what we'll work on next!
- January 16th, 2018: Where did yesterday's Haskell problem go? Here it is! Today's #haskell problem: read a packet from a REST endpoint. Today's #haskell solution accesses a REST endpoint with a set timeout and with the default timeout.
- January 15th, 2018: "Logging? Why do we have to log stuff?" Enterprise applications require audit trails. Today's #haskell problem provides one. What did your Haskell app do and when? Today's #haskell solution: an audit log.
- January 11th, 2018: Thursday's #haskell problem: pulling SQL lookup tables into Haskell. Thursday's #haskell solution: with the help of IxValues we extract lookup table values from SQL into Haskell Maps.
- January 10th, 2018: Wednesday's #haskell exercise is to store the packet information into the PostgreSQL database as a part of auditing the ETL process. Wednesday's #haskell solution stores the packets that wrap article sets then logs our results.
- January 9th, 2018: Tuesday's #haskell problem we are logging log messages to the log data table. YES! Tuesday's #haskell solution: logging in the style of log4j.
- January 8th, 2018: Monday's #haskell problem: once more into the breach, and thoughts on generalization – storing unique newspaper article sections in PostgreSQL. We store article section information, then we build a function that stores ANYTHING! ... and washes windows, TOO! *
*YMMV additionaltermsandconditionsmayapplydependingonyourregion - January 5th, 2018: Friday's #haskell problem takes a break from SQL Databases and Haskell and does something completely different: data schemes and Haskell. AHA! Friday's #haskell solution is a graph-view of the sections for a sample of 100 articles.
- January 4th, 2018: Thursday's #haskell problem looks at storing in PostgreSQL authors of periodic articles uniquely identified by uuid. Thursday #haskell solution uses etl function with generators to store parsed authors in PostgreSQL database.
- January 3rd, 2018: Wednesday's #haskell problem is in honor of Baron Munchausen and his fantastic adventures!
- January 2nd, 2018: WELCOME TO THE NEW YEAR, HASKELLERS!
Tuesday's #haskell problem leverages keywords-as-subjects and makes storing article keywords into PostgreSQL easier... we hope. Tuesday's #haskell solution Incorporates prior work with memoizing tables and subjects with results.
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, January 31, 2018
January 2018 1HaskellADay Problems and Solutions
Friday, January 5, 2018
December 2017 1HaskellADay 1Liners problems and solutions
- December 29th, 2017:
given f :: Monad m => n -> a -> m (Maybe b)
define g :: Monad m => n -> a -> m (a, Maybe b)
using f and ... arrows? Kleisli category? - Bazzargh @bazzargh (\n a->liftM ((,) a) (f n a)) ... according to pointfree.io, that's `liftM2 fmap (,) . f` but I can't pretend to get the transformation
- December 29th, 2017:
given f :: a -> b
define g :: [a] -> [Maybe c] -> [(b, c)]
>>> g [1,2,3] [Just 7, Nothing, Just 10]
[("1",7),("3",10)]
when f = show - matt @themattchan
g = catMaybes ... zipWith (fmap . (,) . f)
where (...) = (.).(.) - garrison @GarrisonLJ g a b = map (f.id***fromJust) . filter (isJust . snd) $ zip a b
- TJ Takei @karoyakani g = (catMaybes .) . zipWith ((<$>) . (,) . f)
- December 29th, 2017: define f :: [(a,b)] -> ([a], [b])
- Андреев Кирилл @nonaem00 and matt @themattchan unzip
- Victoria C @ToriconPrime f = fmap fst &&& fmap snd
- (in a vacuum, a more general type signature would be inferred, but the compiler limits itself as instruct)
Tuesday, January 2, 2018
December 2017 1HaskellADay problems and solutions
- December 29th, 2017: In Friday's #haskell problem we leave 2017 with a filter and a BANG! ... BANG! Today's #haskell solution we weave logging into the ETL article upload process.
- December 28th, 2017: Thursday's #haskell problem is late AND a quicky: fetch a row of JSON from the database and pretty-print it. Thursday's #haskell solution had me leap from the bath tub and shout EUREKA! as I saw the issue in the JSON.
- December 27th, 2017: In Wednesday's #haskell problem we learn that when you parse dates for your articles, you don't need to carbon-date it anymore. In the solution to yesterday's #haskell problem, we encounter and report some parsing issues around optionality.
- December 26th, 2017: Tuesday's #haskell problem: scan an article archive, store an article archive; databases are neat that way. Today's #haskell solution: storing articles-as-JSON into a PostgreSQL database? No problem!
- December 22nd, 2017: Friday's #haskell exercise we do our first bit of parsing with the help of tagsoup. Okay, this #haskell Aeson / TagSoup stuff is awesome for parsing JSON / HTML stuff.
- December 20th, 2017: Wednesday's #haskell exercise. We take a large-ish JSON article archive, scan it, and spit out* a smaller-...ish JSON article archive. *'spit out' is a technical term. Today's #haskell solution provides a subset of the JSON article archive printed prettily.
- December 18th, 2017: Monday's #haskell problem: Friday you submitted an oembed request for goats, today you create a JSON oembed response service. Today's #haskell solution brings you a goat oembed service, serve with PHP.
- December 15th, 2017: Today we build a goat oembed request. I kid you not! geddit? GEDDIT? Today's #haskell solution: OEmbed Goats requests, want? OEmbed Goats requests, GOT!
- December 14th, 2017: Thursday's #haskell problem we sing 🎵 ... EVERYBODY'S WORKIN' FOR THE WEEKEND! 🎶 So, 18 composeable dates on the weekends. I'm freeing up my calendar, then!
- December 13th, 2017: Wednesday's #haskell problem is a hot date! WOOT! Today's #haskell solution has 66 composable dates in 2017. Cool!
- December 12th, 2017: Tuesday's #haskell problem is batching a SQL queryinstead of making multiple queries. It is so much faster! Today's #haskell solution has another LEFT JOIN in the SQL query to consolidate data gathering.
- December 11th, 2017: Monday's #haskell problem is computing and storing exponential distribution values. The exponential distribution: today's #haskell solution shows it's really simple.
- December 8th, 2017: For Friday's #haskell problem we parse NYT article summaries and upload them to a PostgreSQL database. Today's #haskell solution shows that our simple parsing exercise wasn't so simple. Isn't dirty data delightful?
- December 7th, 2017: Throwing the switch with Thursday's #haskell with a hard reset of the database. For today's #haskell solution we do a hard reset: we wipe the recommendation and publish tables and repopulate.
- December 6th, 2017: It's 'kinda' bad to return articles from a search that are already recommended. Wednesday's #haskell problem fixes this. Today's #haskell solution shows what a simple filter notMember can do.
- December 5th, 2017: Tuesday's #haskell problem we narrow our focus and structure our keyword search-space only on keys requested in the NYT archive on PostgreSQL. With a little bit of monadic/applicative magic, we have narrowed keyword searches.
- December 4th, 2017: For Monday's #haskell problem: "But can Haskell do anything useful?" Two words: ... yes.
- December 1st, 2017: For Friday's #haskell problem, what happens when the boss says: "That's good, but ..."? REWORK! THAT's what happens! Today's #haskell solution renders the source article in full and the recommended articles in brief. Got it!
Subscribe to:
Posts (Atom)