Starofall / sbt-frege

An sbt plugin for building Frege code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Features

  • Compile Frege code from your project's src/main/frege/ directory
  • Call Frege code from your project's Java/Scala/etc. code
  • Launch the Frege REPL with your project's classes and libraries

Requirements

  • sbt 0.13.6+

Getting started

Add the Frege sbt plugin to your project:

project/plugins.sbt:

addSbtPlugin("com.earldouglas" % "sbt-frege" % "1.1.3")

Write some Frege code:

src/main/frege/example/HelloWorld.fr:

package example.HelloWorld where

main :: [String] -> IO ()
main _ = println "Hello, world!"

Build and run it:

$ sbt
> compile
> run
Hello, world!

Try it from the Frege REPL:

$ sbt
> fregeRepl

frege> import example.HelloWorld (main)

frege> main []
Hello, world!
()

Configuration

Frege compiler

  • fregeOptions - Extra options for fregec: Seq[String]
  • fregeSource - Frege source directory (default src/main/frege/): File
  • fregeTarget - Frege target directory (default target/frege/): File
  • fregeCompiler - Full name of the Frege compiler (default frege.compiler.Main): String
  • fregeLibrary - Frege library (fregec.jar) to use (default Frege 3.23.288), ModuleID

Frege REPL

  • fregeReplVersion - The version of frege-repl to use (default 1.3): String
  • fregeReplMainClass - The Frege REPL main class (default frege.repl.FregeRepl): String

Though sbt-frege uses 3.24-7.30 by default, Frege REPL 1.3 depends on Frege 3.23.288, so it takes priority when launching fregeRepl.

About

An sbt plugin for building Frege code


Languages

Language:Scala 81.0%Language:Frege 14.0%Language:Java 5.1%