This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell -i 'runghc -XLambdaCase' -p 'ghc.withPackages (pkgs: [ pkgs.mtl ])' | |
module Main where | |
import Control.Monad.Except (ExceptT, runExceptT, throwError) | |
f :: (Monad m, Num n, Fractional n, Eq n) => n -> n -> ExceptT String m n | |
f a b | |
| a == 0 = throwError "Divide by zero" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> { }; | |
stdenv.mkDerivation rec { | |
name = "kakoune-unstable-${version}"; | |
version = "2017-12-03"; | |
src = fetchFromGitHub { | |
repo = "kakoune"; | |
owner = "mawww"; | |
rev = "7d32b3fc3689219d47fc236eefa4749f2e7c3c61"; | |
sha256 = "1xdfmz1gd84s4svk1hffnxam6clhgm37w64rr3mfimvmvxhnzzcc"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#colorscheme dracula | |
set-option global ui_options ncurses_assistant=cat | |
set global tabstop 2 | |
set global indentwidth 2 | |
# replace ¥ with \ | |
hook global InsertChar ¥ %{ exec -draft -itersel <esc>hr\\i } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dracula theme | |
# https://draculatheme.com/ | |
%sh{ | |
black="rgb:282a36" | |
gray="rgb:44475a" | |
white="rgb:f8f8f2" | |
pink="rgb:ff79c6" | |
purple="rgb:bd93f9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
-- https://hackage.haskell.org/package/random-1.1/docs/System-Random.html | |
import System.Random | |
import Data.Int | |
import Data.List (splitAt) | |
main :: IO () | |
main = do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TaskManager | |
( mkTaskManager | |
, runTasks | |
, execTask | |
, waitTasks | |
, cancelTasks | |
) where | |
-------------------------------------------------------------------------------- | |
import Control.Concurrent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Control.Concurrent (forkIO, threadDelay) | |
import Control.Monad (forever) | |
import Control.Monad.State (StateT, execStateT, get, put) | |
import Data.Foldable (traverse_) | |
import Debug.Trace | |
data AppState | |
= AppState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeOperators #-} | |
module App where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
f :: Int -> String -> String | |
f n a = mconcat . take n . repeat $ a | |
g :: String -> String -> String | |
g a b = b <> " " <> a | |
z :: (String -> String) -> String | |
z f = f "world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
f :: Int -> String -> String | |
f n a = mconcat . take n . repeat $ a | |
g :: String -> String -> String | |
g a b = b <> " " <> a | |
z :: (String -> String) -> String | |
z f = f "world" |