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
open System.Reflection.Emit | |
// The reader monad (note that we use this with mutation!): | |
module Implicit = | |
type Implicitly<'i, 't> = private Implicitly of ('i -> 't) | |
let implicitly = Implicitly | |
let runImplicit impl (Implicitly f) = f impl | |
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
void Main() | |
{ | |
AssertNullChecked(() => new List<int>(null)); | |
} | |
public static void AssertNullChecked(Expression<Action> expr) | |
{ | |
(IReadOnlyCollection<Expression>, IReadOnlyCollection<ParameterInfo>) GetArgumentsAndParameters() | |
{ | |
if (expr.Body is MethodCallExpression callExp) |
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
using System; | |
using System.IdentityModel.Tokens.Jwt; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Text; | |
using Microsoft.IdentityModel.Tokens; | |
namespace JWTTest | |
{ | |
public static class Program | |
{ |
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
// Decompiled with JetBrains decompiler | |
// Type: BefungeProgram | |
// Assembly: BefungeAssembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null | |
// MVID: 65A2B595-E084-42D2-81CC-A4F495D3475C | |
// Assembly location: C:\Users\porges\Documents\Visual Studio 2017\Projects\Befunge\Bege\bill.exe | |
// Compiler-generated code is shown | |
using System.IO; | |
using System.Runtime.InteropServices; |
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
{-# LANGUAGE GADTs, RecordWildCards #-} | |
import Data.Monoid | |
data DFA a r where | |
DFA :: { transition :: a -> Endo s, initial :: s, result :: s -> r } -> DFA a r | |
run :: Foldable f => DFA a r -> f a -> r | |
run DFA{..} input = result (foldMap transition input `appEndo` initial) |
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
open System | |
open System.Diagnostics | |
type InteractionF<'f> = | |
| Get of (string -> 'f) | |
| Put of string * 'f | |
with | |
static member map f = function | |
| Get g -> Get (f << g) | |
| Put (s, g) -> Put (s, f g) |
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
{-# LANGUAGE DeriveFunctor #-} | |
module Main where | |
import Control.Monad | |
import Control.Monad.Free | |
data InteractionF f | |
= Get (String -> f) | |
| Put String f |
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
void Main() | |
{ | |
Channels(); | |
BufferedChannels(); | |
ChannelDirections(); | |
} | |
// Example from: https://gobyexample.com/channels | |
void Channels() | |
{ |
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
"Cheese".StartsWith("C͏ͿԤԥԨԩԪԫԬԭԮԯՠֈ֍֎֏ׯ؝ـ߽߾߿ࡠࡡࡢࡣࡤࡥࡦࡧࡨࡩࡪࡰࡱࡲࡳࡴࡵࡶࡷࡸࡹࡺࡻࡼࡽࡾࡿࢀࢁࢂࢃࢄࢅࢆࢇ࢈ࢉࢊࢋࢌࢍࢎ࢙࢚࢛࢘࢜࢝࢞࢟ࢠࢡࢢࢣࢤࢥࢦࢧࢨࢩࢪࢫࢬࢭࢮࢯࢰࢱࢲࢳࢴࢵࢶࢷࢸࢹࢺࢻࢼࢽࢾࢿࣀࣁࣂࣃࣄࣅࣆࣇࣈࣉࣰࣱࣲ࣏࣐࣑࣒࣓ࣣࣦࣩ࣭࣮࣯ࣶࣹࣺ࣊࣋࣌࣍࣎ࣔࣕࣖࣗࣘࣙࣚࣛࣜࣝࣞࣟ࣠࣡ࣤࣥࣧࣨ࣪࣫࣬ࣳࣴࣵࣷࣸࣻࣼࣽࣾࣿऀॸঀ৻ৼ৽৾੶૰ૹૺૻૼ૽૾૿୕ఀఄఴ఼ౚౝ౷ಀಁ಄ೝೳഀഁഄ഻഼൏ൔൕൖ൘൙൚൛൜൝൞ൟ൶൷൸ඁ෦෧෨෩෪෫෬෭෮෯ຆຉຌຎຏຐຑຒຓຘຠຨຩຬ຺໌໎ໞໟჇჍჽჾჿᏵᏸᏹᏺᏻᏼᏽᛱᛲᛳᛴᛵᛶᛷᛸᜍ᜕ᜟ᠆᠋᠌᠍᠏ᡸᤝᤞ |
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
var surrogate = @"([\ud800-\udbff][\udc00-\udfff])";// .NET can't handle \U10000-\u10FFFF | |
var c = @"([\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd]|"+surrogate + ")"; | |
var s = @"([\u0020\u0009\u000d\u000a]+)"; | |
var nameStartChar = @"([:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|" + surrogate + ")"; | |
var nameChar = "(" + nameStartChar + @"|[-.0-9\u00B7\u0300-\u036F\u203F-\u2040])"; | |
var name = "(?'name'" + nameStartChar + nameChar + "*)"; | |
var names = "(?'names'" + name + @"(\u0020" + name +")*)"; | |
var nmtoken = "(?'nmtoken'" + nameChar + "+)"; | |
var nmtokens = "(?'nmtokens'" + nmtoken + @"(\u0020" + nmtoken +")*)"; | |
var pereference = "%" + name + ";"; |