Skip to content

Instantly share code, notes, and snippets.

@theideasmith
Last active December 30, 2021 00:15
Show Gist options
  • Save theideasmith/277ccf0d8d2159c6d3cf3610599a7124 to your computer and use it in GitHub Desktop.
Save theideasmith/277ccf0d8d2159c6d3cf3610599a7124 to your computer and use it in GitHub Desktop.
Demonstrating symbolic structure of Halachot
data MishkanCategory = Zorea | Choresh | Kotzer | Meamer | Dash | Zoreh | Borer | Tochen | Meraked | Losh | Bishul | Gozez | Malben | Minaphetz | Tzovea | Toveh | Misach | Oreg | Potzea | Koysher | Matir | Tofer | Korea | Tzad | Shochet | Maphshit | Miabid | Mimachek | Misartet | Michatech | Kotev | Mochek | Boneh | Soter | Michabeh | Mavir | Makeh | Hotzaah
data Tozah = MishkanCategory | None
data Peulah = MishkanCategory | None
data Maaseh = Maaseh Peulah Tozah
type Action = MishkanCategory
data Chayav = Chayav Action
data Assur = Assur Action
data Ruling = Chayav Action | Assur Action | Patur
rule :: Maaseh -> Ruling
rule (Maaseh None None) = Patur
rule (Maaseh MishkanCategory None) = Assur
rule (Maaseh None MishkanCategory) = Assur
rule (Melacha action result)
| action == result = (Chayav action) -- If the chiyuv and issur match then you are chayav for the action
| otherwise = (Assur action) -- If the chiyuv and the issur do not match you are then not chayav on the action but it is prohibited according to rabbis. It is impossible to produce this possibility so it exists in logical space only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment