Skip to content

Instantly share code, notes, and snippets.

import Test.Hspec
-- import Control.Monad
gen1 :: [Bool]
gen1 = [False, True]
gen2 :: [(Bool, Bool)]
gen2 = gen1 >>= \a -> gen1 >>= \b -> pure (a, b)
gen3 :: [(Bool, Bool, Bool)]
prompt: write an explanation (which should appear in a scientific article) of why space applications demand autonomous operations
response: Space applications, such as spacecraft and satellites, often operate in environments that are inaccessible or dangerous for humans. For example, space exploration missions to other planets, moons, or asteroids require spacecraft to be able to function for long periods of time without direct human control. Similarly, satellites that operate in Earth orbit may need to continue functioning despite loss of contact with ground control stations. Additionally, autonomous operations can greatly reduce the cost and complexity of space missions by eliminating the need for human operators and the hardware required to support them.
One of the main challenges for autonomous space operations is the communication delay caused by the large distances involved. Light travels at a speed of approximately 299,792,458 meters per second (or about 186,282 miles per second), and even at this s
joel@glamdring> nix-shell --verbose ~/Projects/nix-doom-emacs
evaluating file '/nix/store/5ira7xgs92inqz1x8l0n1wci4r79hnd0-nix-2.3.7/share/nix/corepkgs/derivation.nix'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
evaluating file '/nix/store/8a6yi5gg85wxxdl974l9sj8lzlhsvhzw-nixpkgs-20.09pre240426.f9567594d5a/nixpkgs/default.nix'
evaluating file '/nix/store/8a6yi5gg85wxxdl974l9sj8lzlhsvhzw-nixpkgs-20.09pre240426.f9567594d5a/nixpkgs/lib/minver.nix'
evaluating file '/nix/store/8a6yi5gg85wxxdl974l9sj8lzlhsvhzw-nixpkgs-20.09pre240426.f9567594d5a/nixpkgs/pkgs/top-level/impure.nix'
evaluating file '/nix/store/8a6yi5gg85wxxdl974l9sj8lzlhsvhzw-nixpkgs-20.09pre240426.f9567594d5a/nixpkgs/pkgs/top-level/default.nix'
evaluating file '/nix/store/8a6yi5gg85wxxdl974l9sj8lzlhsvhzw-nixpkgs-20.09pre240426.f9567594d5a/nixpkgs/pkgs/stdenv/booter.nix'
evaluating file '/ni
dhall hash <<< 'https://prelude.dhall-lang.org/v20.0.0/package.dhall'
dhall:
Error: Failed to resolve imports. Error list:
↳ https://prelude.dhall-lang.org/v20.0.0/package.dhall
↳ https://prelude.dhall-lang.org/v20.0.0/Text/package.dhall sha256:46c53957c10bd4c332a5716d6e06068cd24ae1392ca171e6da31e30b9b33c07c
Error: Cannot decode CBOR to Dhall
The following bytes do not encode a valid Dhall expression
# stylish-haskell configuration file
# ==================================
# The stylish-haskell tool is mainly configured by specifying steps. These steps
# are a list, so they have an order, and one specific step may appear more than
# once (if needed). Each file is processed by these steps in the given order.
steps:
# Convert some ASCII sequences to their Unicode equivalents. This is disabled
# by default.
# - unicode_syntax:

Managing Haskell

blah blah blah more things here

From my experience fundraising in Haskell, companies who use it all seem to have suffered from the same two flavors of problem:

  1. A rockstar comes in, dumps mindblowing code everywhere that dazzles the rest of the team and fools the product leads with pseudo-productivity until the rockstar leaves or finally wakes up. Cue the rest of the team death-marching for the next year or few years as the team attempts to juggle feature additions with excising or unraveling the impenetrable yarn-tangle of semantic misdirection.

  2. An especially productive senior or team lead spends their time on refactoring and generally spinning their wheels with respect to product delivery, and then fails to deliver on time, or at all. Cue the rest of the team struggling to keep up with the refactors. The team's knowledge of the state of the product suffers, confusion about goals sets in, the senior/lead effectively becomes an anti-team player, throwing curveballs at the rest o

@joelmccracken
joelmccracken / Dockerfile
Created June 10, 2020 15:48
haskell on heroku
FROM bec-baseimage as build
COPY . /opt/build
RUN cd /opt/build && stack build --system-ghc
FROM ubuntu:16.04
RUN mkdir -p /bec
ARG BINARY_PATH
WORKDIR /bec
RUN apt-get update && apt-get install -y \
ca-certificates \
@joelmccracken
joelmccracken / join.hs
Last active September 2, 2019 16:19
embed applicative forms in monad form s.t. the error msg and labeling functionaliy from applicative fields are maintained but you can customize the overall feel of the larger form
joinForm :: Html -> MForm Handler (FormResult Join, Widget)
joinForm extra = do
let
mustAgreeField :: Text -> Field Handler Bool
mustAgreeField errorMsg = checkBool id errorMsg checkBoxField
accept1Def = areq (mustAgreeField
"You must specify that you accept Section 1")
"Accept Section 1" Nothing
accept2Def = areq (mustAgreeField
Error found:
in module Main
at src/Main.purs:65:29 - 65:37 (line 65, column 29 - line 65, column 37)
Could not match type
( nextId :: Int
, textVal :: Maybe String
, items :: Array
{ key :: String