Skip to content

Instantly share code, notes, and snippets.

View jasagredo's full-sized avatar

Javier Sagredo jasagredo

View GitHub Profile
@jasagredo
jasagredo / Echo.hs
Created February 28, 2024 15:34
Echo.hs
#!/usr/bin/env cabal
{- cabal:
build-depends:
base,
quickcheck-state-machine,
QuickCheck,
unliftio,
transformers,
tasty,
tasty-quickcheck
@jasagredo
jasagredo / diff-chap-revs.sh
Last active March 28, 2023 15:32
Diffs the revisions in chap
#!/usr/bin/env sh
# This script requires difftastic and toml-cli, which can be installed by `cargo install`
pkg=$2
version=$3
what_to_do=$1
if [ ! -d _sources/$pkg/$version ]; then
echo "Package $pkg and/or version $version doesn't exist"
@jasagredo
jasagredo / cabal-test
Created March 3, 2023 16:19
A wrapper over `cabal test` with a slightly nicer output
#!/usr/bin/env bash
# Build and then run the tests with a nicer output than `cabal test`
#
# Usage: `cabal-test $PKG` where $PKG is either
# - `all`
# - the name of a package
# - a sequence of names of packages
#
# For example:
# This has to be parametrized by the compiler version, the project path and the Cabal version
# that is being used. Also the relevant packages to the project will change. In this case I
# just created an empty dummy project to generate the instructions.
# Find ghci script
> stack exec -- which ghci
/usr/local/bin/ghci
# Find ghc script