~/bend-docscommunity

src/rules/laws/closed.bend checks

raw source on the hub · import 0x013e0f9a479bbebad5ed196725eede95/src/rules/laws/closed.bend as Closed

rule closed: a law in a LAWS.bend with no for/exs binder. A law with no binder holds for the one input it names, which makes it a unit test the checker runs, not a guarantee, and that is so for an equality ({lhs == rhs : T}, including IO(T)) as much as for anything else. Nothing exempts a closed law: quantify it, or delete it. Laws outside LAWS.bend are not held to it.

7 imports
import Base
import ../../paths.bend as Paths
import ../../src.bend as Src
import ../../finding.bend as F
import ../../syntax/tree.bend as Tree
import ../../lazy/lazy.bend as Lazy
import ../../syntax/bind.bend as Bind

Definitions

def binds source · line 16 · raw

@body:0x013e0f9a479bbebad5ed196725eede95/src/syntax/tree.Node -> Bool

does a law's body bind anything (a for or exs line)?

def name.of source · line 26 · raw

@mm:Maybe<&2, String> -> String

a law's name, ? when it has none

def check.go source · line 33 · raw

@root:0x013e0f9a479bbebad5ed196725eede95/src/syntax/tree.Node -> @+path:String -> List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/finding.Finding>

def check source · line 47 · raw

@ss:0x013e0f9a479bbebad5ed196725eede95/src/src.Src -> List<&2, 0x013e0f9a479bbebad5ed196725eede95/src/finding.Finding>

the rule