The stuff before the JSON in heroku logs
output has to be cut off for
bunyan to work.
$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan
Flag -l
makes the output buffered by line.
// to, from are awkward here. generateReport only needs them to send an email | |
const generateReport = (to, from, data) => | |
mungeData(data, (warnings, munged) => | |
renderReport(munged, (report) => emailReport(to, from, report))) | |
generateReport(“info@reports.com”, “app@test.net”, {some: ‘data’}) | |
// if emailReport was curried, we could pass in the emailer |
// instanceof is a prototype identity check. | |
// NOT a type check. | |
// That means it lies across execution contexts, | |
// when prototypes are dynamically reassigned, | |
// and when you throw confusing cases like this | |
// at it: | |
function foo() {} | |
const bar = { a: 'a'}; |
module Alarm exposing (main) | |
import Browser | |
import Html exposing (Html, button, div, h2, text) | |
import Html.Events exposing (onClick) | |
{-| This is an attempt at building up a dependency between pieces of state | |
that can be separate and then allowing us to compose them naturally. |
I have been doing a lot of work on making Elm assets really tiny. As part of some exploratory research I did ages ago, I read this document on font loading. It is a super helpful resource, but I was confused by all the different terms: FOIT, FOUT, FOFT, etc. It reminded me of the old "how do you center things?" blog posts from before flexbox. So my instinct was that probably lots of folks are confused about how to do it well, and maybe there is a better way!
So brainstormed some some ideas to:
A problem that I've seen beginners run into in Haskell or PureScript a couple of times now is how to generate a List of random numbers. It's a common requirement for little games (which make for great first projects) to generate these, and it definitely seems to be a stumbling block.
Randomness is considered a side effect in purely functional languages, which means that to generate them you usually need access to Eff/IO, which in turn means we need to deal with Monads. And while generating a single random number is usually pretty easy with do-notation, the typical intuition beginners have built when going from single values to a collection is to use map
, but that fails.
So there were a few threads going around recently about a challenge to write the longest sequence of keywords in Javascript:
There are, however, a few problems: