Example usage of scalaz and uncommon Scala features.
Scala
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc Update sbt.md Jun 30, 2016
src sigh Dec 5, 2015
.gitignore random crap, plus more BASIC Apr 12, 2013
README.md Update README.md Sep 13, 2016
build.sbt scalaz 7.1.0 Aug 2, 2014
dash.sbt Update dash.sbt Jan 29, 2015

README.md

examples

Extremely random crap, much of which needs revisiting. Buyer beware. Note that there are some example tests in src/test/scala.

Also, I sometimes write blog posts on Scala.

starting a repl

Paul Phillips wrote this after becoming outraged by the awful unmaintainable shell alias I was using.

#!/usr/bin/env bash
#
 
set -e
 
pushd "$(mktemp -dt scalaz)"
cat >build.sbt <<EOM
scalaVersion := "2.11.6"

libraryDependencies ++= Seq(
  "org.scalaz" %% "scalaz-core" % "7.1.1",
  "org.scalaz" %% "scalaz-concurrent" % "7.1.1",
  "org.scalaz" %% "scalaz-effect" % "7.1.1"
)

initialCommands := "import scalaz._, Scalaz._"
EOM
 
sbt console
popd

random crap

I know nothing about shell scripting because I want to retain plausible deniability (shell scripting, installers, and crystal reports are the unholy trinity of bullshit you never want to admit you can do). Having said that, here are some very crappy scripts that I just wrote to improve my sanity.

List the packages contained in a jarfile

#!/bin/bash
jar tf $1 | grep class$ | perl -pe "s|/[^/]*class$||;s|/|.|g" | sort | uniq

Display the manifest

#!/bin/bash
unzip -p $1 META-INF/MANIFEST.MF

Edit the manifest in-place (note that this creates and destroys META-INF/MANIFEST.MF in the local dir ... really need to do this in /tmp or something).

#!/bin/bash
unzip $1 META-INF/MANIFEST.MF > /dev/null
mate -w META-INF/MANIFEST.MF
jar umf META-INF/MANIFEST.MF $1 2> /dev/null
rm META-INF/MANIFEST.MF
rmdir META-INF
echo "*** UPDATED TO"
unzip -p $1 META-INF/MANIFEST.MF