Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lucamolteni/6654b2dc8681ec3d10cc31e48f856c21 to your computer and use it in GitHub Desktop.
Save lucamolteni/6654b2dc8681ec3d10cc31e48f856c21 to your computer and use it in GitHub Desktop.
shapeless on the Ammonite REPL with no dependencies other than an installed JDK. Many thanks to @przemekpokrywka for the idea, @alxarchambault for Coursier and @li_haoyi for Ammonite.
miles@frege:~$ ./shapeless.sh
Loading...
Welcome to the Ammonite Repl 0.5.2
(Scala 2.11.7 Java 1.8.0_51)
@ val l = 23 :: "foo" :: true :: HNil
l: Int :: String :: Boolean :: HNil = ::(23, ::("foo", ::(true, HNil)))
@
#!/bin/bash
test -e ~/.coursier/cr || (mkdir -p ~/.coursier && wget -q -O ~/.coursier/cr https://git.io/vgvpD && chmod +x ~/.coursier/cr)
CLASSPATH="$(~/.coursier/cr fetch -q -p \
\
com.chuusai:shapeless_2.11:2.3.0 \
com.lihaoyi:ammonite-repl_2.11.7:0.5.2 \
\
)" java ammonite.repl.Main --predef 'import shapeless._'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment