This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait Semigroup { | |
| type A; | |
| fn append(_: Self::A, _: Self::A) -> Self::A; | |
| } | |
| trait Monoid { | |
| type A: Semigroup; | |
| fn empty() -> Self::A; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [package] | |
| name = "ping" | |
| version = "0.1.0" | |
| edition = "2021" | |
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
| [dependencies] | |
| bevy = {version = "0.12",features = ["asset_processor", "basis-universal"]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[derive(Debug)] | |
| pub enum Tree<T, U> { | |
| Leaf(T), | |
| Node(Box<Tree<T, U>>, U, Box<Tree<T, U>>), | |
| } | |
| pub trait Op<T> { | |
| fn apply(&self, x: T, y: T) -> T; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [package] | |
| name = "lambda_calculus" | |
| version = "0.1.0" | |
| edition = "2021" | |
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
| [dependencies] | |
| nom = "7.1.3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Data.Json (Json(..), JsonValue(..)) where | |
| import Prelude | |
| import Data.String (joinWith) | |
| import Data.Tuple (Tuple(..)) | |
| data JsonValue | |
| = JsonString String | |
| | JsonNumber Number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- A game with two players. Player 1 thinks of a secret word | |
| -- and uses its hash, and the game validator script, to lock | |
| -- some funds (the prize) in a pay-to-script transaction output. | |
| -- Player 2 guesses the word by attempting to spend the transaction | |
| -- output. If the guess is correct, the validator script releases the funds. | |
| -- If it isn't, the funds stay locked. | |
| import Control.Monad (void) | |
| import Data.ByteString.Char8 qualified as C | |
| import Data.Map (Map) | |
| import Data.Map qualified as Map |