-
Notifications
You must be signed in to change notification settings - Fork 11
/
Main.purs
51 lines (45 loc) · 1.54 KB
/
Main.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module Test.Main where
import Prelude
import Data.Align (class Crosswalk)
import Data.List (List)
import Data.Maybe (Maybe)
import Effect (Effect)
import Effect.Console (log)
import Test.QuickCheck.Arbitrary (class Arbitrary)
import Test.QuickCheck.Laws (A)
import Test.QuickCheck.Laws.Control.Align (checkAlign)
import Test.QuickCheck.Laws.Control.Alignable (checkAlignable)
import Test.QuickCheck.Laws.Control.Crosswalk (checkCrosswalk)
import Type.Proxy (Proxy(..))
runCrosswalkChecksFor
:: forall f
. Crosswalk f
=> Arbitrary (f A)
=> Eq (f A)
=> Proxy f
-> String
-> Effect Unit
runCrosswalkChecksFor p name = do
log $ "Check Crosswalk instance for " <> name <> "/Array"
checkCrosswalk p (Proxy :: _ Array)
log $ "Check Crosswalk instance for " <> name <> "/Maybe"
checkCrosswalk p (Proxy :: _ Maybe)
log $ "Check Crosswalk instance for " <> name <> "/List"
checkCrosswalk p (Proxy :: _ List)
main :: Effect Unit
main = do
log "Checking Align instance for Array"
checkAlign (Proxy :: _ Array)
log "Checking Align instance for List"
checkAlign (Proxy :: _ List)
log "Checking Align instance for Maybe"
checkAlign (Proxy :: _ Maybe)
log "Check Alignable instance for Array"
checkAlignable (Proxy :: _ Array)
log "Checking Alignable instance for List"
checkAlignable (Proxy :: _ List)
log "Checking Alignable instance for Maybe"
checkAlignable (Proxy :: _ Maybe)
runCrosswalkChecksFor (Proxy :: _ Array) "Array"
runCrosswalkChecksFor (Proxy :: _ Maybe) "Maybe"
runCrosswalkChecksFor (Proxy :: _ List) "List"