Skip to content

Instantly share code, notes, and snippets.

View GrafBlutwurst's full-sized avatar

Dominic Egger GrafBlutwurst

View GitHub Profile
/**
* Generated code for enums (oneof with type discriminant) from openapi
*/
export interface OnlinePin {
type: OnlinePin.TypeEnum;
}
export namespace OnlinePin {
export type TypeEnum = 'OnlinePin';
Sep 27 09:24:32 MrDataCrunchy systemd-udevd[486]: /nix/store/7cn5204yrkk22mdd2a3p0j5ds951j4sx-udev-rules/11-dm-lvm.rules:40 Invalid value for OPTIONS key, ignoring: 'event_timeout=180'
Sep 27 09:24:32 MrDataCrunchy systemd-udevd[486]: /nix/store/7cn5204yrkk22mdd2a3p0j5ds951j4sx-udev-rules/11-dm-lvm.rules:40 The line takes no effect, ignoring.
Sep 27 09:24:32 MrDataCrunchy systemd-udevd[486]: /nix/store/7cn5204yrkk22mdd2a3p0j5ds951j4sx-udev-rules/84-nm-drivers.rules:10 Invalid value "/nix/store/l6h4ya0wzb4b8mr0y58k2gh2nhfql4sn-bash-4.4-p23/bin/bash -c '/nix/store/qv79j3glsdmfhdzwjwa5ys3s7k0kary5-ethtool-5.2/bin/ethtool -i $1 | /nix/store/5pwj1q9zbs89xv9wlmp554p4fixz9im4-gnused-4.7/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}" for PROGRAM (char 142: invalid s>
Sep 27 09:24:32 MrDataCrunchy systemd-udevd[486]: /nix/store/7cn5204yrkk22mdd2a3p0j5ds951j4sx-udev-rules/99-local.rules:25 Invalid value "/nix/store/l6h4ya0wzb4b8mr0y58k2gh2nhfql4sn-bash-4.4-p23/bin/bash -c 'mknod -m 666 /dev/nvidiactl c $(grep nvidia-f
Theorem modusTolens: (forall x y : Prop, (~y /\ (x -> y)) -> ~x).
Proof.
intros.
destruct H as [HL HR].
intro HP.
pose (yp := HR HP).
absurd y.
exact HL.
exact yp.
Qed.

I have a bit of a brainteaser and was hoping someone has a bit of time to be my rubberduck. So I am working on a DSL and want to build a Runtime for that language to be executed in. A program in that DSL is effectively a function from Runtime => Runtime (modulo error/io monad). The Runtime contains all the bindings that the programs can read and are writing. Each program defines the bindings it requires as well as the ones it adds. Besides that I have a couple combinators AndThen for sequential programs where the rhs has access to what lhs writes. Choice for a finite, exhaustive if-like things. And all for combining n programs that are run against the same runtime instance and whose results are aggregates.

so e.g my current compiler for AndThen just does function composition. It's fairly straight forwards.

Lets say

{

Viewer = 1 // 00001

Subscriber = 2 //00010

Mod = 4 //00100

package scalaz
package schema
import Liskov._
trait JsonModule extends SchemaModule {
type JSON = String
type Encoder[A] = A => JSON
@GrafBlutwurst
GrafBlutwurst / Schemas.hs
Created December 17, 2018 16:47
some open questions
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
module Lib
( personSchema
, main
) where
@GrafBlutwurst
GrafBlutwurst / CFP_Lambdaconf.md
Created December 12, 2018 11:25
Version 1 of my Proposal

SpartanZ developing Scalaz-Schema

In May 2018 the SpartanZ Project was started. A public call for contributors, followed by a myriad of projects propositions that people could choose and pick from to work on under the umbrella of ScalaZ. Scalaz-Schema is one of these projects and is based on another Library called Xenomorph. In its core it is about describing ADTs and from that deriving all sorts of useful implementations. From SerDes to Generators, forward/backwards compatibility between Schemas, Diffing and even querrying capabilites. In many Scala Libraries such derivations are currently done directly from the involved Datatypes using Macros or dependencies such as Shapeless. However these have various drawbacks that arise from coupling implementation with protocol. Refactoring your internal representations will inherently affect your public facing protocols. During this presentation I'll be talking about the Schema datatype is built using GADTs and Free constructions, how the derivations from the result

sealed trait AvroType[A]
sealed trait AvroPrimitiveType[A] extends AvroType[A]
final case class AvroNull[A]() extends AvroPrimitiveType[A]
final case class AvroBoolean[A]() extends AvroPrimitiveType[A]
final case class AvroInt[A]() extends AvroPrimitiveType[A]
final case class AvroLong[A]() extends AvroPrimitiveType[A]
final case class AvroFloat[A]() extends AvroPrimitiveType[A]
final case class AvroDouble[A]() extends AvroPrimitiveType[A]
final case class AvroBytes[A]() extends AvroPrimitiveType[A]
@GrafBlutwurst
GrafBlutwurst / AvroTypes.scala
Last active December 14, 2017 06:58
Incomplete representation of AvroSchema
package ch.avro.schema
import eu.timepit.refined.W
import eu.timepit.refined.api.Refined
import eu.timepit.refined.generic.Equal
object AvroTypes{
type RecordTypeName = W.`"record"`.T