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.util.Arrays; | |
| public class InterfaceOverload { | |
| private interface I<X, IWitness extends I<?, IWitness>> { } | |
| private interface J<X, JWitness extends J<?, JWitness>> { } | |
| private interface K<X, KWitness extends K<?, KWitness>> { } | |
| private interface L<X, LWitness extends L<?, LWitness>> { } | |
| private interface M<X, MWitness extends M<?, MWitness>> { } | |
| private interface N<X, MWitness extends N<?, MWitness>> { } |
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
| module NonTotalVerifiedComonad | |
| %default total | |
| interface Functor w => Comonad (w : Type -> Type) where | |
| extract : w a -> a | |
| extend : (w a -> b) -> w a -> w b | |
| extend f = map f . duplicate |
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
| function _common_section | |
| printf $c1 | |
| printf $argv[1] | |
| printf $c0 | |
| printf ":" | |
| printf $c2 | |
| printf $argv[2] | |
| printf $argv[3] | |
| printf $c0 | |
| printf ", " |
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
| object NoLinebreaks extends RegexParsers { | |
| override def skipWhitespace = false | |
| def anyChar: Parser[String] = """.""".r | |
| def apply(input: String) = parse(anyChar, input) | |
| } | |
| \** | |
| * scala> NoLinebreaks("a") | |
| * res135: NoLinebreaks.ParseResult[String] = [1.2] parsed: a | |
| * |
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
| module Queue | |
| import Data.Vect as V | |
| %access export | |
| data Queue : Type -> Nat -> Nat -> Nat -> Type where | |
| mkQueue : (front : V.Vect n ty) | |
| -> (back : V.Vect m ty) | |
| -> Queue ty n m (n + m) |
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
| add : Int -> Int -> Int | |
| add x y = x + y | |
| doSomething : (Int -> Int -> Int) -> Int -> Int -> Int | |
| doSomething f x y = f x y | |
| doSomething add 1 2 -- Result: 3 |
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
| module Main | |
| data DoorState = DoorClosed | DoorOpen | |
| data DoorResult = OK | Jammed | |
| doorResult : DoorResult -> DoorState | |
| doorResult = \res => case res of | |
| OK => DoorOpen | |
| Jammed => DoorClosed |
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
| module Main | |
| data DoorState = DoorClosed | DoorOpen | |
| data DoorResult = OK | Jammed | |
| doorResult : DoorResult -> DoorState | |
| doorResult = \res => case res of | |
| OK => DoorOpen | |
| Jammed => DoorClosed |
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
| 2016-11-09 19:33:42 crash_report | |
| initial_call: {kernel_config,init,['Argument__1']} | |
| pid: <0.59.0> | |
| registered_name: [] | |
| error_info: {exit,{mandatory_nodes_down,['b@MacBook-Air-2','c@MacBook-Air-2']},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,344}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]} | |
| ancestors: [kernel_sup,<0.34.0>] | |
| messages: [{'EXIT',<0.60.0>,normal}] | |
| links: [<0.35.0>] | |
| dictionary: [] | |
| trap_exit: true |
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 BangPatterns #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| import Control.Comonad | |
| import Control.Comonad.Cofree | |
| import Control.Monad | |
| import Control.Monad.ST |
NewerOlder