├── src ├── test │ └── g8 │ │ └── test └── main │ └── g8 │ ├── project │ ├── build.properties │ └── plugins.sbt │ ├── default.properties │ ├── .scalafmt.conf │ ├── build.sbt │ └── src │ ├── main │ └── frege │ │ └── example │ │ └── HelloWorld.fr │ └── test │ └── scala │ └── example │ └── HelloWorldSuite.scala ├── project ├── build.properties └── plugins.sbt ├── shell.nix ├── README.md ├── .github └── workflows │ └── build.yml └── LICENSE /src/test/g8/test: -------------------------------------------------------------------------------- 1 | > test 2 | > run 3 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.11.7 2 | -------------------------------------------------------------------------------- /src/main/g8/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.11.7 2 | -------------------------------------------------------------------------------- /src/main/g8/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.earldouglas" % "sbt-frege" % "3.0.3") 2 | -------------------------------------------------------------------------------- /src/main/g8/default.properties: -------------------------------------------------------------------------------- 1 | name=My Frege Project 2 | description=A project built with sbt-frege 3 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.foundweekends.giter8" %% "sbt-giter8" % "0.18.0") 2 | libraryDependencies += { "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value } 3 | -------------------------------------------------------------------------------- /src/main/g8/.scalafmt.conf: -------------------------------------------------------------------------------- 1 | version = 3.4.3 // https://scalameta.org/scalafmt/docs/installation.html#sbt 2 | runner.dialect = scala3 // https://scalameta.org/scalafmt/docs/configuration.html#scala-3 3 | maxColumn = 72 // RFC 678: https://datatracker.ietf.org/doc/html/rfc678 4 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | let 3 | jdk = pkgs.jdk11; 4 | in 5 | pkgs.mkShell { 6 | nativeBuildInputs = [ 7 | (pkgs.sbt.override { jre = jdk; }) 8 | ]; 9 | shellHook = '' 10 | export JAVA_HOME=${jdk} 11 | PATH="${jdk}/bin:$PATH" 12 | ''; 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Build Status](https://github.com/earldouglas/sbt-frege.g8/workflows/build/badge.svg) 2 | 3 | This is a [Giter8][g8] template for [sbt-frege]. 4 | 5 | [g8]: http://www.foundweekends.org/giter8/ 6 | [sbt-frege]: https://github.com/earldouglas/sbt-frege 7 | 8 | ## Usage 9 | 10 | ``` 11 | sbt new earldouglas/sbt-frege.g8 12 | ``` 13 | -------------------------------------------------------------------------------- /src/main/g8/build.sbt: -------------------------------------------------------------------------------- 1 | val scala3Version = "3.6.3" 2 | 3 | lazy val root = project 4 | .in(file(".")) 5 | .settings( 6 | name := "my-sbt-frege", 7 | version := "0.1.0-SNAPSHOT", 8 | 9 | fork := true, 10 | 11 | scalaVersion := scala3Version, 12 | 13 | libraryDependencies += "org.scalameta" %% "munit" % "1.0.0" % Test 14 | ) 15 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-24.04 9 | 10 | steps: 11 | 12 | - uses: actions/checkout@v4 13 | 14 | - uses: actions/setup-java@v4 15 | with: 16 | java-version: 11 17 | distribution: temurin 18 | cache: sbt 19 | 20 | - uses: sbt/setup-sbt@v1 21 | 22 | - run: sbt test 23 | -------------------------------------------------------------------------------- /src/main/g8/src/main/frege/example/HelloWorld.fr: -------------------------------------------------------------------------------- 1 | package example.HelloWorld where 2 | 3 | multiply :: Int -> Int -> Int 4 | multiply x y = x * y 5 | 6 | showMultiply :: Int -> Int -> String 7 | showMultiply x y = 8 | let 9 | result = multiply x y 10 | in 11 | unwords [ 12 | show x, 13 | "*", 14 | show y, 15 | "=", 16 | show result, 17 | ] 18 | 19 | main :: [String] -> IO () 20 | main _ = do 21 | x = showMultiply 6 7 22 | println x 23 | -------------------------------------------------------------------------------- /src/main/g8/src/test/scala/example/HelloWorldSuite.scala: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import frege.run8.Thunk 4 | import munit.FunSuite 5 | 6 | class HelloWorldSuite extends FunSuite { 7 | 8 | test("multiply") { 9 | 10 | val obtained = HelloWorld.multiply(6, 7) 11 | val expected = 42 12 | 13 | assertEquals(obtained, expected) 14 | } 15 | 16 | test("showWork") { 17 | 18 | val x = Thunk.`lazy`(6) 19 | val y = Thunk.`lazy`(7) 20 | 21 | val obtained = HelloWorld.showMultiply(x, y) 22 | val expected = "6 * 7 = 42" 23 | 24 | assertEquals(obtained, expected) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2025 James Earl Douglas 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | --------------------------------------------------------------------------------