Created
June 29, 2024 23:06
-
-
Save mattpolzin/6bc2392fc784c836c6801c4f16157f7d to your computer and use it in GitHub Desktop.
Idris2 with rational package template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {} }: | |
let | |
inherit (nixpkgs) | |
fetchFromGitea | |
mkShell | |
idris2Packages; | |
inherit (idris2Packages) buildIdris idris2 idris2Lsp; | |
rationalPkg = buildIdris { | |
src = fetchFromGitea { | |
domain = "git.envs.net"; | |
owner = "iacore"; | |
repo = "idris2-rational"; | |
rev = "main"; | |
hash = "sha256-2QnDhaRsJahKszGD3rMTnOv45TBbBt8pubnmLY6sSbw="; | |
}; | |
ipkgName = "rational"; | |
idrisLibraries = []; | |
}; | |
myPkg = buildIdris { | |
src = ./.; | |
ipkgName = "my-pkg"; | |
idrisLibraries = [ rationalPkg ]; | |
}; | |
in | |
rec { | |
package = myPkg.library {}; | |
# alternatively, if building an executable: | |
# package = myPkg.executable; | |
shell = mkShell { | |
packages = [ | |
idris2 | |
idris2Lsp | |
]; | |
inputsFrom = [ | |
package | |
]; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mypkg | |
depends = rational | |
modules = MyPackage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyPackage | |
import Data.Rational | |
export | |
doThing : () -> Rational | |
doThing = ?hole |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment