diff --git a/protolude.cabal b/protolude.cabal index 9df665958..f7d830376 100644 --- a/protolude.cabal +++ b/protolude.cabal @@ -45,6 +45,7 @@ library Show Either Functor + Semiring Bifunctor default-extensions: @@ -64,7 +65,6 @@ library async >= 2.1 && <2.2, deepseq >= 1.3 && <= 1.5, containers >= 0.5 && <0.6, - semiring-simple >= 0.1 && <1.1, mtl >= 2.1 && <2.3, transformers >= 0.4 && < 0.6, text >= 1.2 && <1.3, diff --git a/src/Protolude.hs b/src/Protolude.hs index 7c7a2d5e0..9fb1847ce 100644 --- a/src/Protolude.hs +++ b/src/Protolude.hs @@ -80,7 +80,7 @@ import Data.Foldable as X hiding ( foldr1 , foldl1 ) -import Data.Semiring as X +import Semiring as X import Data.Functor.Identity as X #if ( __GLASGOW_HASKELL__ >= 800 ) diff --git a/src/Semiring.hs b/src/Semiring.hs new file mode 100644 index 000000000..8699015f2 --- /dev/null +++ b/src/Semiring.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE Safe #-} +{-# LANGUAGE NoImplicitPrelude #-} + +module Semiring ( + Semiring(..), + zero, +) where + +import Data.Monoid + +-- | Alias for 'mempty' +zero :: Monoid m => m +zero = mempty + +class Monoid m => Semiring m where + {-# MINIMAL one, (<.>) #-} + + one :: m + (<.>) :: m -> m -> m diff --git a/stack.yaml b/stack.yaml index 029f3726e..5681c6945 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,34 +1,7 @@ -# For more information, see: https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md - -# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) resolver: lts-5.10 - -# Local packages, usually specified by relative directory name packages: - '.' - -# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3) extra-deps: -- semiring-simple-1.0.0.1 - string-conv-0.1 - -# 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: >= 0.1.4.0 - -# 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]