Skip to content

Instantly share code, notes, and snippets.

@ggVGc
Created August 1, 2022 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggVGc/c20c3a04d2516b61db5f8a82e875a162 to your computer and use it in GitHub Desktop.
Save ggVGc/c20c3a04d2516b61db5f8a82e875a162 to your computer and use it in GitHub Desktop.
data Def1 = Def1
instance HasDefName Def1 where
getDefName _ = "Def1"
def1_out :: Pin Def1 'NonZeroPos
def1_out = Pin "out"
data Def2 = Def2
def2_inp :: Pin Def2 'Positive
def2_inp = Pin "inp"
instance HasDefName Def2 where
getDefName _ = "Def2"
connectionTest :: SpecWith ()
connectionTest = it "connects quats" $ do
let (a, state) = mkInstance initState Def1
(b, state') = mkInstance state Def2
!(_ref, (_, [conn])) = connect state' (a, def1_out) (b, def2_inp)
conn `shouldBe` (("Def1", "out", 0), ("Def2", "inp", 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment