language-ats 1.2.0.4 → 1.2.0.5
raw patch · 5 files changed
+15/−5 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Language.ATS: BoxTuple :: a -> [Type a] -> Type a
+ Language.ATS: BoxTupleEx :: a -> [Expression a] -> Expression a
- Language.ATS: constructorUniversals :: forall a_aNNV. Lens' (Leaf a_aNNV) [Universal a_aNNV]
+ Language.ATS: constructorUniversals :: forall a_aNNZ. Lens' (Leaf a_aNNZ) [Universal a_aNNZ]
- Language.ATS: expression :: forall a_aNNy. Lens' (PreFunction a_aNNy) (Maybe (Expression a_aNNy))
+ Language.ATS: expression :: forall a_aNNC. Lens' (PreFunction a_aNNC) (Maybe (Expression a_aNNC))
- Language.ATS: fun :: forall a_aNNT. Traversal' (Declaration a_aNNT) (Function a_aNNT)
+ Language.ATS: fun :: forall a_aNNX. Traversal' (Declaration a_aNNX) (Function a_aNNX)
- Language.ATS: leaves :: forall a_aNNT. Traversal' (Declaration a_aNNT) [Leaf a_aNNT]
+ Language.ATS: leaves :: forall a_aNNX. Traversal' (Declaration a_aNNX) [Leaf a_aNNX]
- Language.ATS: preF :: forall a_aNNA a_a13SD. Lens (Function a_aNNA) (Function a_a13SD) (PreFunction a_aNNA) (PreFunction a_a13SD)
+ Language.ATS: preF :: forall a_aNNE a_a141X. Lens (Function a_aNNE) (Function a_a141X) (PreFunction a_aNNE) (PreFunction a_a141X)
- Language.ATS: typeCall :: forall a_aNNQ. Traversal' (Type a_aNNQ) (Name a_aNNQ)
+ Language.ATS: typeCall :: forall a_aNNU. Traversal' (Type a_aNNU) (Name a_aNNU)
- Language.ATS: typeCallArgs :: forall a_aNNQ. Traversal' (Type a_aNNQ) [Type a_aNNQ]
+ Language.ATS: typeCallArgs :: forall a_aNNU. Traversal' (Type a_aNNU) [Type a_aNNU]
Files
- language-ats.cabal +1/−1
- src/Language/ATS/Lexer.x +1/−1
- src/Language/ATS/Parser.y +7/−1
- src/Language/ATS/PrettyPrint.hs +3/−1
- src/Language/ATS/Types.hs +3/−1
language-ats.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: language-ats-version: 1.2.0.4+version: 1.2.0.5 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2018 Vanessa McHale
src/Language/ATS/Lexer.x view
@@ -244,7 +244,7 @@ <0> exception { tok (\p _ -> alex $ Keyword p KwException) } <0> "$list_vt" { tok (\p _ -> alex $ Keyword p (KwListLit "_vt")) } <0> "$list" { tok (\p _ -> alex $ Keyword p (KwListLit mempty)) }- <0> "fold@" { tok (\p s -> alex $ IdentifierSpace p s) }+ <0> "fold@" { tok (\p s -> alex $ Identifier p s) } <0> "free@" { tok (\p s -> alex $ Identifier p s) } <0> @fixity_decl { tok (\p s -> alex $ FixityTok p s) }
src/Language/ATS/Parser.y view
@@ -146,6 +146,7 @@ identifierSpace { $$@IdentifierSpace{} } closeParen { Special $$ ")" } openParen { Special $$ "(" }+ boxTuple { Special $$ "'(" } colon { SignatureTok $$ "" } signature { SignatureTok _ $$ } comma { Special $$ "," }@@ -282,6 +283,8 @@ | identifierSpace identifier { Dependent (Unqualified $ to_string $1) [Named (Unqualified $ to_string $2)] } | openParen TypeIn closeParen { Tuple $1 $2 } | openParen TypeIn closeParen lineComment { Tuple $1 $2 }+ | boxTuple TypeIn closeParen { BoxTuple $1 $2 }+ | boxTuple TypeIn closeParen lineComment { BoxTuple $1 $2 } | openParen Type closeParen { ParenType $1 $2 } | openParen TypeIn rbrace {% left $ Expected $3 ")" "}" } | doubleParens { NoneType $1 }@@ -439,6 +442,7 @@ | Literal { $1 } | Call { $1 } | openParen Tuple closeParen { TupleEx $1 $2 }+ | boxTuple Tuple closeParen { BoxTupleEx $1 $2 } | case Expression of Case { Case $3 $1 $2 $4 } | ifcase IfCase { IfCase $1 $2 } | openParen Expression closeParen { ParenExpr $1 $2 }@@ -452,6 +456,7 @@ | let ATS comment_after(in) end { Let $1 $2 Nothing } | let ATS in Expression end { Let $1 $2 (Just $4) } | let ATS in Expression vbar {% left $ Expected $5 "end" "|" }+ | let ATS fun {% left $ Expected $3 "in" "fun" } | lambda Pattern LambdaArrow Expression { Lambda $1 $3 $2 $4 } | llambda Pattern LambdaArrow Expression { LinearLambda $1 $3 $2 $4 } | addrAt PreExpression { AddrAt $1 $2 }@@ -888,7 +893,8 @@ | overload BinOp with identifierSpace of intLit { OverloadOp $1 $2 (Unqualified $ to_string $4) (Just $6) } | overload identifierSpace with Name { OverloadIdent $1 (to_string $2) $4 Nothing } | overload identifierSpace with identifierSpace of intLit { OverloadIdent $1 (to_string $2) (Unqualified $ to_string $4) (Just $6) }- | overload tilde with identifierSpace of intLit { OverloadIdent $1 "~" (Unqualified $ to_string $4) (Just $6) } -- FIXME figure out a general solution.+ | overload tilde with identifier { OverloadIdent $1 "~" (Unqualified $ to_string $4) Nothing } -- FIXME figure out a general solution.+ | overload tilde with identifierSpace of intLit { OverloadIdent $1 "~" (Unqualified $ to_string $4) (Just $6) } | overload lsqbracket rsqbracket with identifierSpace of intLit { OverloadIdent $1 "[]" (Unqualified $ to_string $5) (Just $7) } | overload dot identifierSpace with Name { OverloadIdent $1 ('.' : (to_string $3)) $5 Nothing } | assume identifierSpace eq Type { Assume (Unqualified (to_string $2)) [NoArgs] $4 }
src/Language/ATS/PrettyPrint.hs view
@@ -165,6 +165,7 @@ a (TypeSignatureF e t) = e <+> ":" <+> pretty t a (WhereExpF e d) = e <+> "where" <$> braces (" " <> nest 2 (pretty d) <> " ") a (TupleExF _ es) = parens (mconcat $ punctuate ", " (reverse es))+ a (BoxTupleExF _ es) = "'(" <> mconcat (punctuate ", " (reverse es)) <> ")" a (WhileF _ e e') = "while" <> parens e <> e' a (ActionsF as) = "{" <$> indent 2 (pretty as) <$> "}" a UnderscoreLitF{} = "_"@@ -266,7 +267,7 @@ a (NamedF n) = pretty n a (ViewTypeF _ t) = "view@" <> parens t a (ExF e (Just t))- | head (show t) == '[' = pretty e <> t -- FIXME this is a hack+ | head (show t) == '[' = pretty e <> t -- FIXME this is kinda dumb | otherwise = pretty e <+> t a (ExF e Nothing) = pretty e a (DependentF n@SpecialName{} [t]) = pretty n <+> pretty t@@ -282,6 +283,7 @@ a (ProofTypeF _ t t') = parens (prettyArgsG "" "" t <+> "|" <+> t') a (ConcreteTypeF e) = pretty e a (TupleF _ ts) = parens (mconcat (punctuate ", " (fmap pretty (reverse ts))))+ a (BoxTupleF _ ts) = "'(" <> mconcat (punctuate ", " (fmap pretty (reverse ts))) <> ")" a (RefTypeF t) = "&" <> t a (FunctionTypeF s t t') = t <+> string s <+> t' a (ViewLiteralF c) = "view" <> pretty c
src/Language/ATS/Types.hs view
@@ -148,6 +148,7 @@ -- | A type for parsed ATS types data Type a = Tuple a [Type a]+ | BoxTuple a [Type a] | Named (Name a) | Ex (Existential a) (Maybe (Type a)) | ForA (Universal a) (Type a)@@ -314,7 +315,8 @@ | ProofExpr a (Expression a) (Expression a) | TypeSignature (Expression a) (Type a) | WhereExp (Expression a) (ATS a)- | TupleEx a [Expression a] -- TODO support boxed tuples+ | TupleEx a [Expression a]+ | BoxTupleEx a [Expression a] | While a (Expression a) (Expression a) | Actions (ATS a) | Begin a (Expression a)