summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]README.md0
-rwxr-xr-x[-rw-r--r--]examples/Concurrent.hs0
-rwxr-xr-x[-rw-r--r--]examples/DFT.hs0
-rwxr-xr-x[-rw-r--r--]examples/FFT.hs0
-rwxr-xr-x[-rw-r--r--]examples/FFTW.hs0
-rwxr-xr-x[-rw-r--r--]examples/FFT_bench.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut1_HelloWorld.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut2_ExpressionsAndTypes.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut3_Vectors.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut4_MemoryManagement.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut5_Matrices.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut6_Testing.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut7_ImperativeProgramming.hs0
-rwxr-xr-x[-rw-r--r--]examples/Tut8_SequentialVectors.hs0
-rw-r--r--raw-feldspar.cabal36
-rw-r--r--src/Data/Selection.hs8
-rw-r--r--src/Feldspar/Data/Option.hs1
-rw-r--r--src/Feldspar/Primitive/Backend/C.hs3
-rw-r--r--src/Feldspar/Representation.hs1
-rw-r--r--src/Feldspar/Run/Compile.hs17
-rw-r--r--src/Feldspar/Run/Representation.hs2
-rwxr-xr-x[-rw-r--r--]tests/Compilation.hs4
-rwxr-xr-x[-rw-r--r--]tests/Examples.hs6
-rwxr-xr-x[-rw-r--r--]tests/NumSimpl.hs0
-rwxr-xr-x[-rw-r--r--]tests/Semantics.hs0
25 files changed, 56 insertions, 22 deletions
diff --git a/README.md b/README.md
index 4b777ca..4b777ca 100644..100755
--- a/README.md
+++ b/README.md
diff --git a/examples/Concurrent.hs b/examples/Concurrent.hs
index f85d935..f85d935 100644..100755
--- a/examples/Concurrent.hs
+++ b/examples/Concurrent.hs
diff --git a/examples/DFT.hs b/examples/DFT.hs
index fdd3061..fdd3061 100644..100755
--- a/examples/DFT.hs
+++ b/examples/DFT.hs
diff --git a/examples/FFT.hs b/examples/FFT.hs
index 5173c77..5173c77 100644..100755
--- a/examples/FFT.hs
+++ b/examples/FFT.hs
diff --git a/examples/FFTW.hs b/examples/FFTW.hs
index 52c3cf1..52c3cf1 100644..100755
--- a/examples/FFTW.hs
+++ b/examples/FFTW.hs
diff --git a/examples/FFT_bench.hs b/examples/FFT_bench.hs
index 8f76a55..8f76a55 100644..100755
--- a/examples/FFT_bench.hs
+++ b/examples/FFT_bench.hs
diff --git a/examples/Tut1_HelloWorld.hs b/examples/Tut1_HelloWorld.hs
index dba480f..dba480f 100644..100755
--- a/examples/Tut1_HelloWorld.hs
+++ b/examples/Tut1_HelloWorld.hs
diff --git a/examples/Tut2_ExpressionsAndTypes.hs b/examples/Tut2_ExpressionsAndTypes.hs
index 777c529..777c529 100644..100755
--- a/examples/Tut2_ExpressionsAndTypes.hs
+++ b/examples/Tut2_ExpressionsAndTypes.hs
diff --git a/examples/Tut3_Vectors.hs b/examples/Tut3_Vectors.hs
index aa79c8d..aa79c8d 100644..100755
--- a/examples/Tut3_Vectors.hs
+++ b/examples/Tut3_Vectors.hs
diff --git a/examples/Tut4_MemoryManagement.hs b/examples/Tut4_MemoryManagement.hs
index 8c72f55..8c72f55 100644..100755
--- a/examples/Tut4_MemoryManagement.hs
+++ b/examples/Tut4_MemoryManagement.hs
diff --git a/examples/Tut5_Matrices.hs b/examples/Tut5_Matrices.hs
index 0c214a2..0c214a2 100644..100755
--- a/examples/Tut5_Matrices.hs
+++ b/examples/Tut5_Matrices.hs
diff --git a/examples/Tut6_Testing.hs b/examples/Tut6_Testing.hs
index 7abb8b2..7abb8b2 100644..100755
--- a/examples/Tut6_Testing.hs
+++ b/examples/Tut6_Testing.hs
diff --git a/examples/Tut7_ImperativeProgramming.hs b/examples/Tut7_ImperativeProgramming.hs
index e1544e0..e1544e0 100644..100755
--- a/examples/Tut7_ImperativeProgramming.hs
+++ b/examples/Tut7_ImperativeProgramming.hs
diff --git a/examples/Tut8_SequentialVectors.hs b/examples/Tut8_SequentialVectors.hs
index dba2c8e..dba2c8e 100644..100755
--- a/examples/Tut8_SequentialVectors.hs
+++ b/examples/Tut8_SequentialVectors.hs
diff --git a/raw-feldspar.cabal b/raw-feldspar.cabal
index bf85f7b..c60055d 100644
--- a/raw-feldspar.cabal
+++ b/raw-feldspar.cabal
@@ -1,5 +1,5 @@
name: raw-feldspar
-version: 0.2.1
+version: 0.3
synopsis: Resource-Aware Feldspar
description: An implementation of the Feldspar EDSL with focus on
resource-awareness.
@@ -17,7 +17,7 @@ description: An implementation of the Feldspar EDSL with focus on
license: BSD3
license-file: LICENSE
author: Emil Axelsson
-maintainer: emax@chalmers.se
+maintainer: 78emil@gmail.com
copyright: Copyright (c) 2016 Anders Persson, Anton Ekblad, Emil Axelsson,
Josef Svenningsson, Koen Claessen, Markus Aronsson,
Máté Karácsony
@@ -98,16 +98,21 @@ library
containers,
data-default-class,
data-hash,
- imperative-edsl >= 0.7,
- -- hardware-edsl >= 0.1.0.2,
+ imperative-edsl >= 0.8 && < 0.9,
language-c-quote,
mtl,
operational-alacarte,
prelude-edsl >= 0.4,
- syntactic >= 3.6.1,
- -- Smallest version that has `instD`
+ syntactic >= 3.8,
+ -- That version fixes overlap bugs
template-haskell
+ if impl(ghc == 8.0.*)
+ build-depends:
+ language-c-quote < 0.12
+ -- ,
+ -- mainland-pretty >= 0.6
+
hs-source-dirs: src
ghc-options:
@@ -144,6 +149,8 @@ test-suite Compilation
mtl,
raw-feldspar
+ ghc-options: -Wno-simplifiable-class-constraints
+
test-suite Semantics
type: exitcode-stdio-1.0
@@ -165,6 +172,8 @@ test-suite Semantics
tasty-quickcheck,
tasty-th
+ ghc-options: -Wno-simplifiable-class-constraints
+
test-suite Examples
type: exitcode-stdio-1.0
@@ -172,6 +181,19 @@ test-suite Examples
main-is: Examples.hs
+ other-modules:
+ Concurrent
+ DFT
+ FFT
+ Tut1_HelloWorld
+ Tut2_ExpressionsAndTypes
+ Tut3_Vectors
+ Tut4_MemoryManagement
+ Tut5_Matrices
+ Tut6_Testing
+ Tut7_ImperativeProgramming
+ Tut8_SequentialVectors
+
default-language: Haskell2010
build-depends:
@@ -182,3 +204,5 @@ test-suite Examples
tasty-hunit,
tasty-quickcheck
+ ghc-options: -Wno-simplifiable-class-constraints
+
diff --git a/src/Data/Selection.hs b/src/Data/Selection.hs
index 26b54ee..0346c5e 100644
--- a/src/Data/Selection.hs
+++ b/src/Data/Selection.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
-- | Data structure for describing selections of values
module Data.Selection
@@ -18,6 +20,12 @@ module Data.Selection
-- | Selection: description of a set of values
data Selection a = Selection (a -> Bool)
+#if MIN_VERSION_base(4,11,0)
+instance Semigroup (Selection a)
+ where
+ (<>) = mappend
+#endif
+
-- |
-- @
-- `mempty` = `empty`
diff --git a/src/Feldspar/Data/Option.hs b/src/Feldspar/Data/Option.hs
index bb22536..0d0bf66 100644
--- a/src/Feldspar/Data/Option.hs
+++ b/src/Feldspar/Data/Option.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE DataKinds #-}
-- | Optional values
diff --git a/src/Feldspar/Primitive/Backend/C.hs b/src/Feldspar/Primitive/Backend/C.hs
index 8143c63..a0e9422 100644
--- a/src/Feldspar/Primitive/Backend/C.hs
+++ b/src/Feldspar/Primitive/Backend/C.hs
@@ -362,8 +362,5 @@ compPrim = simpleMatch (\(s :&: t) -> go t s) . unPrim
f' <- compPrim $ Prim f
return $ C.Cond c' t' f' mempty
- go _ s _ = error $ "compPrim: no handling of symbol " ++ renderSym s
- -- Should not occur, but the completeness checker doesn't know that
-
instance CompExp Prim where compExp = compPrim
diff --git a/src/Feldspar/Representation.hs b/src/Feldspar/Representation.hs
index c940379..1297e7c 100644
--- a/src/Feldspar/Representation.hs
+++ b/src/Feldspar/Representation.hs
@@ -1,6 +1,7 @@
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
+{-# LANGUAGE DataKinds #-}
-- | Internal representation of Feldspar programs
diff --git a/src/Feldspar/Run/Compile.hs b/src/Feldspar/Run/Compile.hs
index 4cae86a..d06676b 100644
--- a/src/Feldspar/Run/Compile.hs
+++ b/src/Feldspar/Run/Compile.hs
@@ -163,9 +163,6 @@ translateExp a = do
go t lit Nil
| Just (Lit a) <- prj lit
= return $ mapStruct (constExp . runIdentity) $ toStruct t a
- go t lit Nil
- | Just (Literal a) <- prj lit
- = return $ mapStruct (constExp . runIdentity) $ toStruct t a
go t var Nil
| Just (VarT v) <- prj var
= lookAlias t v
@@ -180,11 +177,13 @@ translateExp a = do
| Just Pair <- prj tup = Two <$> goAST a <*> goAST b
go t sel (ab :* Nil)
| Just Fst <- prj sel = do
- Two a _ <- goAST ab
- return a
+ ast <- goAST ab
+ case ast of
+ Two a _ -> return a
| Just Snd <- prj sel = do
- Two _ b <- goAST ab
- return b
+ ast <- goAST ab
+ case ast of
+ Two _ b -> return b
go _ c Nil
| Just Pi <- prj c = return $ Single $ sugarSymPrim Pi
go _ op (a :* Nil)
@@ -299,8 +298,8 @@ translateExp a = do
-- | Translate an expression that is assumed to fulfill @`PrimType` a@
unsafeTransSmallExp :: Monad m => Data a -> TargetT m (Prim a)
unsafeTransSmallExp a = do
- Single b <- translateExp a
- return b
+ exp <- translateExp a
+ case exp of Single b -> return b
-- This function should ideally have a `PrimType' a` constraint, but that is
-- not allowed when passing it to `reexpressEnv`. It should be possible to
-- make it work by changing the interface to `reexpressEnv`.
diff --git a/src/Feldspar/Run/Representation.hs b/src/Feldspar/Run/Representation.hs
index 3efd862..93d265b 100644
--- a/src/Feldspar/Run/Representation.hs
+++ b/src/Feldspar/Run/Representation.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE DataKinds #-}
+
-- | Monad for running Feldspar programs
module Feldspar.Run.Representation where
diff --git a/tests/Compilation.hs b/tests/Compilation.hs
index bf47663..7c81751 100644..100755
--- a/tests/Compilation.hs
+++ b/tests/Compilation.hs
@@ -76,9 +76,9 @@ main = do
tag "test_option" >> compareCompiled test_option (runIO test_option) "5\n"
tag "test_option" >> compareCompiled test_option (runIO test_option) "6\n"
tag "test_optionM" >> compareCompiled test_optionM (runIO test_option) "5\n"
- tag "test_optionM" >> compareCompiled test_optionM (runIO test_optionM) "6\n"
+ tag "test_optionM" >> compareCompiled test_optionM (runIO test_optionM) "5\n"
tag "test_optionT" >> compareCompiled test_optionT (runIO test_optionT) "10\n"
tag "test_constFoldArr" >> compareCompiled test_constFoldArr (runIO test_constFoldArr) ""
where
- tag str = putStrLn $ "---------------- examples/Demo.hs/" Prelude.++ str Prelude.++ "\n"
+ tag str = putStrLn $ "---------------- tests/Compilation.hs/" Prelude.++ str Prelude.++ "\n"
diff --git a/tests/Examples.hs b/tests/Examples.hs
index 054b7a6..a492b76 100644..100755
--- a/tests/Examples.hs
+++ b/tests/Examples.hs
@@ -70,7 +70,10 @@ prop_fib fb1 fb2 = QC.monadicIO $ do
fs2 <- QC.run $ fb2 n
QC.assert (fs1 Prelude.== fs2)
-main =
+main = (Concurrent.testAll >>) $
+ -- It doesn't work to have `Concurrent.testAll` as a test case on
+ -- GHC 8.4.2. But it works on GHC 8.0.2.
+
marshalledM (return . dft) $ \dft' ->
marshalledM (return . idft) $ \idft' ->
marshalledM (fftS 1) $ \fft1 ->
@@ -89,7 +92,6 @@ main =
, testCase "Tut6" Tut6.testAll
, testCase "Tut7" Tut7.testAll
, testCase "Tut8" Tut8.testAll
- , testCase "Concurrent" Concurrent.testAll
, testProperty "fft1_dft" $ prop_fft_dft dft' fft1
, testProperty "fft2_dft" $ prop_fft_dft dft' fft2
, testProperty "dft_idft" $ prop_inverse dft' idft'
diff --git a/tests/NumSimpl.hs b/tests/NumSimpl.hs
index d68171e..d68171e 100644..100755
--- a/tests/NumSimpl.hs
+++ b/tests/NumSimpl.hs
diff --git a/tests/Semantics.hs b/tests/Semantics.hs
index 0919f5f..0919f5f 100644..100755
--- a/tests/Semantics.hs
+++ b/tests/Semantics.hs