Skip to content

Instantly share code, notes, and snippets.

@milessabin
Created April 1, 2016 12:29
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save milessabin/98a920053907d1b13a80c928753f45e1 to your computer and use it in GitHub Desktop.
Save milessabin/98a920053907d1b13a80c928753f45e1 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