packages feed

symantic-lib 0.0.4.20180831 → 0.0.5.20190614

raw patch · 13 files changed

+66/−31 lines, 13 filesdep ~megaparsecPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: megaparsec

API changes (from Hackage documentation)

- Language.Symantic.Lib.Function: instance (Language.Symantic.Grammar.Source.Source src, Language.Symantic.Compiling.Term.SymInj (* -> * -> *) ss ((->) 'GHC.Types.LiftedRep 'GHC.Types.LiftedRep)) => Language.Symantic.Compiling.Module.ModuleFor (* -> * -> *) src ss ((->) 'GHC.Types.LiftedRep 'GHC.Types.LiftedRep)
- Language.Symantic.Lib.Function: instance Language.Symantic.Compiling.Grammar.Gram_Term_AtomsFor (* -> * -> *) src ss g ((->) 'GHC.Types.LiftedRep 'GHC.Types.LiftedRep)
- Language.Symantic.Lib.Function: instance Language.Symantic.Typing.Module.NameTyOf (* -> * -> *) ((->) 'GHC.Types.LiftedRep 'GHC.Types.LiftedRep)
- Language.Symantic.Lib.Function: instance Language.Symantic.Typing.Type.ClassInstancesFor (* -> * -> *) ((->) 'GHC.Types.LiftedRep 'GHC.Types.LiftedRep)
- Language.Symantic.Lib.Function: instance Language.Symantic.Typing.Type.TypeInstancesFor (* -> * -> *) ((->) 'GHC.Types.LiftedRep 'GHC.Types.LiftedRep)
- Language.Symantic.Lib.Maybe: instance (Language.Symantic.Grammar.Source.Source src, Language.Symantic.Compiling.Term.SymInj (* -> *) ss GHC.Base.Maybe) => Language.Symantic.Compiling.Module.ModuleFor (* -> *) src ss GHC.Base.Maybe
- Language.Symantic.Lib.Maybe: instance Language.Symantic.Compiling.Grammar.Gram_Term_AtomsFor (* -> *) src ss g GHC.Base.Maybe
- Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Module.FixityOf (* -> *) GHC.Base.Maybe
- Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Module.NameTyOf (* -> *) GHC.Base.Maybe
- Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Type.ClassInstancesFor (* -> *) GHC.Base.Maybe
- Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Type.TypeInstancesFor (* -> *) GHC.Base.Maybe
+ Language.Symantic.Lib.Alternative: infixl 3 <|>
+ Language.Symantic.Lib.Applicative: infixl 4 <*>
+ Language.Symantic.Lib.Bool: infixr 2 ||
+ Language.Symantic.Lib.Bool: infixr 3 &&
+ Language.Symantic.Lib.Eq: infix 4 ==
+ Language.Symantic.Lib.Foldable: infix 4 `elem`
+ Language.Symantic.Lib.Function: infixr 9 `comp`
+ Language.Symantic.Lib.Function: instance (Language.Symantic.Grammar.Source.Source src, Language.Symantic.Compiling.Term.SymInj (* -> * -> *) ss ('GHC.Types.LiftedRep -> 'GHC.Types.LiftedRep)) => Language.Symantic.Compiling.Module.ModuleFor (* -> * -> *) src ss ('GHC.Types.LiftedRep -> 'GHC.Types.LiftedRep)
+ Language.Symantic.Lib.Function: instance Language.Symantic.Compiling.Grammar.Gram_Term_AtomsFor (* -> * -> *) src ss g ('GHC.Types.LiftedRep -> 'GHC.Types.LiftedRep)
+ Language.Symantic.Lib.Function: instance Language.Symantic.Typing.Module.NameTyOf (* -> * -> *) ('GHC.Types.LiftedRep -> 'GHC.Types.LiftedRep)
+ Language.Symantic.Lib.Function: instance Language.Symantic.Typing.Type.ClassInstancesFor (* -> * -> *) ('GHC.Types.LiftedRep -> 'GHC.Types.LiftedRep)
+ Language.Symantic.Lib.Function: instance Language.Symantic.Typing.Type.TypeInstancesFor (* -> * -> *) ('GHC.Types.LiftedRep -> 'GHC.Types.LiftedRep)
+ Language.Symantic.Lib.Functor: infixl 4 <$
+ Language.Symantic.Lib.Integral: infixl 7 `quot`
+ Language.Symantic.Lib.List: infixr 5 `list_cons`
+ Language.Symantic.Lib.Maybe: instance (Language.Symantic.Grammar.Source.Source src, Language.Symantic.Compiling.Term.SymInj (* -> *) ss GHC.Maybe.Maybe) => Language.Symantic.Compiling.Module.ModuleFor (* -> *) src ss GHC.Maybe.Maybe
+ Language.Symantic.Lib.Maybe: instance Language.Symantic.Compiling.Grammar.Gram_Term_AtomsFor (* -> *) src ss g GHC.Maybe.Maybe
+ Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Module.FixityOf (* -> *) GHC.Maybe.Maybe
+ Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Module.NameTyOf (* -> *) GHC.Maybe.Maybe
+ Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Type.ClassInstancesFor (* -> *) GHC.Maybe.Maybe
+ Language.Symantic.Lib.Maybe: instance Language.Symantic.Typing.Type.TypeInstancesFor (* -> *) GHC.Maybe.Maybe
+ Language.Symantic.Lib.Monad: infixl 1 >>=
+ Language.Symantic.Lib.Monad: infixr 1 >=>
+ Language.Symantic.Lib.Num: infixl 6 +
+ Language.Symantic.Lib.Num: infixl 7 *
+ Language.Symantic.Lib.Ord: infix 4 >=
- Language.Symantic.Lib.Foldable: t1 :: Source src => LenInj vs => KindInj (K t) => Type src (a : Proxy t : vs) t
+ Language.Symantic.Lib.Foldable: t1 :: Source src => LenInj vs => KindInj (K t) => Type src (a : (Proxy t : vs)) t
- Language.Symantic.Lib.Foldable: t2 :: Source src => LenInj vs => KindInj (K t) => Type src (a : b : Proxy t : vs) t
+ Language.Symantic.Lib.Foldable: t2 :: Source src => LenInj vs => KindInj (K t) => Type src (a : (b : (Proxy t : vs))) t
- Language.Symantic.Lib.Foldable: teFoldable_elem :: TermDef Foldable '[Proxy a, Proxy t] (Foldable t # Eq a #> (a -> t a -> Bool))
+ Language.Symantic.Lib.Foldable: teFoldable_elem :: TermDef Foldable '[Proxy a, Proxy t] ((Foldable t # Eq a) #> (a -> t a -> Bool))
- Language.Symantic.Lib.Foldable: teFoldable_foldMap :: TermDef Foldable '[Proxy a, Proxy t, Proxy m] (Foldable t # Monoid m #> ((a -> m) -> t a -> m))
+ Language.Symantic.Lib.Foldable: teFoldable_foldMap :: TermDef Foldable '[Proxy a, Proxy t, Proxy m] ((Foldable t # Monoid m) #> ((a -> m) -> t a -> m))
- Language.Symantic.Lib.Foldable: teFoldable_maximum :: TermDef Foldable '[Proxy a, Proxy t] (Foldable t # Ord a #> (t a -> a))
+ Language.Symantic.Lib.Foldable: teFoldable_maximum :: TermDef Foldable '[Proxy a, Proxy t] ((Foldable t # Ord a) #> (t a -> a))
- Language.Symantic.Lib.Foldable: teFoldable_minimum :: TermDef Foldable '[Proxy a, Proxy t] (Foldable t # Ord a #> (t a -> a))
+ Language.Symantic.Lib.Foldable: teFoldable_minimum :: TermDef Foldable '[Proxy a, Proxy t] ((Foldable t # Ord a) #> (t a -> a))
- Language.Symantic.Lib.Foldable: teFoldable_product :: TermDef Foldable '[Proxy a, Proxy t] (Foldable t # Num a #> (t a -> a))
+ Language.Symantic.Lib.Foldable: teFoldable_product :: TermDef Foldable '[Proxy a, Proxy t] ((Foldable t # Num a) #> (t a -> a))
- Language.Symantic.Lib.Foldable: teFoldable_sum :: TermDef Foldable '[Proxy a, Proxy t] (Foldable t # Num a #> (t a -> a))
+ Language.Symantic.Lib.Foldable: teFoldable_sum :: TermDef Foldable '[Proxy a, Proxy t] ((Foldable t # Num a) #> (t a -> a))
- Language.Symantic.Lib.Function: b1 :: Source src => LenInj vs => KindInj (K b) => Type src (a : Proxy b : vs) b
+ Language.Symantic.Lib.Function: b1 :: Source src => LenInj vs => KindInj (K b) => Type src (a : (Proxy b : vs)) b
- Language.Symantic.Lib.Function: c2 :: Source src => LenInj vs => KindInj (K c) => Type src (a : b : Proxy c : vs) c
+ Language.Symantic.Lib.Function: c2 :: Source src => LenInj vs => KindInj (K c) => Type src (a : (b : (Proxy c : vs))) c
- Language.Symantic.Lib.Function: teFunction_compose :: TermDef (->) '[Proxy a, Proxy b, Proxy c] (() #> ((b -> c) -> (a -> b) -> (a -> c)))
+ Language.Symantic.Lib.Function: teFunction_compose :: TermDef (->) '[Proxy a, Proxy b, Proxy c] (() #> ((b -> c) -> (a -> b) -> a -> c))
- Language.Symantic.Lib.Function: teFunction_flip :: TermDef (->) '[Proxy a, Proxy b, Proxy c] (() #> ((a -> b -> c) -> (b -> a -> c)))
+ Language.Symantic.Lib.Function: teFunction_flip :: TermDef (->) '[Proxy a, Proxy b, Proxy c] (() #> ((a -> b -> c) -> b -> a -> c))
- Language.Symantic.Lib.Functor: f1 :: Source src => LenInj vs => KindInj (K f) => Type src (a : Proxy f : vs) f
+ Language.Symantic.Lib.Functor: f1 :: Source src => LenInj vs => KindInj (K f) => Type src (a : (Proxy f : vs)) f
- Language.Symantic.Lib.Functor: f2 :: Source src => LenInj vs => KindInj (K f) => Type src (a : b : Proxy f : vs) f
+ Language.Symantic.Lib.Functor: f2 :: Source src => LenInj vs => KindInj (K f) => Type src (a : (b : (Proxy f : vs))) f
- Language.Symantic.Lib.IO: teIO_openFile :: TermDef Handle '[] (() #> (FilePath -> IOMode -> IO (Handle)))
+ Language.Symantic.Lib.IO: teIO_openFile :: TermDef Handle '[] (() #> (FilePath -> IOMode -> IO Handle))
- Language.Symantic.Lib.Map: k1 :: Source src => LenInj vs => KindInj (K k) => Type src (a : Proxy k : vs) k
+ Language.Symantic.Lib.Map: k1 :: Source src => LenInj vs => KindInj (K k) => Type src (a : (Proxy k : vs)) k
- Language.Symantic.Lib.Map: k2 :: Source src => LenInj vs => KindInj (K k) => Type src (a : b : Proxy k : vs) k
+ Language.Symantic.Lib.Map: k2 :: Source src => LenInj vs => KindInj (K k) => Type src (a : (b : (Proxy k : vs))) k
- Language.Symantic.Lib.Monad: m1 :: Source src => LenInj vs => KindInj (K m) => Type src (a : Proxy m : vs) m
+ Language.Symantic.Lib.Monad: m1 :: Source src => LenInj vs => KindInj (K m) => Type src (a : (Proxy m : vs)) m
- Language.Symantic.Lib.Monad: m2 :: Source src => LenInj vs => KindInj (K m) => Type src (a : b : Proxy m : vs) m
+ Language.Symantic.Lib.Monad: m2 :: Source src => LenInj vs => KindInj (K m) => Type src (a : (b : (Proxy m : vs))) m
- Language.Symantic.Lib.Monad: m3 :: Source src => LenInj vs => KindInj (K m) => Type src (a : b : c : Proxy m : vs) m
+ Language.Symantic.Lib.Monad: m3 :: Source src => LenInj vs => KindInj (K m) => Type src (a : (b : (c : (Proxy m : vs)))) m
- Language.Symantic.Lib.Monad: teMonad_kleisli_l2r :: TermDef Monad '[Proxy a, Proxy b, Proxy c, Proxy m] (Monad m #> ((a -> m b) -> (b -> m c) -> (a -> m c)))
+ Language.Symantic.Lib.Monad: teMonad_kleisli_l2r :: TermDef Monad '[Proxy a, Proxy b, Proxy c, Proxy m] (Monad m #> ((a -> m b) -> (b -> m c) -> a -> m c))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_oall :: TermDef MonoFoldable '[Proxy o, Proxy e] (MonoFoldable o # e #~ Element o #> ((e -> Bool) -> o -> Bool))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_oall :: TermDef MonoFoldable '[Proxy o, Proxy e] ((MonoFoldable o # (e #~ Element o)) #> ((e -> Bool) -> o -> Bool))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_oany :: TermDef MonoFoldable '[Proxy o, Proxy e] (MonoFoldable o # e #~ Element o #> ((e -> Bool) -> o -> Bool))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_oany :: TermDef MonoFoldable '[Proxy o, Proxy e] ((MonoFoldable o # (e #~ Element o)) #> ((e -> Bool) -> o -> Bool))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_ofoldMap :: TermDef MonoFoldable '[Proxy o, Proxy e, Proxy m] (MonoFoldable o # Monoid m # e #~ Element o #> ((e -> m) -> o -> m))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_ofoldMap :: TermDef MonoFoldable '[Proxy o, Proxy e, Proxy m] ((MonoFoldable o # (Monoid m # (e #~ Element o))) #> ((e -> m) -> o -> m))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_ofoldl' :: TermDef MonoFoldable '[Proxy o, Proxy e, Proxy a] (MonoFoldable o # e #~ Element o #> ((a -> e -> a) -> a -> o -> a))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_ofoldl' :: TermDef MonoFoldable '[Proxy o, Proxy e, Proxy a] ((MonoFoldable o # (e #~ Element o)) #> ((a -> e -> a) -> a -> o -> a))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_ofoldr :: TermDef MonoFoldable '[Proxy o, Proxy e, Proxy a] (MonoFoldable o # e #~ Element o #> ((e -> a -> a) -> a -> o -> a))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_ofoldr :: TermDef MonoFoldable '[Proxy o, Proxy e, Proxy a] ((MonoFoldable o # (e #~ Element o)) #> ((e -> a -> a) -> a -> o -> a))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_olength :: TermDef MonoFoldable '[Proxy o, Proxy e] (MonoFoldable o # e #~ Element o #> (o -> Int))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_olength :: TermDef MonoFoldable '[Proxy o, Proxy e] ((MonoFoldable o # (e #~ Element o)) #> (o -> Int))
- Language.Symantic.Lib.MonoFoldable: teMonoFoldable_otoList :: TermDef MonoFoldable '[Proxy o, Proxy e] (MonoFoldable o # e #~ Element o #> (o -> [Element o]))
+ Language.Symantic.Lib.MonoFoldable: teMonoFoldable_otoList :: TermDef MonoFoldable '[Proxy o, Proxy e] ((MonoFoldable o # (e #~ Element o)) #> (o -> [Element o]))
- Language.Symantic.Lib.MonoFunctor: e1 :: Source src => LenInj vs => KindInj (K e) => Type src (a : Proxy e : vs) e
+ Language.Symantic.Lib.MonoFunctor: e1 :: Source src => LenInj vs => KindInj (K e) => Type src (a : (Proxy e : vs)) e
- Language.Symantic.Lib.MonoFunctor: teMonoFunctor_omap :: TermDef MonoFunctor '[Proxy o, Proxy e] (MonoFunctor o # e #~ Element o #> ((e -> e) -> o -> o))
+ Language.Symantic.Lib.MonoFunctor: teMonoFunctor_omap :: TermDef MonoFunctor '[Proxy o, Proxy e] ((MonoFunctor o # (e #~ Element o)) #> ((e -> e) -> o -> o))
- Language.Symantic.Lib.NonNull: teNonNull_head :: TermDef NonNull '[Proxy o, Proxy e] (MonoFoldable o # e #~ Element o #> (NonNull o -> e))
+ Language.Symantic.Lib.NonNull: teNonNull_head :: TermDef NonNull '[Proxy o, Proxy e] ((MonoFoldable o # (e #~ Element o)) #> (NonNull o -> e))
- Language.Symantic.Lib.NonNull: teNonNull_last :: TermDef NonNull '[Proxy o, Proxy e] (MonoFoldable o # e #~ Element o #> (NonNull o -> e))
+ Language.Symantic.Lib.NonNull: teNonNull_last :: TermDef NonNull '[Proxy o, Proxy e] ((MonoFoldable o # (e #~ Element o)) #> (NonNull o -> e))
- Language.Symantic.Lib.NonNull: teNonNull_ncons :: TermDef NonNull '[Proxy s, Proxy e] (SemiSequence s # e #~ Element s #> (e -> s -> NonNull s))
+ Language.Symantic.Lib.NonNull: teNonNull_ncons :: TermDef NonNull '[Proxy s, Proxy e] ((SemiSequence s # (e #~ Element s)) #> (e -> s -> NonNull s))
- Language.Symantic.Lib.NonNull: teNonNull_nfilter :: TermDef NonNull '[Proxy s, Proxy e] (IsSequence s # e #~ Element s #> ((e -> Bool) -> NonNull s -> s))
+ Language.Symantic.Lib.NonNull: teNonNull_nfilter :: TermDef NonNull '[Proxy s, Proxy e] ((IsSequence s # (e #~ Element s)) #> ((e -> Bool) -> NonNull s -> s))
- Language.Symantic.Lib.NonNull: teNonNull_nuncons :: TermDef NonNull '[Proxy s, Proxy e] (IsSequence s # e #~ Element s #> (NonNull s -> (e, Maybe (NonNull s))))
+ Language.Symantic.Lib.NonNull: teNonNull_nuncons :: TermDef NonNull '[Proxy s, Proxy e] ((IsSequence s # (e #~ Element s)) #> (NonNull s -> (e, Maybe (NonNull s))))
- Language.Symantic.Lib.Semigroup: teSemigroup_stimes :: TermDef Semigroup '[Proxy a, Proxy b] (Semigroup a # Integral b #> (b -> a -> a))
+ Language.Symantic.Lib.Semigroup: teSemigroup_stimes :: TermDef Semigroup '[Proxy a, Proxy b] ((Semigroup a # Integral b) #> (b -> a -> a))
- Language.Symantic.Lib.Sequences: teIsSequence_filter :: TermDef IsSequence '[Proxy s, Proxy e] (IsSequence s # e #~ Element s #> ((e -> Bool) -> s -> s))
+ Language.Symantic.Lib.Sequences: teIsSequence_filter :: TermDef IsSequence '[Proxy s, Proxy e] ((IsSequence s # (e #~ Element s)) #> ((e -> Bool) -> s -> s))
- Language.Symantic.Lib.Sequences: teSemiSequence_cons :: TermDef SemiSequence '[Proxy s, Proxy e] (SemiSequence s # e #~ Element s #> (e -> s -> s))
+ Language.Symantic.Lib.Sequences: teSemiSequence_cons :: TermDef SemiSequence '[Proxy s, Proxy e] ((SemiSequence s # (e #~ Element s)) #> (e -> s -> s))
- Language.Symantic.Lib.Sequences: teSemiSequence_intersperse :: TermDef SemiSequence '[Proxy s, Proxy e] (SemiSequence s # e #~ Element s #> (e -> s -> s))
+ Language.Symantic.Lib.Sequences: teSemiSequence_intersperse :: TermDef SemiSequence '[Proxy s, Proxy e] ((SemiSequence s # (e #~ Element s)) #> (e -> s -> s))
- Language.Symantic.Lib.Sequences: teSemiSequence_reverse :: TermDef SemiSequence '[Proxy s, Proxy e] (SemiSequence s # e #~ Element s #> (s -> s))
+ Language.Symantic.Lib.Sequences: teSemiSequence_reverse :: TermDef SemiSequence '[Proxy s, Proxy e] ((SemiSequence s # (e #~ Element s)) #> (s -> s))
- Language.Symantic.Lib.Sequences: teSemiSequence_snoc :: TermDef SemiSequence '[Proxy s, Proxy e] (SemiSequence s # e #~ Element s #> (s -> e -> s))
+ Language.Symantic.Lib.Sequences: teSemiSequence_snoc :: TermDef SemiSequence '[Proxy s, Proxy e] ((SemiSequence s # (e #~ Element s)) #> (s -> e -> s))
- Language.Symantic.Lib.Traversable: teTraversable_traverse :: TermDef Traversable '[Proxy a, Proxy b, Proxy f, Proxy t] (Traversable t # Applicative f #> ((a -> f b) -> t a -> f (t b)))
+ Language.Symantic.Lib.Traversable: teTraversable_traverse :: TermDef Traversable '[Proxy a, Proxy b, Proxy f, Proxy t] ((Traversable t # Applicative f) #> ((a -> f b) -> t a -> f (t b)))

Files

Language/Symantic/Lib/If.hs view
@@ -27,7 +27,7 @@ instance Sym_If View where 	if_ (View cond) (View ok) (View ko) = 		View $ \po v ->-			parenInfix po op $+			pairIfNeeded pairParen po op $ 			Text.concat 			 [ "if ", cond (op, SideL) v 			 , " then ", ok (op, SideL) v
stack.yaml view
@@ -1,11 +1,11 @@-resolver: lts-12.8+resolver: lts-13.19 packages: - '.' - location: '../symantic'   extra-dep: true - location: '../symantic-grammar'   extra-dep: true-- location: '../symantic-document'+- location: '../../symantic-document'   extra-dep: true extra-deps: - monad-classes-0.3.2.2
symantic-lib.cabal view
@@ -2,7 +2,7 @@ -- PVP:  +-+------- breaking API changes --       | | +----- non-breaking API additions --       | | | +--- code changes with no API change-version: 0.0.4.20180831+version: 0.0.5.20190614 category: Language synopsis: Symantics for common types. description: Symantics for common types,@@ -17,11 +17,11 @@ -- homepage:  build-type: Simple-cabal-version: >= 1.24+cabal-version: 1.24+tested-with: GHC==8.4.4 extra-source-files:   stack.yaml extra-tmp-files:-tested-with: GHC==8.4.3  Source-Repository head   location: git://git.autogeree.net/symantic@@ -146,7 +146,7 @@     , base             >= 4.6 && < 5     , bytestring       >= 0.10     , containers       >= 0.5-    , megaparsec       >= 6.3+    , megaparsec       >= 7.0     , monad-classes    >= 0.3.2     , mono-traversable >= 1.0     , tasty            >= 0.11
test/Golden.hs view
@@ -6,7 +6,7 @@ import Data.Semigroup (Semigroup(..)) import Data.String (String) -- import System.FilePath (FilePath)-import System.IO (IO)+import System.IO (IO, FilePath) import qualified Data.ByteString.Lazy as BSL import qualified Data.List as List import qualified Data.Text.Lazy          as TL
test/HUnit/Applicative.hs view
@@ -2,7 +2,13 @@ module HUnit.Applicative where  import Test.Tasty+import Control.Applicative (Applicative)+import Data.Bool+import Data.Either (Either(..))+import Data.Functor (Functor)+import Data.Maybe (Maybe(..)) import Data.Proxy (Proxy(..))+import Prelude (Integer)  import Language.Symantic.Lib import Testing.Compiling
test/HUnit/Foldable.hs view
@@ -2,7 +2,12 @@ module HUnit.Foldable where  import Test.Tasty+import Control.Applicative (Applicative)+import Data.Either (Either(..))+import Data.Foldable (Foldable)+import Data.Int (Int) import Data.Proxy (Proxy(..))+import Prelude (Integer)  import Language.Symantic.Lib import Testing.Compiling
test/HUnit/Functor.hs view
@@ -2,7 +2,12 @@ module HUnit.Functor where  import Test.Tasty+import Data.Bool+import Data.Either (Either(..))+import Data.Functor (Functor)+import Data.Maybe (Maybe(..)) import Data.Proxy (Proxy(..))+import Prelude (Integer)  import Language.Symantic () import Language.Symantic.Lib
test/HUnit/Map.hs view
@@ -2,9 +2,14 @@ module HUnit.Map where  import Test.Tasty+import Data.Char (Char)+import Data.Either (Either(..))+import Data.Int (Int)+import Data.Monoid (Monoid) import Data.Map.Strict (Map) import Data.Proxy (Proxy(..)) import Data.Text as Text+import Prelude (Integer, Num) import qualified Data.Map.Strict as Map  import Language.Symantic.Lib
test/HUnit/MonoFunctor.hs view
@@ -2,7 +2,12 @@ module HUnit.MonoFunctor where  import Test.Tasty+import Data.Bool+import Data.Char (Char)+import Data.Either (Either(..))+import Data.Maybe (Maybe(..)) import Data.Proxy (Proxy(..))+import Prelude (Integer) import qualified Data.MonoTraversable as MT  import Language.Symantic.Lib
test/HUnit/Tuple2.hs view
@@ -2,7 +2,9 @@ module HUnit.Tuple2 where  import Test.Tasty+import Data.Either (Either(..)) import Data.Proxy (Proxy(..))+import Prelude (Integer)  import Language.Symantic.Lib import Testing.Compiling
test/Main.hs view
@@ -1,6 +1,8 @@ module Main where  import Test.Tasty+import Data.Function (($))+import System.IO (IO)  import Golden import HUnit
test/Testing/Compiling.hs view
@@ -9,16 +9,30 @@ import Test.Tasty.HUnit import Debug.Trace (trace) +import Control.Applicative (Applicative(..)) import Control.Arrow (left)+import Control.Monad (Monad(..))+import Data.Either (Either(..), either)+import Data.Eq (Eq(..))+import Data.Function (($), (.), id)+import Data.Functor ((<$>)) import Data.Functor.Identity (Identity(..))+import Data.List ((++))+import Data.Maybe (Maybe(..))+import Data.Ord (Ord(..))+import Data.String (String) import Data.Text (Text)+import Data.Tuple (snd) import Data.Type.Equality import Data.Void (Void)+import Prelude (error)+import Text.Show (Show) import qualified Control.Monad.Classes.Run as MC import qualified Control.Monad.Trans.State.Strict as S import qualified Data.List as List import qualified Data.Text as Text import qualified Text.Megaparsec as P+import qualified Text.Show as Show  import Language.Symantic.Grammar import Language.Symantic@@ -38,9 +52,9 @@  ModulesTyInj ss =>  ModulesInj src ss =>  Gram_Term src ss (G src ss) =>- Text -> Either (P.ParseError Char Void) (AST_Term src ss)+ Text -> Either (P.ParseErrorBundle Text Void) (AST_Term src ss) parseTe inp =-	let modsTe :: Modules src ss = either (error . show) id modulesInj in+	let modsTe :: Modules src ss = either (error . Show.show) id modulesInj in 	let impsTe = [] `importModules` modsTe in 	let modsTy = modulesTyInj @ss @src in 	let impsTy = importTypes @ss [] in@@ -70,7 +84,7 @@  ) =>  Text ->  Either ( Type src '[] t-        , Either (P.ParseError Char Void)+        , Either (P.ParseErrorBundle Text Void)                  (Error_Term src) )         (Type src '[] t, t, Text) ->  TestTree@@ -106,8 +120,8 @@ maybeRight Left{}    = Nothing  elide :: Text -> String-elide s | Text.length s > 42 = List.take 42 (Text.unpack s) List.++ ['…']+elide s | Text.length s > 42 = List.take 42 (Text.unpack s) ++ ['…'] elide s = Text.unpack s  dbg :: Show a => String -> a -> a-dbg msg x = trace (msg ++ " = " ++ Prelude.show x) x+dbg msg x = trace (msg ++ " = " ++ Show.show x) x
test/Testing/Megaparsec.hs view
@@ -10,14 +10,14 @@ import Data.Either (Either(..)) import Data.Function (($), (.)) import Data.Functor (Functor(..), (<$>))-import Data.List.NonEmpty (NonEmpty(..)) import Data.Ord (Ord(..))-import Data.String (IsString(..))+import Data.String (String, IsString(..)) import Data.Typeable () import Text.Show (Show(..)) import qualified Control.Applicative as Alt import qualified Control.Monad.Classes as MC import qualified Data.Char as Char+import qualified Data.List as List import qualified Data.Text as Text import qualified Data.Text.Lazy as TL import qualified Text.Megaparsec as P@@ -37,28 +37,19 @@ -- Readers -- --- NonEmpty P.SourcePos-instance ParsecC e s => Sym.Gram_Reader (NonEmpty P.SourcePos) (P.ParsecT e s m) where-	askBefore g = do-		s <- P.statePos <$> P.getParserState-		($ s) <$> g-	askAfter g = do-		f <- g-		f . P.statePos <$> P.getParserState-type instance MC.CanDo (P.ParsecT e s m) (MC.EffReader (NonEmpty P.SourcePos)) = 'True-instance ParsecC e s => MC.MonadReaderN 'MC.Zero (NonEmpty P.SourcePos) (P.ParsecT e s m) where-	askN _n = P.statePos <$> P.getParserState+{- -- P.SourcePos instance ParsecC e s => Sym.Gram_Reader P.SourcePos (P.ParsecT e s m) where 	askBefore g = do-		s <- P.getPosition+		s <- P.getSourcePos 		($ s) <$> g 	askAfter g = do 		f <- g-		f <$> P.getPosition+		f <$> P.getSourcePos type instance MC.CanDo (P.ParsecT e s m) (MC.EffReader P.SourcePos) = 'True instance ParsecC e s => MC.MonadReaderN 'MC.Zero P.SourcePos (P.ParsecT e s m) where-	askN _n = P.getPosition+	askN _n = P.getSourcePos+-} -- () instance ParsecC e s => Sym.Gram_Reader () (P.ParsecT e s m) where 	askBefore = fmap ($ ())@@ -108,10 +99,10 @@ instance ParsecC e s => Sym.Gram_Rule (P.ParsecT e s m) where 	rule = P.label . Text.unpack instance ParsecC e s => Sym.Gram_Char (P.ParsecT e s m) where-	any          = P.anyChar+	any          = P.anySingle 	eoi          = P.eof 	char         = P.char-	unicat cat   = P.satisfy $ (`elem` cats) . Char.generalCategory+	unicat cat   = P.satisfy $ (`List.elem` cats) . Char.generalCategory 		where cats = unicode_categories cat 	range (l, h) = P.satisfy $ \c -> l <= c && c <= h 	Terminal f `but` Terminal p = Terminal $ P.notFollowedBy (P.try p) *> f