This file contains 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
use std::{ | |
io::Read, | |
os::unix::net::UnixStream, | |
}; | |
use anyhow::Result; | |
use test_shared::Test; | |
fn main() -> Result<()> { | |
println!("creating stream, connecting..."); |
This file contains 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
use std::{ | |
thread::{ | |
self, | |
Builder, | |
}, | |
time::Duration, | |
}; | |
use midir::{ | |
MidiOutput, |
This file contains 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
{ | |
description = "A very basic flake"; | |
inputs = { | |
fenix = { | |
url = "github:nix-community/fenix"; | |
inputs.nixpkgs.follows = "nixpkgs"; | |
}; | |
nixpkgs = { | |
url = "nixpkgs/nixos-unstable"; |
This file contains 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
const conversions = [ | |
[1000, 'M'], | |
[900, 'CM'], | |
[500, 'D'], | |
[400, 'CD'], | |
[100, 'C'], | |
[90, 'XC'], | |
[50, 'L'], | |
[40, 'XL'], | |
[10, 'X'], |
This file contains 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.NonEmptyArray where | |
import Prelude | |
data NonEmpty a = | |
NonEmpty a (Array a) | |
instance showNonEmpty :: Show a => Show (NonEmpty a) where | |
show (NonEmpty a as) = "NonEmpty: " <> show a <> show as |
This file contains 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
/* | |
Prompted by discussion in the F# Slack, where it was proposed that reducing the use of CEs | |
might help people more easily pick up Freya. | |
Of course, there's no reason why both syntaxes can't be made available if that seems like | |
the right option. | |
The basic freya { ... } CE is a genuine monad, and so would always stay as a CE option (though | |
it can also be expressed using standard combinator operators/named functions already). |
This file contains 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
type Address = | |
{ Street: string | |
Number: int } | |
static member ToJson (x: Address) = | |
json { | |
do! Json.write "street" x.Street | |
do! Json.write "streetNumber" x.Number } | |
type House = |
This file contains 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
open System.IO | |
open Freya.Core | |
open Freya.Core.Operators | |
open Freya.Machines.Http | |
open Freya.Routers.Uri.Template | |
open Freya.Types.Http | |
// Configuration | |
let fileTypes = |
This file contains 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
let record = | |
{ Ages = "24,56,45,10" } | |
(* 56 *) | |
let oldest = | |
Optic.get recordints_ record |> List.max | |
(* { Ages = "25,57,46,11" } *) | |
let record' = | |
Optic.map recordints_ (List.map ((+) 1)) record |
This file contains 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
// Builder | |
type Builder<'a> (operations: BuilderOperations<'a>) = | |
member __.Return _ : 'a = | |
operations.Init () | |
member __.ReturnFrom (c: 'a) : 'a = | |
c |
NewerOlder