@@ -35,26 +35,23 @@ import Data.Quantity (Quantity, (.*), prettyPrint, (⊕), (⊖), (⊗), (⊘),
3535import Data.Quantity as Q
3636import Data.Quantity.Math (sin , asin , pi , modulo , max , min , mean , atan2 )
3737
38- import Control.Monad.Eff (Eff )
39- import Control.Monad.Eff.Console (CONSOLE )
40- import Control.Monad.Aff.AVar (AVAR )
38+ import Effect (Effect )
4139
4240import Math as Math
4341
4442import Test.Unit (Test , suite , test , success , failure )
4543import Test.Unit.Main (runTest )
46- import Test.Unit.Console (TESTOUTPUT )
4744import Test.Unit.Assert (assert , assertFalse , equal )
4845
49- almostEqualNumbers ∷ ∀ e . Number → Number → Test e
46+ almostEqualNumbers ∷ Number → Number → Test
5047almostEqualNumbers x y = do
5148 if x ≅ y
5249 then success
5350 else failure $ " expected " <> show x <> " , got " <> show y
5451
5552-- | Test if two quantities are almost equal, i.e. if the units match and the
5653-- | numerical value is approximately the same.
57- almostEqual ∷ ∀ e . Quantity → Quantity → Test e
54+ almostEqual ∷ Quantity → Quantity → Test
5855almostEqual expected actual = do
5956 if expected `approximatelyEqual` actual
6057 then success
@@ -64,13 +61,13 @@ almostEqual expected actual = do
6461 approximatelyEqual = Q .approximatelyEqual tolerance
6562 tolerance = 1.0e-6
6663
67- almostEqual' ∷ ∀ e err . Quantity → Either err Quantity → Test e
64+ almostEqual' ∷ ∀ err . Quantity → Either err Quantity → Test
6865almostEqual' expected actual =
6966 case actual of
7067 Left _ → failure " Conversion error"
7168 Right actual' → almostEqual expected actual'
7269
73- main ∷ Eff ( console ∷ CONSOLE , testOutput ∷ TESTOUTPUT , avar ∷ AVAR ) Unit
70+ main ∷ Effect Unit
7471main = runTest do
7572 let
7673 meters = meter
0 commit comments