pcmt-config-schema/validate.dhall

28 lines
799 B
Haskell
Raw Normal View History

2023-05-06 01:24:31 +02:00
let Prelude =
{- this will have to get bumped when prelude is updated -}
./prelude.dhall
sha256:a6036bc38d883450598d1de7c98ead113196fe2db02e9733855668b18096f07b
let Schema =
./schema.dhall
2023-05-13 21:49:50 +02:00
sha256:0695554541b911bb3ee4b3605ba01df4caab6533da0d4fd32e9d774c41d19d01
2023-05-06 01:24:31 +02:00
? ./schema.dhall
let Schema/validate
: Schema.Type -> Type
=
-- | define validation.
\(c : Schema.Type) ->
let expected = { validPort = True }
let actual =
{ validPort =
-- | make sure port number belongs to the <1;65535> range.
Prelude.Natural.lessThanEqual 1 c.Port
&& Prelude.Natural.lessThanEqual c.Port 65535
}
in expected === actual
in Schema/validate