language-ats 1.2.0.1 → 1.2.0.2
raw patch · 6 files changed
+22/−26 lines, 6 filesdep +lensdep −microlensdep −microlens-thdep −mtlPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: lens
Dependencies removed: microlens, microlens-th, mtl
API changes (from Hackage documentation)
- Language.ATS: constructorUniversals :: forall a_aNEc. Lens' (Leaf a_aNEc) [Universal a_aNEc]
+ Language.ATS: constructorUniversals :: forall a_aRT5. Lens' (Leaf a_aRT5) [Universal a_aRT5]
- Language.ATS: expression :: forall a_aNDP. Lens' (PreFunction a_aNDP) (Maybe (Expression a_aNDP))
+ Language.ATS: expression :: forall a_aRSI. Lens' (PreFunction a_aRSI) (Maybe (Expression a_aRSI))
- Language.ATS: fun :: forall a_aNEa. Traversal' (Declaration a_aNEa) (Function a_aNEa)
+ Language.ATS: fun :: forall a_aRT3. Traversal' (Declaration a_aRT3) (Function a_aRT3)
- Language.ATS: leaves :: forall a_aNEa. Traversal' (Declaration a_aNEa) [Leaf a_aNEa]
+ Language.ATS: leaves :: forall a_aRT3. Traversal' (Declaration a_aRT3) [Leaf a_aRT3]
- Language.ATS: preF :: forall a_aNDR a_a13xA. Lens (Function a_aNDR) (Function a_a13xA) (PreFunction a_aNDR) (PreFunction a_a13xA)
+ Language.ATS: preF :: forall a_aRSK a_a185n. Lens (Function a_aRSK) (Function a_a185n) (PreFunction a_aRSK) (PreFunction a_a185n)
- Language.ATS: typeCall :: forall a_aNE7. Traversal' (Type a_aNE7) (Name a_aNE7)
+ Language.ATS: typeCall :: forall a_aRT0. Traversal' (Type a_aRT0) (Name a_aRT0)
- Language.ATS: typeCallArgs :: forall a_aNE7. Traversal' (Type a_aNE7) [Type a_aNE7]
+ Language.ATS: typeCallArgs :: forall a_aRT0. Traversal' (Type a_aRT0) [Type a_aRT0]
Files
- bench/Bench.hs +4/−4
- language-ats.cabal +2/−4
- src/Language/ATS.hs +1/−1
- src/Language/ATS/Parser.y +12/−12
- src/Language/ATS/PrettyPrint.hs +1/−1
- src/Language/ATS/Types.hs +2/−4
bench/Bench.hs view
@@ -8,11 +8,11 @@ defaultMain [ env envFiles $ \ ~(l, m) -> bgroup "format" [ bench "lexATS (large)" $ nf lexATS l- , bench "parseATS . lexATS (large)" $ nf parse l- , bench "printATS . parseATS . lexATS (large)" $ nf (fmap printATS . parse) l+ , bench "parse (large)" $ nf parse l+ , bench "fmap printATS . parse (large)" $ nf (fmap printATS . parse) l , bench "lexATS (medium)" $ nf lexATS m- , bench "parseATS . lexATS (medium)" $ nf parse m- , bench "printATS . parseATS . lexATS (medium)" $ nf (fmap printATS . parse) m+ , bench "parse (medium)" $ nf parse m+ , bench "fmap printATS . parse (medium)" $ nf (fmap printATS . parse) m ] ] where large = readFile "test/data/polyglot.dats"
language-ats.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: language-ats-version: 1.2.0.1+version: 1.2.0.2 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale@@ -42,14 +42,12 @@ build-depends: base >=4.10 && <5, array -any,- microlens -any,- microlens-th -any,+ lens -any, deepseq -any, ansi-wl-pprint >=0.6.8, recursion-schemes >=5.0.1, composition-prelude -any, containers -any,- mtl -any, transformers -any if flag(development)
src/Language/ATS.hs view
@@ -59,6 +59,7 @@ , typeCallArgs ) where +import Control.Lens import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.State@@ -67,7 +68,6 @@ import Language.ATS.Parser import Language.ATS.PrettyPrint import Language.ATS.Types-import Lens.Micro import Text.PrettyPrint.ANSI.Leijen hiding ((<$>)) rewriteATS' :: Eq a => (ATS a, FixityState a) -> ATS a
src/Language/ATS/Parser.y view
@@ -21,13 +21,13 @@ , get_staload ) +import Control.Composition+import Control.DeepSeq (NFData)+import Control.Lens (over, _head) import qualified Data.Map as M import Control.Monad.Trans.Class import Control.Monad.Trans.State-import Control.Composition import Data.Char (toLower)-import Control.DeepSeq (NFData)-import Lens.Micro (over, _head) import GHC.Generics (Generic) import Prelude import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))@@ -403,6 +403,7 @@ | doubleParens { StaticVoid $1 } | sif StaticExpression then StaticExpression else StaticExpression { Sif $2 $4 $6 } -- TODO separate type for static expressions | identifierSpace { StaticVal (Unqualified $ to_string $1) }+ | identifierSpace StaticExpression { SCall (Unqualified $ to_string $1) [$2] } | Name openParen StaticArgs closeParen { SCall $1 $3 } | identifierSpace openParen StaticArgs closeParen { SCall (Unqualified $ to_string $1) $3 } | StaticExpression semicolon StaticExpression { SPrecede $1 $3 }@@ -665,16 +666,14 @@ | sortdef IdentifierOr eq Sort { SortDef $1 $2 (Left $4) } | sortdef IdentifierOr eq Universal { SortDef $1 $2 (Right $4) } -AndStadef : stadef IdentifierOr SortArgs eq Type { Stadef $2 $3 (Right $5) }- | stadef IdentifierOr SortArgs eq StaticExpression { Stadef $2 $3 (Left $5) }- | stadef Operator SortArgs eq Type { Stadef $2 $3 (Right $5) }- | stadef Operator SortArgs eq StaticExpression { Stadef $2 $3 (Left $5) }- | stadef Operator Comment SortArgs eq StaticExpression { Stadef $2 $4 (Left $6) }- | AndStadef and IdentifierOr SortArgs eq Type { AndD $1 (Stadef $3 $4 (Right $6)) }- | AndStadef and IdentifierOr SortArgs eq StaticExpression { AndD $1 (Stadef $3 $4 (Left $6)) }- | AndStadef and Operator SortArgs eq Type { AndD $1 (Stadef $3 $4 (Right $6)) }- | AndStadef and Operator SortArgs eq StaticExpression { AndD $1 (Stadef $3 $4 (Left $6)) }+StaticDef : eq Type { Right $2 }+ | eq StaticExpression { Left $2 } +AndStadef : stadef IdentifierOr SortArgs StaticDef { Stadef $2 $3 $4 }+ | stadef Operator SortArgs StaticDef { Stadef $2 $3 $4 }+ | AndStadef and IdentifierOr SortArgs StaticDef { AndD $1 (Stadef $3 $4 $5) }+ | AndStadef and Operator SortArgs StaticDef { AndD $1 (Stadef $3 $4 $5) }+ StafunDecl : prfun PreFunction { Func $1 (PrFun $2) } | prfn PreFunction { Func $1 (PrFn $2) } @@ -787,6 +786,7 @@ | doubleBrackets { "<>" } | neq { "!=" } | backslash identifierSpace { '\\' : to_string $2 }+ | Operator Comment { $1 } Operators : Operator { [$1] } | Operators Operator { $2 : $1 }
src/Language/ATS/PrettyPrint.hs view
@@ -15,9 +15,9 @@ ) where import Control.Composition hiding ((&))+import Control.Lens hiding (op, pre) import Data.Functor.Foldable (cata) import Language.ATS.Types-import Lens.Micro import Prelude hiding ((<$>)) import Text.PrettyPrint.ANSI.Leijen hiding (bool)
src/Language/ATS/Types.hs view
@@ -48,7 +48,6 @@ , DataSortLeaf (..) , FixityState -- * Rewrites- , rewriteATS , rewriteDecl -- * Helper functions , defaultFixityState@@ -65,6 +64,7 @@ import Control.Composition import Control.DeepSeq (NFData)+import Control.Lens import Data.Function (on) import Data.Functor.Foldable (ListF (Cons), ana, cata, embed, project) import Data.Functor.Foldable.TH (makeBaseFunctor)@@ -73,8 +73,6 @@ import Data.Semigroup (Semigroup) import GHC.Generics (Generic) import Language.ATS.Lexer (Addendum (..))-import Lens.Micro-import Lens.Micro.TH type Fix = Either Int String @@ -106,7 +104,7 @@ | AndDecl { andT :: Maybe (Type a), andPat :: Pattern a, _andExpr :: Expression a } | Include String | Load { static :: Bool, withOctothorpe :: Bool, qualName :: Maybe String, fileName :: String }- | Stadef String (SortArgs a) (Either (StaticExpression a) (Type a))+ | Stadef String (SortArgs a) (Either (StaticExpression a) (Type a)) -- TODO (StaticExpression a, Maybe (Type a)) | CBlock String | TypeDef a String (SortArgs a) (Type a) | ViewTypeDef a String (SortArgs a) (Type a)