Skip to content

Commit 7414eba

Browse files
copilot-libraries: Remove deprecated function Copilot.Library.Utils.(!!). Refs #599.
The function `copilot-libraries:Copilot.Library.Utils.(!!)` was deprecated due to the introduction of a new, common interface to interact with structures and arrays. The original function was deprecated in Copilot 4 and no messages have been received requesting that it be kept in this library. Per our internal policy of waiting 3 versions from deprecation until a public interface declaration can be removed, this function can now be removed. This commit removes the function `copilot-libraries:Copilot.Library.Utils.(!!)`, and adjusts any imports that were hiding either the same function or equally named functions to avoid clashes, since they would no longer occur.
1 parent 83086bf commit 7414eba

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

copilot-libraries/src/Copilot/Library/Libraries.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ import Copilot.Library.LTL
2323
import Copilot.Library.PTLTL
2424
import Copilot.Library.Statistics
2525
import Copilot.Library.RegExp
26-
import Copilot.Library.Utils hiding ((!!))
26+
import Copilot.Library.Utils
2727
import Copilot.Library.Voting
2828
import Copilot.Library.Stacks

copilot-libraries/src/Copilot/Library/Utils.hs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ module Copilot.Library.Utils
1313
-- ** Scans
1414
nscanl, nscanr, nscanl1, nscanr1,
1515
-- ** Indexing
16-
case', (!!), (!!!))
16+
case', (!!!))
1717
where
1818

19-
import Copilot.Language hiding ((!!))
19+
import Copilot.Language
2020
import qualified Prelude as P
2121

2222
-- | Given a stream, produce an infinite list of streams dropping an increasing
@@ -131,13 +131,6 @@ case' predicates alternatives =
131131
P.++ "greater by one than the length of predicates list"
132132
in case'' predicates alternatives
133133

134-
-- | Index.
135-
--
136-
-- WARNING: Very expensive! Consider using this only for very short lists.
137-
(!!) :: (Typed a, Eq b, Num b, Typed b) => [Stream a] -> Stream b -> Stream a
138-
(!!) = (!!!)
139-
{-# DEPRECATED (!!) "This function is deprecated in Copilot 4. Use (!!!)." #-}
140-
141134
-- | Index.
142135
--
143136
-- WARNING: Very expensive! Consider using this only for very short lists.

0 commit comments

Comments
 (0)