- November 29th, 2016: For today's #haskell problem we have a DATABASE (world's smallest H-table) and we aim to fit a line to a time-series. In which a simple mean-gain curve actually fits pretty well with the data in today's #haskell solution
- November 28th, 2016: Today's #haskell exercise we start to look at some real-world data, looking at gains over time. Today's #haskell solution computes gains over time ... also works for losses, yes?
- November 23rd, 2016: Today's #haskell exercise looks at time-series as a 'thing.' Today's #haskell solution charts the projection of #ingress scores over time

- November 22nd, 2016: So many activities in November: #NaNoWriMo2016 and now #ingressyear4 awards. Today's #haskell exercise takes them on. Today's #haskell solution shows I need to ingress 88k points per day; let's get crackin'!
- November 21st, 2016: In honor of it being #NaNoWriMo2016 here's today's #Haskell coach to 'help' (to nag) you write MORE, HARDER, FASTER! Today's #haskell solution shows SOMEbody they'd better get CRACKIN' to finish the #NaNoWriMo2016 writing challenge!
- November 16th, 2016: Today's #haskell exercise focuses on the important things in life: coffee and chocolate!
Today's #haskell solution balances water well enough, but chocolate? That's a mite harder.
- November 15th, 2016: For today's #haskell exercise we look at simple unification on the Maybe-type. Today's #haskell solution is a little monadic/applicative logicto find that Amy is Amy. Surprise, surprise!
- November 14th, 2016: Today's #haskell exercise shows a little bit of Amy's family tree from the Mensa Genius Quiz-a-Day book
- November 11th, 2016: Today's #haskell exercise we tease out information from a Twitter API call to see who this @geophf-person really is! Somehow I got to solving two problems in one day, but OKAY, HERE WE GO! Information on a tweep from Twitter API JSON.
**BONUS:**November 11th, 2016: In honor of me solving today's problem yesterday, here's bonus #haskell problem: network of shared twitter followers. Today's #haskell solution shows that twitter follower networks can get a bit ... messy. MANY FOLLOWERS! SUCH WOW! (whispered: the shared follower network is a simple natural transformation from #categorytheory:`natx (++) twerpAsRel tweep1 tweep2`

Yeah)

- November 10th, 2016: Today's #haskell exercise: @1HaskellADay has followers. Tweep id 81457442 has followers. Are there shared followers? Today's #haskell solution uses natural transformation to find shared followers of 2 tweeps via the Twitter API JSON
- November 8th, 2016: We call the Twitter API directly to get a set of follower IDs to scan for today's #haskell exercise. Today's solution shows a simple (parsing) transformation from JSON to #haskell values
- November 2nd, 2016: Today's #haskell exercise explores a twitter social network along FOLLOWS-relations. BONUS lets you explore yours.
- November 1st, 2016: For today's #haskell exercise, we look at twitter users and their relations as a JSON-graph.

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

## Wednesday, November 30, 2016

### November 2016 1HaskellADay Problems and Solutions

## Tuesday, November 1, 2016

### October 2016 1HaskellADay Problems and Solutions

- October 28th, 2016: Today's #haskell problem is to create a comprehensive set of score cards for top5s stocks and then cluster them.
- October 26th, 2016: Today's #haskell exercise looks at runs of stocks in the Top5s and sees me struggle to define useful function-types.
- October 25th, 2016: Today's #haskell exercise looks at counting values in an archive, then looks at the efficiency of that.
- October 24th, 2016: Today's #haskell exercise is to cluster (using k-means) the score cards we derived from daily top5s stock reports
- October 21th, 2016: Today's #haskell exercise transforms a transformation: we arrive at score cards from the daily top5s stock reports. Set of daily reports on the stock markets' top5s leaders and losers by category arrives at stock score cards.
- October 19th, 2016: We expand on yesterday's #haskell problem by counting all stocks in all categories of the top5s stocks data file. We find in today's #haskell solution there are a hella-lotta stocks (technical term) in each top5s category.
- October 17th, 2016: Today's #haskell exercise we look for top 5s stock patterns in the stock markets, because we're wizards, and stuff. Today's #haskell solution does a bit of frequency and adjacency analysis of stock prices, ... BUT WHAT DOES IT ALL MEAN?
- October 13th, 2016: Today's #haskell exercise looks at, well, ... an exercise log! Today's #haskell solution shows that Monoid + MultiMap == Love❤️And converted to KM for our Metricized friends.
- October 12th, 2016: Today's #Haskell exercise approaches the deepest philosophical questions with a blank slate ... I'll see myself out. Today's #haskell solution tabulates a rasa-t, mon. um ... I meant: today's blocks on the #blockchain as a table.
- October 11th, 2016: Today's exercise is to stitch together #haskell #blockchain web-services ... and to use the word 'Haskell-y'. Done.
- October 10th, 2016: What blocks/transactions occurred today on the #blockchain? We find those hash ids with today's #haskell exercise. For today's #haskell we get today's blocks from the #blockchain, despite a bit of bad-URL misdirection, even!
- October 6th, 2016: Today we make our #haskell web service more polished and a little more service-y AND incorporate the Merkle tree. Today's #haskell solution allows you to view a block's transactions and then choose a particular transactionto view.

- October 5th, 2016: For today's #haskell exercise we build a Merkle tree web-service! WOOT! Today's #haskell solution is a web service that fetches transactions of a block by hash. WOOT! WOOT!

- October 3rd, 2016: Today's #haskell exercise is a long postal-worker's sigh: we separate Merkle tree view-structure from the data-view. Today's #haskell solution shows that making Merkle Trees Foldable also helps in scanning the tree

## Saturday, October 22, 2016

### September 2016 1HaskellADay 1Liners Problems and Solutions

- September 15th, 2016:

Given [1..n], create an infinite list of lists [[1.. n], [n+1 ... n+n], [n+n+1 ... 3n], ...]

counting :: [Integer] -> [[Integer]] - joomy @cattheory

counting = (map . (+) . fromIntegral . length) >>= iterate - September 30th, 2016: The reverse of August's one-liner:

f :: (Maybe a, b) -> Maybe (a,b)

define f. Snaps for elegance.

## Sunday, October 2, 2016

### September 2016 1HaskellADay problems and solutions

- September 29th, 2016: Today's #haskell exercise looks at ways to get transactions from Merkle tree that DON'T involve a full-tree scan every time (given you do not know the transaction-hash, and you wish to search by user/address) #blockchain. Today's #Haskell solution transforms a Merkle tree of #bitcoin transactions into a MultiMap!
- September 28th, 2016: TOO MANY SINGLE-LEAF NODES! Today's #haskell problem improves the insert algorithm to minimize single-leaf nodes.

- September 27th, 2016: Today's #haskell exercise we discover a path through a Merkle tree to a hashed leaf node (a #blockchain transaction). For the #haskell solution we find #bitcoin transactions in a Merkle tree by hash
- September 26th, 2016: For today's #haskell problem we compare two Merkle Trees, one set the same, another set slightly different. And I hope this #haskell solution doesn't get carried away into Ackermann-territory! Merkle Tree node-difference.

- September 23rd, 2016: Today's #haskell exercise distills #bitcoin transactions, then represents them as relations. Today's #haskell solution views #bitcoin trades as graphs

- September 22nd, 2016: WHOA! WHOA! WHOA! Let's scale back the problem statement a bit, shall we? for today's #haskell exercise. Got the transactions and the addresses from the latestBlock on the #blockchain in #haskell
- September 19th, 2016: Today's #haskell problem we create our own Merkle tree from (faux) #bitcoin transactions and then visualize it! The #haskell solution uses real #bitcoin transactions to populate then visualize a Merkle Tree as a graph structure
- September 16th, 2016: Today's #haskell problem is sort of Sudoku with a BINOCULAR-twist! and what other unique 9-letter words do you know? This solution used generate-then-inline, totally avoiding testing with guards. Much faster AND correct!
- September 15th, 2016: Today's #haskell problem is neither soduko nor magic squares. And our solution was a generate-then-test with guards, can you do better?
- September 14th, 2016: For today's #haskell problem we study 'domino theory' ... eheh.
We took the brute-force approach to solve today's #haskell problem. Do you have a better approach?
- September 12th, 2016: Today's #haskell problem is a logic puzzle of infinities and infinitesimals … Not really, but it has a ring to it!
- September 9th, 2016: For today's #haskell problem with go on a little cryptoarithmetic-romp. And I got to use the word 'romp' in a tweet. A little bit of monadic combine; a little bit of
`sortBy (compare `on` snd)`

and we have our AFTER(SHOCK)ING #haskell solution - September 8th, 2016: Today's #haskell exercise asks you to create a (balanced) Merkle tree from block summaries from the #blockchain. We insert some blocks from the #blockchain to create a (balanced) Merkle tree for today's #haskell solution
- September 6th, 2016: For today's #haskell exercise we read in an entire block (with its transactions) of the #blockchain. You want all the transactions of a blockof the #blockchain? Today's #haskell solution gives them to you
- September 5th, 2016: For today's #haskell problem we begin to deconstruct blocks of the #blockchain by parsing block transactions. FromJSON instance definitions in #haskell allow us to parse transactions of blocks in the #blockchain
- September 2nd, 2016: Today's #haskell problem we look at reading in just one block of the #blockchain. Today's #haskell solution fetches the latest block from the #blockchain thanks to https://blockchain.info
- September 1st, 2016: Today's #haskell exercise gives us a rudimentarily-constructed Merkle Tree. Today's #haskell solution we create leaves and branches of Merkle trees (and a very simple tree sample) #bitcoin

## Thursday, September 15, 2016

### August 2016 1HaskellADay 1Liners

- August 20th, 2016: maybeify :: (a, Maybe b) -> Maybe (a, b)

Define maybeify. Snaps for elegance. - Hardy Jones @st58 sequence
- Bruno @Brun0Cad mapM id
- Thomas D @tthomasdd {-# LANGUAGE TupleSections #-}

mabeify (x,mY) = maybe Nothing (return . (x,)) mY - Андреев Кирилл @nonaem00 import "category-extras" Control.Functor.Strong

maybeify = uncurry strength - bazzargh @bazzargh I can't beat 'sequence', but: uncurry (fmap.(,))
- Nick @crazy_fizruk distribute (from Data.Distributive)

## Thursday, September 1, 2016

### August 2016 1HaskellADay Problems and Solutions

###
**August 2016**

- August 31st, 2016: Today's #haskell problem we prepare Merkle trees (used by #blockchain/#Bitcoin) by hashing data, then hashing hashes. Wow! That was a lot of hash...ing! SHA256 #crypto #Bitcoin #blockchain used for today's #haskell solution
- August 30th, 2016: In today's #haskell exercise we look at #bitcoin mining machines comparing cost, efficiency and potential BTC found. Today's #haskell solution compares #bitcoin mining hardware ... by deriving a theorem of logic. Yeah. So: that.
- August 29th, 2016: For today's #haskell problem we find the next number in a series. Then @JMVarnerBooks asks for an efficient encoding. A little bit of group, a little bit of compress, and we have today's #haskell solution. YES!
- August 26th, 2016: Today's #haskell problem continues with currencies, looking at gold, then comparing #bitcoin

Today's #haskell solution
looks at gold then compares to #bitcoin and generalizes recursion

Today's #haskell solution is worth $180k ... five years ago. I wonder what it will be worth 5 years hence?

Okay! For today's #haskell solution we discover our node and relation types in twitter data-as-graphs JSON!

Okay, we have a #Haskell solution ... finally ... maybe. The solver took too long, so I solved it myself faster :/

## Saturday, August 20, 2016

### 1Liners for July 2016

- July 14th, 2016: So you have x :: [a] in the IO monad, and the function f :: a -> b What is the expression that gets you IO [b]?

Subscribe to:
Posts (Atom)