summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreliaslfox <>2018-11-02 06:25:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-11-02 06:25:00 (GMT)
commit49cd3de06b1aafc0fd3219fc3e06a071e7ce168c (patch)
tree4a891436d3ad18933f2d604e57cb0a3b0ffa0f09
parent8864425beb56920d2b5437ed5e3f1770e25f45f1 (diff)
version 0.1.1.00.1.1.0
-rw-r--r--language-elm.cabal100
-rw-r--r--src/Elm.hs1
-rw-r--r--src/Elm/Expression.hs1
-rw-r--r--src/Elm/GenError.hs8
4 files changed, 70 insertions, 40 deletions
diff --git a/language-elm.cabal b/language-elm.cabal
index 0ce50ca..c0459c4 100644
--- a/language-elm.cabal
+++ b/language-elm.cabal
@@ -1,42 +1,70 @@
-name: language-elm
-version: 0.1.0.3
-synopsis: Generate elm code
-description: Generate elm code from an ast
-homepage: https://github.com/eliaslfox/language-elm#readme
-license: BSD3
-license-file: LICENSE
-author: Elias Lawson-Fox
-maintainer: eliaslfox@gmail.com
-copyright: 2017 Elias Lawson-Fox
-category: Web
-build-type: Simple
-extra-source-files: README.md
-cabal-version: >=1.10
+-- This file has been generated from package.yaml by hpack version 0.28.2.
+--
+-- see: https://github.com/sol/hpack
+--
+-- hash: 051b4a8042d05f18fb64b3714184c09ca9363d68b341ec9be6effdb370eeabe0
+
+name: language-elm
+version: 0.1.1.0
+synopsis: Generate elm code
+description: Generate elm code from an ast
+category: Web
+homepage: https://github.com/eliaslfox/language-elm#readme
+bug-reports: https://github.com/eliaslfox/language-elm/issues
+author: Elias Lawson-Fox
+maintainer: eliaslfox@gmail.com
+copyright: 2017 Elias Lawson-Fox
+license: BSD3
+license-file: LICENSE
+build-type: Simple
+cabal-version: >= 1.10
+extra-source-files:
+ README.md
+
+source-repository head
+ type: git
+ location: https://github.com/eliaslfox/language-elm
library
- hs-source-dirs: src
- exposed-modules: Elm, Elm.Decleration, Elm.Expression, Elm.Import, Elm.Program, Elm.Type, Elm.Classes, Elm.GenError
- build-depends: base >= 4.9.1 && < 4.10,
- pretty >= 1.1.3 && < 1.2,
- MissingH >= 1.4.0 && < 1.5,
- mtl >= 2.2.1 && < 2.3,
- protolude >= 0.1.1 && < 0.2
+ exposed-modules:
+ Elm
+ Elm.Decleration
+ Elm.Expression
+ Elm.Import
+ Elm.Program
+ Elm.Type
+ Elm.Classes
+ Elm.GenError
+ other-modules:
+ Paths_language_elm
+ hs-source-dirs:
+ src
+ build-depends:
+ MissingH
+ , base >=4.11 && <=4.12
+ , mtl
+ , pretty
+ , protolude
+ build-tools:
+ doctest
default-language: Haskell2010
test-suite language-elm-test
- type: exitcode-stdio-1.0
- hs-source-dirs: test
- main-is: Spec.hs
- other-modules: Renderer
- build-depends: base
- , language-elm
- , pretty >= 1.1.3 && < 1.2
- , hspec >= 2.4.3 && < 2.5
- , mtl >= 2.2.1 && < 2.3
- , protolude >= 0.1.1 && < 0.2
- ghc-options: -threaded -rtsopts -with-rtsopts=-N
+ type: exitcode-stdio-1.0
+ main-is: Spec.hs
+ other-modules:
+ Renderer
+ Paths_language_elm
+ hs-source-dirs:
+ test
+ ghc-options: -threaded -rtsopts -with-rtsopts=-N
+ build-depends:
+ base >=4.11 && <=4.12
+ , hspec
+ , language-elm
+ , mtl
+ , pretty
+ , protolude
+ build-tools:
+ doctest
default-language: Haskell2010
-
-source-repository head
- type: git
- location: https://github.com/eliaslfox/language-elm
diff --git a/src/Elm.hs b/src/Elm.hs
index e47b581..dc907bb 100644
--- a/src/Elm.hs
+++ b/src/Elm.hs
@@ -68,6 +68,7 @@ import qualified Elm.Import
import qualified Elm.Program
import qualified Elm.Type (TypeDec (..))
import qualified Text.PrettyPrint
+import Prelude (error)
type Expr = Elm.Expression.Expr
type Type = Elm.Type.TypeDec
diff --git a/src/Elm/Expression.hs b/src/Elm/Expression.hs
index ac670ba..d9f0f10 100644
--- a/src/Elm/Expression.hs
+++ b/src/Elm/Expression.hs
@@ -13,7 +13,6 @@ import Protolude
import Control.Monad (mapM, when)
import Control.Monad.Writer (tell)
-import Data.List hiding (map)
import Data.String (IsString (..), String)
import Elm.Classes (Generate (..))
import Elm.GenError (GenError (..))
diff --git a/src/Elm/GenError.hs b/src/Elm/GenError.hs
index 586b939..20e248c 100644
--- a/src/Elm/GenError.hs
+++ b/src/Elm/GenError.hs
@@ -15,8 +15,10 @@ data GenError
| Error String
deriving (Eq, Show)
+instance Semigroup GenError where
+ (Error x) <> _ = Error x
+ _ <> (Error y) = Error y
+ (WarningList x) <> (WarningList y) = WarningList $ x <> y
+
instance Monoid GenError where
- mappend (Error str) _ = Error str
- mappend _ (Error str) = Error str
- mappend (WarningList a) (WarningList b) = WarningList $ a ++ b
mempty = WarningList []