Skip to content

Instantly share code, notes, and snippets.

@anttih

anttih/init.lua Secret

Created Mar 9, 2021
Embed
What would you like to do?
local testArray = Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("singleton should construct an array with a single value"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.singleton(1))({1}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqString))(Data_Array.singleton("foo"))({"foo"}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.singleton(__gen_1_nil))({{}})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("range should create an inclusive array of integers for the specified start and end"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.range(0)(5))({0, 1, 2, 3, 4, 5}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.range(2)(Data_Ring.negate(Data_Ring.ringInt)(3)))({2, 1, 0, Data_Ring.negate(Data_Ring.ringInt)(1), Data_Ring.negate(Data_Ring.ringInt)(2), Data_Ring.negate(Data_Ring.ringInt)(3)})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("replicate should produce an array containg an item a specified number of times"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqBoolean))(Data_Array.replicate(3)(true))({true, true, true}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqString))(Data_Array.replicate(1)("foo"))({"foo"}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqString))(Data_Array.replicate(0)("foo"))({}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqString))(Data_Array.replicate(Data_Ring.negate(Data_Ring.ringInt)(1))("foo"))({})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("replicateA should perform the monadic action the correct number of times"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Unfoldable.replicateA(Data_Maybe.applicativeMaybe)(Data_Unfoldable.unfoldableArray)(Data_Traversable.traversableArray)(3)(Data_Maybe.Just(1)))(Data_Maybe.Just({1, 1, 1})), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Unfoldable.replicateA(Data_Maybe.applicativeMaybe)(Data_Unfoldable.unfoldableArray)(Data_Traversable.traversableArray)(1)(Data_Maybe.Just(1)))(Data_Maybe.Just({1})), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Unfoldable.replicateA(Data_Maybe.applicativeMaybe)(Data_Unfoldable.unfoldableArray)(Data_Traversable.traversableArray)(0)(Data_Maybe.Just(1)))(Data_Maybe.Just({})), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Unfoldable.replicateA(Data_Maybe.applicativeMaybe)(Data_Unfoldable.unfoldableArray)(Data_Traversable.traversableArray)(Data_Ring.negate(Data_Ring.ringInt)(1))(Data_Maybe.Just(1)))(Data_Maybe.Just({}))}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("replicateA should be stack safe"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Foldable.for_(Effect.applicativeEffect)(Data_Foldable.foldableArray)({1, 1000, 2000, 20000, 50000})(function (n)
return Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqUnit)))(Data_Unfoldable.replicateA(Data_Maybe.applicativeMaybe)(Data_Unfoldable.unfoldableArray)(Data_Traversable.traversableArray)(n)(Data_Maybe.Just(Data_Unit.unit)))(Data_Maybe.Just(Data_Array.replicate(n)(Data_Unit.unit))))
end))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("null should return false for non-empty arrays"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Array.null({1}) == false, Data_Array.null({1, 2, 3}) == false}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("null should return true for an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Array.null(__gen_1_nil) == true))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("length should return the number of items in an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqInt)(Data_Array.length(__gen_1_nil))(0), Data_Eq.eq(Data_Eq.eqInt)(Data_Array.length({1}))(1), Data_Eq.eq(Data_Eq.eqInt)(Data_Array.length({1, 2, 3, 4, 5}))(5)}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("cons should add an item to the start of an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.cons(4)({1, 2, 3}))({4, 1, 2, 3}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.cons(1)(__gen_1_nil))({1})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("snoc should add an item to the end of an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.snoc({1, 2, 3})(4))({1, 2, 3, 4}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.snoc(__gen_1_nil)(1))({1})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("insert should add an item at the appropriate place in a sorted array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqNumber))(Data_Array.insert(Data_Ord.ordNumber)(1.5)({1.0, 2.0, 3.0}))({1.0, 1.5, 2.0, 3.0}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.insert(Data_Ord.ordInt)(4)({1, 2, 3}))({1, 2, 3, 4}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.insert(Data_Ord.ordInt)(0)({1, 2, 3}))({0, 1, 2, 3})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("insertBy should add an item at the appropriate place in a sorted array using the specified comparison"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqNumber))(Data_Array.insertBy(Data_Function.flip(Data_Ord.compare(Data_Ord.ordNumber)))(1.5)({1.0, 2.0, 3.0}))({1.0, 2.0, 3.0, 1.5}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.insertBy(Data_Function.flip(Data_Ord.compare(Data_Ord.ordInt)))(4)({1, 2, 3}))({4, 1, 2, 3}), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(Data_Array.insertBy(Data_Function.flip(Data_Ord.compare(Data_Ord.ordInt)))(0)({1, 2, 3}))({1, 2, 3, 0})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("head should return a Just-wrapped first value of a non-empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqString))(Data_Array.head({"foo", "bar"}))(Data_Maybe.Just("foo"))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("head should return Nothing for an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.head(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("last should return a Just-wrapped last value of a non-empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqString))(Data_Array.last({"foo", "bar"}))(Data_Maybe.Just("bar"))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("last should return Nothing for an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.last(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("tail should return a Just-wrapped array containing all the items in an array apart from the first for a non-empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqString)))(Data_Array.tail({"foo", "bar", "baz"}))(Data_Maybe.Just({"bar", "baz"}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("tail should return Nothing for an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.tail(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("init should return a Just-wrapped array containing all the items in an array apart from the first for a non-empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqString)))(Data_Array.init({"foo", "bar", "baz"}))(Data_Maybe.Just({"foo", "bar"}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("init should return Nothing for an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.init(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("uncons should return nothing when used on an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Maybe.isNothing(Data_Array.uncons(__gen_1_nil))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("uncons should split an array into a head and tail record when there is at least one item"))(function (__unused)
local u1 = Data_Function.apply(Partial_Unsafe.unsafePartial)(function (dictPartial)
return Data_Function.apply(Data_Maybe.fromJust(nil))(Data_Array.uncons({1}))
end)
return (function ()
local u2 = Data_Function.apply(Partial_Unsafe.unsafePartial)(function (dictPartial)
return Data_Function.apply(Data_Maybe.fromJust(nil))(Data_Array.uncons({1, 2, 3}))
end)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqInt)(u1.head)(1), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(u1.tail)({}), Data_Eq.eq(Data_Eq.eqInt)(u2.head)(1), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(u2.tail)({2, 3})}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("unsnoc should return nothing when used on an empty array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Maybe.isNothing(Data_Array.unsnoc(__gen_1_nil))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("unsnoc should split an array into an init and last record when there is at least one item"))(function (__unused)
local u3 = Data_Function.apply(Partial_Unsafe.unsafePartial)(function (dictPartial)
return Data_Function.apply(Data_Maybe.fromJust(nil))(Data_Array.unsnoc({1}))
end)
return (function ()
local u4 = Data_Function.apply(Partial_Unsafe.unsafePartial)(function (dictPartial)
return Data_Function.apply(Data_Maybe.fromJust(nil))(Data_Array.unsnoc({1, 2, 3}))
end)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(u3.init)({}), Data_Eq.eq(Data_Eq.eqInt)(u3.last)(1), Data_Eq.eq(Data_Eq.eqArray(Data_Eq.eqInt))(u4.init)({1, 2}), Data_Eq.eq(Data_Eq.eqInt)(u4.last)(3)}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("(!!) should return Just x when the index is within the bounds of the array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.index({1, 2, 3})(0))(Data_Maybe.Just(1)), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.index({1, 2, 3})(1))(Data_Maybe.Just(2)), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.index({1, 2, 3})(2))(Data_Maybe.Just(3))}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("(!!) should return Nothing when the index is outside of the bounds of the array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.index({1, 2, 3})(6))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.index({1, 2, 3})(Data_Ring.negate(Data_Ring.ringInt)(1)))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("elemIndex should return the index of an item that a predicate returns true for in an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.elemIndex(Data_Eq.eqInt)(1)({1, 2, 1}))(Data_Maybe.Just(0))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.elemIndex(Data_Eq.eqInt)(4)({1, 2, 1}))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("elemLastIndex should return the last index of an item in an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.elemLastIndex(Data_Eq.eqInt)(1)({1, 2, 1}))(Data_Maybe.Just(2))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.elemLastIndex(Data_Eq.eqInt)(4)({1, 2, 1}))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("findIndex should return the index of an item that a predicate returns true for in an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.findIndex(function (v)
return Data_Eq.notEq(Data_Eq.eqInt)(v)(1)
end)({1, 2, 1}))(Data_Maybe.Just(1))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.findIndex(function (v)
return Data_Eq.eq(Data_Eq.eqInt)(v)(3)
end)({1, 2, 1}))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("findLastIndex should return the last index of an item in an array"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.findLastIndex(function (v)
return Data_Eq.notEq(Data_Eq.eqInt)(v)(1)
end)({2, 1, 2}))(Data_Maybe.Just(2))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqInt))(Data_Array.findLastIndex(function (v)
return Data_Eq.eq(Data_Eq.eqInt)(v)(3)
end)({2, 1, 2}))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("insertAt should add an item at the specified index"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(assertAll({Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.insertAt(0)(1)({2, 3}))(Data_Maybe.Just({1, 2, 3})), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.insertAt(1)(1)({2, 3}))(Data_Maybe.Just({2, 1, 3})), Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.insertAt(2)(1)({2, 3}))(Data_Maybe.Just({2, 3, 1}))}))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("insertAt should return Nothing if the index is out of A.range"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.insertAt(2)(1)(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("deleteAt should remove an item at the specified index"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.deleteAt(0)({1, 2, 3}))(Data_Maybe.Just({2, 3}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.deleteAt(1)({1, 2, 3}))(Data_Maybe.Just({1, 3}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("deleteAt should return Nothing if the index is out of A.range"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.deleteAt(1)(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("updateAt should replace an item at the specified index"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.updateAt(0)(9)({1, 2, 3}))(Data_Maybe.Just({9, 2, 3}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.updateAt(1)(9)({1, 2, 3}))(Data_Maybe.Just({1, 9, 3}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("updateAt should return Nothing if the index is out of A.range"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.updateAt(1)(9)(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("modifyAt should update an item at the specified index"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.modifyAt(0)(function (v)
return Data_Semiring.add(Data_Semiring.semiringInt)(v)(1)
end)({1, 2, 3}))(Data_Maybe.Just({2, 2, 3}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.modifyAt(1)(function (v)
return Data_Semiring.add(Data_Semiring.semiringInt)(v)(1)
end)({1, 2, 3}))(Data_Maybe.Just({1, 3, 3}))))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Effect_Console.log("modifyAt should return Nothing if the index is out of A.range"))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(Data_Function.apply(Test_Assert.assert)(Data_Eq.eq(Data_Maybe.eqMaybe(Data_Eq.eqArray(Data_Eq.eqInt)))(Data_Array.modifyAt(1)(function (v)
return Data_Semiring.add(Data_Semiring.semiringInt)(v)(1)
end)(__gen_1_nil))(Data_Maybe.Nothing)))(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(testAlterAt)(function (__unused)
return Control_Bind.discard(Control_Bind.discardUnit)(Effect.bindEffect)(testSorting)(function (__unused)
return testGrouping
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)()
end)
end)
end)
end)
end)()
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment