Skip to content

Instantly share code, notes, and snippets.

@ShrykeWindgrace
ShrykeWindgrace / _stack.ps1
Created April 22, 2022 08:16
Powershell tab-completion script for stack
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
Register-ArgumentCompleter -Native -CommandName 'stack' -ScriptBlock {
param($wordToComplete, $commandAst)
[string[]]$localCommand = @('"--bash-completion-enriched"')
$hay = [System.Collections.Generic.List[string]]::new()
foreach ($item in $commandAst.CommandElements) {
$localCommand += '"--bash-completion-word"'
$localCommand += """$item"""
$hay.Add($item.ToString())
@ShrykeWindgrace
ShrykeWindgrace / Main.hs
Created September 29, 2021 15:53
Lazy or not lazy?
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.Trans.Class (MonadTrans (lift))
import Control.Monad.Trans.Reader (ReaderT (runReaderT), asks)
import Data.Binary (Get, Word64, Word8, getWord8)
@ShrykeWindgrace
ShrykeWindgrace / Main.elm
Created September 22, 2020 12:07
False positive on `NoUnused.CustomTypeConstructorArgs`
module Main exposing (Model, main) -- src/Main.elm
import Browser
import Html exposing (Html, div, text)
import Html.Attributes exposing (id)
import Messages exposing (Msg(..))
main : Program () Model Msg
main =
@ShrykeWindgrace
ShrykeWindgrace / ArrowLogAction.hs
Last active November 7, 2019 15:43
Try to generalize `newtype LogAction m msg = LogAction {run:: msg -> m ()}` from `co-log` to Arrows
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE QuantifiedConstraints #-}
module ArrowLogAction where