Compare commits
2 Commits
0.18.0
...
5024a2be4c
Author | SHA1 | Date | |
---|---|---|---|
5024a2be4c | |||
fccee3e61c |
@ -55,9 +55,7 @@ tricu < !version -- Print tricu version
|
||||
|
||||
## Installation and Use
|
||||
|
||||
[Releases are available for Linux.](https://git.eversole.co/James/tricu/releases)
|
||||
|
||||
Or you can easily build and run this project using [Nix](https://nixos.org/download/).
|
||||
You can easily build and run this project using [Nix](https://nixos.org/download/).
|
||||
|
||||
- Quick Start (REPL):
|
||||
- `nix run git+https://git.eversole.co/James/tricu`
|
||||
|
85
flake.nix
85
flake.nix
@ -2,57 +2,46 @@
|
||||
description = "tricu";
|
||||
|
||||
inputs = {
|
||||
nixpkgs = {
|
||||
url = "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz";
|
||||
type = "tarball";
|
||||
flake = false;
|
||||
};
|
||||
static-haskell-nix = {
|
||||
url = "github:nh2/static-haskell-nix";
|
||||
flake = false;
|
||||
};
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, static-haskell-nix }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
compiler = "ghc948";
|
||||
packageName = "tricu";
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
packageName = "tricu";
|
||||
containerPackageName = "${packageName}-container";
|
||||
|
||||
overlay = self: super: {
|
||||
haskell = super.haskell // {
|
||||
packages = super.haskell.packages // {
|
||||
${compiler} = super.haskell.packages.${compiler}.override {
|
||||
overrides = final: prev: {
|
||||
${packageName} = prev.callCabal2nix packageName ./. {};
|
||||
};
|
||||
};
|
||||
};
|
||||
customGHC = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
|
||||
megaparsec
|
||||
]);
|
||||
|
||||
haskellPackages = pkgs.haskellPackages;
|
||||
|
||||
enableSharedExecutables = false;
|
||||
enableSharedLibraries = false;
|
||||
|
||||
tricu = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
|
||||
in {
|
||||
|
||||
packages.${packageName} =
|
||||
haskellPackages.callCabal2nix packageName self rec {};
|
||||
|
||||
packages.default = self.packages.${system}.${packageName};
|
||||
defaultPackage = self.packages.${system}.default;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
haskellPackages.cabal-install
|
||||
haskellPackages.ghc-events
|
||||
haskellPackages.ghcid
|
||||
customGHC
|
||||
upx
|
||||
];
|
||||
inputsFrom = builtins.attrValues self.packages.${system};
|
||||
};
|
||||
};
|
||||
devShell = self.devShells.${system}.default;
|
||||
|
||||
overlays = [overlay];
|
||||
|
||||
normalPkgs = import nixpkgs { inherit overlays system; };
|
||||
|
||||
survey = import "${static-haskell-nix}/survey" { inherit compiler normalPkgs; };
|
||||
|
||||
tricuStatic = survey.haskellPackages.${packageName};
|
||||
|
||||
in {
|
||||
packages.${system}.default = tricuStatic;
|
||||
|
||||
devShells.default = normalPkgs.mkShell {
|
||||
buildInputs = with normalPkgs; [
|
||||
normalPkgs.haskellPackages.cabal-install
|
||||
normalPkgs.haskellPackages.ghc-events
|
||||
normalPkgs.haskellPackages.ghcid
|
||||
normalPkgs.upx
|
||||
];
|
||||
inputsFrom = builtins.attrValues self.packages.${system};
|
||||
};
|
||||
|
||||
devShell = self.devShells.${system}.default;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
17
src/REPL.hs
17
src/REPL.hs
@ -6,23 +6,22 @@ import Lexer
|
||||
import Parser
|
||||
import Research
|
||||
|
||||
import Control.Exception (IOException, SomeException, catch, displayException)
|
||||
import Control.Exception (IOException, SomeException, catch
|
||||
, displayException)
|
||||
import Control.Monad (forM_)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Control.Monad.Catch (handle, MonadCatch)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Control.Monad.Trans.Class (lift)
|
||||
import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
|
||||
import Data.Char (isSpace, isUpper)
|
||||
import Data.List ( dropWhile
|
||||
, dropWhileEnd
|
||||
, isPrefixOf)
|
||||
import System.Console.Haskeline
|
||||
import Paths_tricu (version)
|
||||
import Data.List (dropWhile, dropWhileEnd, isPrefixOf)
|
||||
import Data.Version (showVersion)
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
import Paths_tricu (version)
|
||||
import System.Console.Haskeline
|
||||
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
|
||||
repl :: Env -> IO ()
|
||||
repl env = runInputT settings (withInterrupt (loop env Decode))
|
||||
|
@ -1,7 +1,7 @@
|
||||
cabal-version: 1.12
|
||||
|
||||
name: tricu
|
||||
version: 0.18.0
|
||||
version: 0.18.1
|
||||
description: A micro-language for exploring Tree Calculus
|
||||
author: James Eversole
|
||||
maintainer: james@eversole.co
|
||||
|
Reference in New Issue
Block a user