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
| import java.io.ByteArrayOutputStream | |
| import java.io.ObjectInputStream | |
| import java.io.ObjectOutputStream | |
| import java.io.Serializable | |
| data class Moritz(val x: Int) | |
| data class Foo( | |
| @Transient | |
| var bar: Moritz, |
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
| use petgraph::algo::toposort; | |
| use petgraph::graph::{DiGraph, NodeIndex}; | |
| use std::collections::HashMap; | |
| #[derive(Debug, Clone)] | |
| enum Expr { | |
| Add { left: NodeIndex, right: NodeIndex }, | |
| Mult { left: NodeIndex, right: NodeIndex }, | |
| Var { name: String }, | |
| Sin { sub: NodeIndex }, |
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
| local ret_status="%(?:%{$fg_bold[green]%}λ:%{$fg_bold[red]%}λ%s)%{$reset_color%}" | |
| function get_pwd(){ | |
| git_root=$PWD | |
| while [[ $git_root != / && ! -e $git_root/.git ]]; do | |
| git_root=$git_root:h | |
| done | |
| if [[ $git_root = / ]]; then | |
| unset git_root | |
| prompt_short_dir=%~ |
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 InstanceSigs #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| module Transformers where | |
| import Control.Monad | |
| data State s a = State | |
| { runState :: s -> (a, s) |
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 #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| module Main where | |
| import Prelude hiding (read) | |
| import Control.Monad.Free |
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 DataKinds #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| module Indexed where | |
| -- Natural transformation.. |
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 DataKinds #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE FunctionalDependencies #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| module Main where | |
| import Control.Monad.Except |