Try to understand the ReaderT
instance.
withRunInIO inner =
ReaderT $ \r ->
withRunInIO $ \run ->
inner (run . flip runReaderT r)
#!/usr/bin/env stack | |
{- | |
stack | |
script | |
--resolver lts-12.20 | |
--package mtl,text,monad-loops | |
-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Control.Monad as M |
#!/usr/bin/env stack | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{- | |
stack | |
script | |
--resolver lts-13.16 | |
--package transformers | |
-} |
[Link to Breadth First series](https://doisinkidney.com/posts/2018-03-17-rose-trees-breadth-first.html) | |
> data Tree a = Node | |
> { root :: a | |
> , forest :: Forest a | |
> } | |
> | |
> type Forest a = [Tree a] | |
> breadthFirst :: Forest a -> [a] |
# .config/nixpkgs/overlays/custompkgs.nix | |
self: super: { | |
userPkgs = self.buildEnv { | |
name = "user-packages"; | |
pathsToLink = [ "/share" "/bin" ]; | |
paths = with self.pkgs; [ | |
firefox-devedition-bin | |
alacritty | |
tmux | |
lazygit |
# .config/nixpkgs/overlays/neovim.nix | |
self: super: { | |
neovim-unwrapped = (super.neovim-unwrapped.override { lua = self.luajit; }).overrideAttrs(oldAttrs: { | |
cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ]; | |
version = "master"; | |
src = builtins.fetchGit { | |
url = https://github.com/neovim/neovim.git; | |
}; |
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
let | |
pkgs = import <nixpkgs> {}; | |
cinaps = pkgs.ocaml-ng.ocamlPackages_4_09.buildDunePackage rec { | |
pname = "cinaps"; | |
version = "latest"; | |
src = pkgs.fetchFromGitHub { | |
owner = "ocaml-ppx"; | |
repo = "cinaps"; | |
rev = "e3183c4733d0577d4d54211cafa4a52dfe5dd235"; |
#!/bin/sh | |
# https://en.wikipedia.org/wiki/Percent-encoding | |
# https://stackoverflow.com/questions/38015239/url-encoding-a-string-in-shell-script-in-a-portable-way | |
# https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html#The-LANGUAGE-variable | |
# "The variable LANGUAGE is ignored if the locale is set to ‘C’" | |
# Not entirely sure why this is done to be honest | |
LANG=C; |
Maybe I'll turn this into a blog post at some point. Right now I just want some | |
clarity and peace of mind, so I'll dump my thoughts into this Gist. | |
Diagnostics information in Neovim can either come from one or several related | |
files, or the entire project. An example of the former would be the module | |
you're currently working on and all its dependencies. Regardless of which type | |
of diagnostics you prefer, I think it's safe to assume that you want to be able | |
to use both. Sometimes a change compiles in the scope of a single module but | |
not in the context of the entire project, since usages of the changed module | |
need to update their interface definitions or something like that. |