Skip to content
Subhajit Sahu edited this page Mar 24, 2021 · 6 revisions

Counts no. of true values. 📰 📘

Can be used to implement one-hot / one-cold detector.


count[n] a b ...
-- a: 1st boolean
-- b: 2nd boolean
import Boolean exposing (..)

count True True
-- 2   ^    ^

count True False
-- 1   ^

count4 True True True False
-- 3    ^    ^    ^

count4 False True False False
-- 1          ^


References

Clone this wiki locally