brainheck 0.1.0.1 → 0.1.0.2
raw patch · 6 files changed
+114/−3 lines, 6 filesdep +criteriondep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: criterion
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- app/Main.hs +4/−1
- bench/Bench.hs +10/−0
- brainheck.cabal +17/−1
- default.nix +17/−0
- release.nix +5/−0
- stack.yaml +61/−1
app/Main.hs view
@@ -4,12 +4,15 @@ import Options.Applicative import qualified Data.Text.IO as TIO import Data.Monoid+import Data.Version+import Paths_brainheck program :: Parser FilePath program = argument str (metavar "FILE" <> help "Brainfuck file") main :: IO () main = let runFile filepath = either (error . show) id . (parseBrainheck filepath) <$> TIO.readFile filepath >>= run in- runFile =<< execParser (info (program <**> helper) (fullDesc+ runFile =<< execParser (info (program <**> helper <**> versionInfo) (fullDesc <> progDesc "Brainh*ck - an interpreter" <> header "brainheck - a brainfuck intrepreter written in haskell and supporting utf-8"))+ where versionInfo = infoOption ("brainheck version: " ++ showVersion version) (short 'v' <> long "version" <> help "Show version")
+ bench/Bench.hs view
@@ -0,0 +1,10 @@+module Main where++import Criterion.Main+import Brainheck+import qualified Data.Text.IO as TIO++main = TIO.readFile "bf/helloworld.bf" >>= \file -> defaultMain [ + bgroup "parseBrainheck" [ + bench "helloworld.bf" $ whnf (parseBrainheck "bf/helloworld.bf") file ] + ]
brainheck.cabal view
@@ -1,5 +1,5 @@ name: brainheck-version: 0.1.0.1+version: 0.1.0.2 synopsis: Brainh*ck interpreter in haskell description: Brainh*ck interpreter written in haskell and taking advantage of many prominent libraries homepage: https://github.com/vmchale/brainheck#readme@@ -13,6 +13,8 @@ extra-source-files: README.md , stack.yaml , bf/helloworld.bf+ , default.nix+ , release.nix cabal-version: >=1.10 library@@ -41,6 +43,20 @@ , optparse-applicative , text default-language: Haskell2010++benchmark brainheck-bench+ type: exitcode-stdio-1.0+ hs-source-dirs: bench+ main-is: Bench.hs+ build-depends: base+ , criterion+ , brainheck+ , text+ if flag(llvm-fast)+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -fllvm -optlo-O3 -O3+ else+ ghc-options: -threaded -rtsopts -with-rtsopts=-N -O3+ default-language: Haskell2010 source-repository head type: git
+ default.nix view
@@ -0,0 +1,17 @@+{ mkDerivation, base, containers, lens, megaparsec, mtl+, optparse-applicative, recursion-schemes, stdenv, text, vector+}:+mkDerivation {+ pname = "brainheck";+ version = "0.1.0.2";+ src = ./.;+ isLibrary = true;+ isExecutable = true;+ libraryHaskellDepends = [+ base containers lens megaparsec mtl recursion-schemes text vector+ ];+ executableHaskellDepends = [ base optparse-applicative text ];+ homepage = "https://github.com/vmchale/brainheck#readme";+ description = "Brainh*ck interpreter in haskell";+ license = stdenv.lib.licenses.bsd3;+}
+ release.nix view
@@ -0,0 +1,5 @@+let+ pkgs = import <nixpkgs> { };++in+ pkgs.haskell.lib.justStaticExecutables (pkgs.haskellPackages.callPackage ./default.nix { })
stack.yaml view
@@ -1,6 +1,66 @@-resolver: lts-8.8+# This file was automatically generated by 'stack init'+#+# Some commonly used options have been documented as comments in this file.+# For advanced use and comprehensive documentation of the format, please see:+# http://docs.haskellstack.org/en/stable/yaml_configuration/++# Resolver to choose a 'specific' stackage snapshot or a compiler version.+# A snapshot resolver dictates the compiler version and the set of packages+# to be used for project dependencies. For example:+#+# resolver: lts-3.5+# resolver: nightly-2015-09-21+# resolver: ghc-7.10.2+# resolver: ghcjs-0.1.0_ghc-7.10.2+# resolver:+# name: custom-snapshot+# location: "./custom-snapshot.yaml"+resolver: lts-8.12++# User packages to be built.+# Various formats can be used as shown in the example below.+#+# packages:+# - some-directory+# - https://example.com/foo/bar/baz-0.0.2.tar.gz+# - location:+# git: https://github.com/commercialhaskell/stack.git+# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a+# - location: https://github.com/commercialhaskell/stack/commit/e7b331f14bcffb8367cd58fbfc8b40ec7642100a+# extra-dep: true+# subdirs:+# - auto-update+# - wai+#+# A package marked 'extra-dep: true' will only be built if demanded by a+# non-dependency (i.e. a user package), and its test suites and benchmarks+# will not be run. This is useful for tweaking upstream packages. packages: - '.'+# Dependency packages to be pulled from upstream that are not in the resolver+# (e.g., acme-missiles-0.3) extra-deps: []++# Override default flag values for local packages and extra-deps flags: {}++# Extra package databases containing global packages extra-package-dbs: []++# Control whether we use the GHC we find on the path+# system-ghc: true+#+# Require a specific version of stack, using version ranges+# require-stack-version: -any # Default+# require-stack-version: ">=1.4"+#+# Override the architecture used by stack, especially useful on Windows+# arch: i386+# arch: x86_64+#+# Extra directories used by stack for building+# extra-include-dirs: [/path/to/dir]+# extra-lib-dirs: [/path/to/dir]+#+# Allow a newer minor version of GHC than the snapshot specifies+# compiler-check: newer-minor