hbf 0.1.0.1 → 0.1.0.2
raw patch · 6 files changed
+36/−17 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +5/−1
- README.md +8/−6
- hbf.cabal +2/−2
- tests/CompilerTest.hs +1/−2
- tests/Helper.hs +19/−5
- tests/doctest.hs +1/−1
ChangeLog.md view
@@ -4,6 +4,10 @@ First version. Compiler working. VM working. -## 0.1.0.0 -- 2018-06-25+## 0.1.0.1 -- 2018-06-25 Minor changes to README and metadata++## 0.1.0.2 -- 2018-06-26++Minor changes to README and travis script
README.md view
@@ -12,8 +12,8 @@ ## Getting Started ### Installing-Use your preferred method for installing HBF from [Hackage](fixme-link). If you prefer to build from source-you can use cabal.+Use your preferred method for installing HBF from [Hackage](https://hackage.haskell.org/package/hbf).+If you prefer to build from source you can use cabal. ### Usage @@ -45,24 +45,26 @@ ## Hacking-HBF has heavily documented code. Take a look at the documentation on [Hackage](fixme-link).+HBF has heavily documented code. You can read the documentation on [Hackage](https://hackage.haskell.org/package/hbf). +All the optimizations are implemented in the [compiler](https://hackage.haskell.org/package/hbf/docs/HBF-Compiler.html), +for an example, you can look at the documentation for+[`mulOpt`](https://hackage.haskell.org/package/hbf-0.1.0.1/docs/HBF-Compiler.html#v:mulOpt). + ### Running the tests ``` cabal test ``` -Test coverage report for the last build can be found [here](https://paraseba.gitlab.io/hbf/coverage/hpc_index.html).+Test coverage report for the last build can be found [here](https://paraseba.github.io/hbf/coverage/hpc_index.html). ### Running the benchmarks ``` cabal bench ```--Benchmark report for the last build can be found [here](https://paraseba.gitlab.io/hbf/bench.html). ## License
hbf.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 2e87a5cd02b71c60a1afaedd80f0d5c77071e5f883c57143f3d73b46e3de20fa+-- hash: d0a2bab316b8254089629b690ac242bffc13bc51cd5d53ff8037f99af9ce20ce name: hbf-version: 0.1.0.1+version: 0.1.0.2 cabal-version: >= 1.10 build-type: Simple license: GPL-3
tests/CompilerTest.hs view
@@ -4,7 +4,6 @@ import qualified Data.Text.Lazy.IO as TIO import Hedgehog import qualified Hedgehog as H-import Hedgehog.Checkers as HC import Test.HUnit import HBF.Compiler@@ -117,7 +116,7 @@ noNoOp (Loop _) = error "noNoOp: unexpected operation" hprop_FusedProgramHasValidMonoid :: Property-hprop_FusedProgramHasValidMonoid = property $ HC.monoid programGen+hprop_FusedProgramHasValidMonoid = withTests 75 $ property $ monoid programGen unit_clearOptimization :: Assertion unit_clearOptimization = clearOpt (Program p) @?= Program expected
tests/Helper.hs view
@@ -1,6 +1,7 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE NoMonomorphismRestriction #-}+{-# LANGUAGE OverloadedStrings #-} -- needed for smallcheck module Helper where@@ -8,11 +9,12 @@ import Control.Monad.Trans.State (runStateT) import Data.Coerce (coerce) import Data.Int (Int8)-import Data.Semigroup ((<>))+import Data.Semigroup (Semigroup, (<>)) import Data.Text.Lazy (Text, pack) import qualified Data.Text.Lazy.IO as TIO import qualified Data.Vector.Unboxed as Vector-import Hedgehog (Gen)+import Hedgehog (Gen, PropertyT, forAll, (===))+import qualified Hedgehog.Checkers as HC import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range import Test.SmallCheck.Series@@ -137,3 +139,15 @@ execFile :: FilePath -> String -> IO (MachineType, String) execFile p input = TIO.readFile p >>= \code -> execCode code input++-- | We redefine the monoid checker from hedgehog-checkers because it does expensive unnecessary extra work+monoid :: (Monoid a, Semigroup a, Eq a, Show a) => Gen a -> PropertyT IO ()+monoid gen = do+ HC.semigroup gen+ HC.identity mappend mempty gen+ monoidSemigroupSame+ where+ monoidSemigroupSame = do+ a <- forAll gen+ b <- forAll gen+ mappend a b === a <> b
tests/doctest.hs view
@@ -1,4 +1,4 @@-import Test.DocTest+import Test.DocTest main :: IO () main = doctest ["-isrc", "src/HBF"]