on master help sign in
Remove long-deprecated `abstract`
commit0cfc98cf79aebfd8a0b70e6679049b92167bfdb5 authorJason Felice <jason.m.felice@gmail.com> dateMon 4 Dec 2017, 13:31 (9 years ago) parenta2e981e
3 files changed+7−12
CHANGELOG.md+1 samples/tutorial/BTreeMod.idr+5−5 src/Idris/Parser/Helpers.hs+1−7
CHANGELOG.md+1
@@ -31,6 +31,7 @@
3131 intMax : IO Int
3232 intMax = foreign FFI_C "#INT_MAX" (IO Int)
3333 ```
34++ The deprecated `abstract` keyword has been removed.
3435
3536## Library Updates
3637
samples/tutorial/BTreeMod.idr+5−5
@@ -1,20 +1,20 @@
11module btree
22
3−abstract data BTree a = Leaf
4− | Node (BTree a) a (BTree a)
3+export data BTree a = Leaf
4+ | Node (BTree a) a (BTree a)
55
6−abstract
6+export
77insert : Ord a => a -> BTree a -> BTree a
88insert x Leaf = Node Leaf x Leaf
99insert x (Node l v r) = if (x < v) then (Node (insert x l) v r)
1010 else (Node l v (insert x r))
1111
12−abstract
12+export
1313toList : BTree a -> List a
1414toList Leaf = []
1515toList (Node l v r) = btree.toList l ++ (v :: btree.toList r)
1616
17−abstract
17+export
1818toTree : Ord a => List a -> BTree a
1919toTree [] = Leaf
2020toTree (x :: xs) = insert x (toTree xs)
src/Idris/Parser/Helpers.hs+1−7
@@ -260,7 +260,7 @@ float = token . P.try $ P.float
260260reservedIdentifiers :: HS.HashSet String
261261reservedIdentifiers = HS.fromList
262262 [ "Type"
263− , "abstract", "case", "class", "codata", "constructor", "corecord", "data"
263+ , "case", "class", "codata", "constructor", "corecord", "data"
264264 , "do", "dsl", "else", "export", "if", "implementation", "implicit"
265265 , "import", "impossible", "in", "infix", "infixl", "infixr", "instance"
266266 , "interface", "let", "mutual", "namespace", "of", "parameters", "partial"
@@ -531,12 +531,6 @@ accessibility'
531531 (fc, Msg "'public' is deprecated. Use 'public export' instead.")
532532 : parserWarnings ist }
533533 return Public
534− <|> do fc <- extent $ reserved "abstract"
535− ist <- get
536− put ist { parserWarnings =
537− (fc, Msg "The 'abstract' keyword is deprecated. Use 'export' instead.")
538− : parserWarnings ist }
539− return Frozen
540534 <|> do reserved "export"; return Frozen
541535 <|> do reserved "private"; return Private
542536 <?> "accessibility modifier"