packages feed

brainheck 0.1.0.3 → 0.1.0.4

raw patch · 5 files changed

+21/−84 lines, 5 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Brainheck: parseBrainheck :: FilePath -> Text -> Either (ParseError (Token Text) Dec) (Syntax Char)
+ Brainheck: parseBrainheck :: FilePath -> Text -> Either (ParseError (Token Text) Void) (Syntax Char)

Files

bench/Bench.hs view
@@ -4,6 +4,7 @@ import Brainheck import qualified Data.Text.IO as TIO +-- FIXME use nfIO for final result + use env correctly 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.3+version:             0.1.0.4 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@@ -11,7 +11,6 @@ category:            Web build-type:          Simple extra-source-files:  README.md-                   , stack.yaml                    , bf/helloworld.bf                    , default.nix                    , release.nix@@ -42,6 +41,7 @@ executable brainheck   hs-source-dirs:      app   main-is:             Main.hs+  other-modules:       Paths_brainheck   ghc-options:         -threaded -rtsopts -with-rtsopts=-N   build-depends:       base                      , brainheck
default.nix view
@@ -3,7 +3,7 @@ }: mkDerivation {   pname = "brainheck";-  version = "0.1.0.2";+  version = "0.1.0.3";   src = ./.;   isLibrary = true;   isExecutable = true;
src/Brainheck.hs view
@@ -1,8 +1,8 @@-{-# LANGUAGE TemplateHaskell  #-}-{-# LANGUAGE KindSignatures   #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE KindSignatures   #-}+{-# LANGUAGE TemplateHaskell  #-} --- | Module with parser etc. +-- | Module with parser etc. module Brainheck     ( run     , parseBrainheck@@ -10,19 +10,21 @@     , Syntax (..)     ) where -import qualified Data.Vector as V-import Control.Monad.State.Lazy-import Data.Functor.Foldable-import Data.Functor.Foldable.TH-import Text.Megaparsec-import Text.Megaparsec.Text-import qualified Data.Text as T-import Control.Lens-import Data.Vector.Lens-import qualified Data.Map as M+import           Control.Lens+import           Control.Monad.State.Lazy+import           Data.Functor.Foldable+import           Data.Functor.Foldable.TH+import qualified Data.Map                 as M+import qualified Data.Text                as T+import qualified Data.Vector              as V+import           Data.Vector.Lens+import           Data.Void+import           Text.Megaparsec+import           Text.Megaparsec.Char  type St a = StateT IndexArr IO a type IndexArr = (V.Vector Int, Int)+type Parser = Parsec Void T.Text  -- | Syntax tree for brainfuck data Syntax a = Loop (Syntax a)@@ -34,7 +36,7 @@ -- | Map a char to its action in the `St` monad toAction :: Char -> St () toAction = maybe (error mempty) id . flip M.lookup keys-    where modifyVal f = flip modifyByIndex f . snd =<< get +    where modifyVal f = flip modifyByIndex f . snd =<< get           modifyByIndex i = modifyState (_1 . sliced i 1 . forced) . fmap           modifyState lens = (lens %%=) . (pure .)           readChar = get >>= (\(_,i) -> modifyByIndex i . const =<< (liftIO . (fmap fromEnum)) getChar)@@ -62,5 +64,5 @@ run parsed = fst <$> runStateT (cata algebra parsed) (V.replicate 30000 0, 0)  -- | Parse and return an error or a syntax tree-parseBrainheck :: FilePath -> T.Text -> Either (ParseError (Token T.Text) Dec) (Syntax Char)+parseBrainheck :: FilePath -> T.Text -> Either (ParseError (Token T.Text) Void) (Syntax Char) parseBrainheck filepath = (parse (brainheck) filepath) . (T.filter (`elem` "[]+-.,<>"))
− stack.yaml
@@ -1,66 +0,0 @@-# 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