Skip to content

Instantly share code, notes, and snippets.

View inamiy's full-sized avatar

Yasuhiro Inami inamiy

View GitHub Profile

slidenumber: true autoscale: true

Opaque Result Typeの解説

omochimetaru

わいわいswiftc #11


5秒なら

@jproyo
jproyo / Data.hs
Last active May 19, 2022 16:04
Tagless Final Encoding in Haskell Example
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
module Data where
type UserName = String
data DataResult = DataResult String
deriving (Eq, Show)
class Monad m => Cache m where
@pteasima
pteasima / HKTs.swift
Last active January 17, 2019 07:29
HKTs
protocol Functor {
associatedtype Tag
associatedtype E //Element or _Element clashes on Dictionary :(
}
struct Functoring<F: Functor> {
let _map: (F, (F.E) -> Any) -> Any
func map<FB: Functor>(_ functor: F, transform: (F.E) -> FB.E) -> FB where F.Tag == FB.Tag {
return _map(functor, transform) as! FB
}
}

slidenumber: true

Swiftの関数型の

実行時表現

わいわいswiftc

omochimetaru


//#! Swift 5
import Foundation
import AppKit
////////////////////////////////////////////////////////////////////
//: ## Type Definition
struct AttrString {
let attributedString: NSAttributedString
@gregberns
gregberns / the-algebra-of-algebraic-data-types.md
Created December 13, 2018 05:57
The Algebra of Algebraic Data Types, Part 1, by Chris Taylor
/*:
# Seemingly Impossible Swift Programs
*/
/*:
# 1.) Completely possible programs
*/
[1, 2, 3]
.allSatisfy { $0 >= 2 }
[1, 2, 3]
@omarojo
omarojo / VideoMediaInput.swift
Last active May 13, 2024 06:35
How to use MTAudioProcessingTap in Swift 4.2
//
// VideoMediaInput.swift
// GenerateMetal-iOS
//
// Created by Omar Juarez Ortiz on 2018-11-28.
// Copyright © 2018 All rights reserved.
//
import Foundation
import UIKit
{
"BTTWidgetName" : "RAM",
"BTTTriggerType" : 642,
"BTTTriggerTypeDescription" : "Shell Script \/ Task Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTShellScriptWidgetGestureConfig" : "\/bin\/bash:::-c",
"BTTEnabled2" : 1,
"BTTUUID" : "D231439F-67B4-4A08-8DDA-0FFE6650A68F",
{
"BTTWidgetName" : "CPU",
"BTTTriggerType" : 642,
"BTTTriggerTypeDescription" : "Shell Script \/ Task Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTShellScriptWidgetGestureConfig" : "\/bin\/bash:::-c",
"BTTEnabled2" : 1,
"BTTUUID" : "2242BFF7-6346-4EBF-AE18-407E91CFEA57",