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
|
## Installation and Use
|
||||||
|
|
||||||
[Releases are available for Linux.](https://git.eversole.co/James/tricu/releases)
|
You can easily build and run this project using [Nix](https://nixos.org/download/).
|
||||||
|
|
||||||
Or you can easily build and run this project using [Nix](https://nixos.org/download/).
|
|
||||||
|
|
||||||
- Quick Start (REPL):
|
- Quick Start (REPL):
|
||||||
- `nix run git+https://git.eversole.co/James/tricu`
|
- `nix run git+https://git.eversole.co/James/tricu`
|
||||||
|
85
flake.nix
85
flake.nix
@ -2,57 +2,46 @@
|
|||||||
description = "tricu";
|
description = "tricu";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs = {
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||||
url = "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
type = "tarball";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
static-haskell-nix = {
|
|
||||||
url = "github:nh2/static-haskell-nix";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, static-haskell-nix }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
let
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
system = "x86_64-linux";
|
let
|
||||||
compiler = "ghc948";
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
packageName = "tricu";
|
packageName = "tricu";
|
||||||
|
containerPackageName = "${packageName}-container";
|
||||||
|
|
||||||
overlay = self: super: {
|
customGHC = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
|
||||||
haskell = super.haskell // {
|
megaparsec
|
||||||
packages = super.haskell.packages // {
|
]);
|
||||||
${compiler} = super.haskell.packages.${compiler}.override {
|
|
||||||
overrides = final: prev: {
|
haskellPackages = pkgs.haskellPackages;
|
||||||
${packageName} = prev.callCabal2nix packageName ./. {};
|
|
||||||
};
|
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 Parser
|
||||||
import Research
|
import Research
|
||||||
|
|
||||||
import Control.Exception (IOException, SomeException, catch, displayException)
|
import Control.Exception (IOException, SomeException, catch
|
||||||
|
, displayException)
|
||||||
import Control.Monad (forM_)
|
import Control.Monad (forM_)
|
||||||
import Control.Monad.IO.Class (liftIO)
|
|
||||||
import Control.Monad.Catch (handle, MonadCatch)
|
import Control.Monad.Catch (handle, MonadCatch)
|
||||||
|
import Control.Monad.IO.Class (liftIO)
|
||||||
import Control.Monad.Trans.Class (lift)
|
import Control.Monad.Trans.Class (lift)
|
||||||
import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
|
import Control.Monad.Trans.Maybe (MaybeT(..), runMaybeT)
|
||||||
import Data.Char (isSpace, isUpper)
|
import Data.Char (isSpace, isUpper)
|
||||||
import Data.List ( dropWhile
|
import Data.List (dropWhile, dropWhileEnd, isPrefixOf)
|
||||||
, dropWhileEnd
|
|
||||||
, isPrefixOf)
|
|
||||||
import System.Console.Haskeline
|
|
||||||
import Paths_tricu (version)
|
|
||||||
import Data.Version (showVersion)
|
import Data.Version (showVersion)
|
||||||
import qualified Data.Text as T
|
import Paths_tricu (version)
|
||||||
import qualified Data.Text.IO as T
|
import System.Console.Haskeline
|
||||||
|
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import qualified Data.Text.IO as T
|
||||||
|
|
||||||
repl :: Env -> IO ()
|
repl :: Env -> IO ()
|
||||||
repl env = runInputT settings (withInterrupt (loop env Decode))
|
repl env = runInputT settings (withInterrupt (loop env Decode))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
cabal-version: 1.12
|
cabal-version: 1.12
|
||||||
|
|
||||||
name: tricu
|
name: tricu
|
||||||
version: 0.18.0
|
version: 0.18.1
|
||||||
description: A micro-language for exploring Tree Calculus
|
description: A micro-language for exploring Tree Calculus
|
||||||
author: James Eversole
|
author: James Eversole
|
||||||
maintainer: james@eversole.co
|
maintainer: james@eversole.co
|
||||||
|
Reference in New Issue
Block a user