Skip to content

Instantly share code, notes, and snippets.

View TypeClassTest.purs
module TypeClassTest where
import Prelude
import Unsafe.Coerce (unsafeCoerce)
class TwoParams a b where
func :: a -> b
instance equals :: TwoParams a a where
func = identity
View SandS.ahk
;; SandS for AutoHotkey
;; ===初期設定==========================================================
;; 多重起動の制御をforceに指定
#SingleInstance force
;; 環境変数を無視する
#NoEnv
View MethodGroupNullable.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<LangVersion>8.0</LangVersion>
<!-- for Visual Studio 16.2.x Preview -->
<Nullable>enable</Nullable>
@acple
acple / Memoize.cs
Last active Mar 18, 2019
メッメモリリークだあーーにげろーー
View Memoize.cs
using System.Collections.Generic;
using ParsecSharp;
using ParsecSharp.Internal;
namespace ParsecSharp.Extensions
{
public static class Parser
{
public static Parser<TToken, T> Memoize<TToken, T>(Parser<TToken, T> parser)
{
View DebugOutputStream.cs
using System;
using ParsecSharp;
namespace ParsecSharp.Utils
{
public class DebugOutputStream<TToken> : IParsecStateStream<TToken>
{
public enum MoveState { Backward, Stay, Forward }
private class Cursor
@acple
acple / Main.purs
Created Jan 16, 2019
purescript-halogen raise-problem
View Main.purs
module Main where
import Prelude
import Data.Maybe (Maybe(..))
import Data.Symbol (SProxy(..))
import Effect (Effect)
import Effect.Class (class MonadEffect)
import Effect.Class.Console (log)
import Halogen (raise)
View Base32Encoding.cs
using System;
using System.Buffers.Binary;
using System.Runtime.CompilerServices;
namespace Base32
{
public class Base32Encoding
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public string Encode(ReadOnlySpan<byte> bytes)
@acple
acple / Program.cs
Last active Sep 19, 2018
コンパイル結果がやべーやつ
View Program.cs
using System;
namespace Sandbox
{
class Program
{
static void Main(string[] args)
{
var x = 1;
{
View Nat.purs
module Data.Typelevel.Nat where
import Prelude
import Data.Symbol (SProxy(..))
import Prim.Symbol as Symbol
class IsNat nat where
reflectNat :: SProxy nat -> Int
View Existential.purs
module Main where
import Prelude
import Data.Exists (Exists, mkExists, runExists)
import Data.Foldable (traverse_)
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect.Class.Console (log)
You can’t perform that action at this time.