@@ -4,7 +4,7 @@ import Prelude
44
55import Control.Alt ((<|>))
66import Data.Array as A
7- import Data.Array.NonEmpty as NEA
7+ import Data.Array.NonEmpty ( cons' )
88import Data.Foldable (foldl , for_ , all , and )
99import Data.FoldableWithIndex (foldrWithIndex )
1010import Data.Function (on )
@@ -14,7 +14,6 @@ import Data.List.NonEmpty as NEL
1414import Data.Map as M
1515import Data.Map.Gen (genMap )
1616import Data.Maybe (Maybe (..), fromMaybe , maybe )
17- import Data.NonEmpty ((:|))
1817import Data.Tuple (Tuple (..), fst , uncurry )
1918import Effect (Effect )
2019import Effect.Console (log )
@@ -45,7 +44,7 @@ instance showSmallKey :: Show SmallKey where
4544 show J = " J"
4645
4746instance arbSmallKey :: Arbitrary SmallKey where
48- arbitrary = elements $ NEA .fromNonEmpty $ A :| [B , C , D , E , F , G , H , I , J ]
47+ arbitrary = elements $ cons' A [B , C , D , E , F , G , H , I , J ]
4948
5049data Instruction k v = Insert k v | Delete k
5150
@@ -54,7 +53,7 @@ instance showInstruction :: (Show k, Show v) => Show (Instruction k v) where
5453 show (Delete k) = " Delete (" <> show k <> " )"
5554
5655instance arbInstruction :: (Arbitrary k , Arbitrary v ) => Arbitrary (Instruction k v ) where
57- arbitrary = oneOf $ NEA .fromNonEmpty $ (Insert <$> arbitrary <*> arbitrary) :| [Delete <$> arbitrary]
56+ arbitrary = oneOf $ cons' (Insert <$> arbitrary <*> arbitrary) [Delete <$> arbitrary]
5857
5958runInstructions :: forall k v . Ord k => List (Instruction k v ) -> M.Map k v -> M.Map k v
6059runInstructions instrs t0 = foldl step t0 instrs
0 commit comments