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 ( | |
) where | |
import Control.Monad.Either | |
f :: (Monad m) ⇒ Int → m Int | |
f 0 = fail "I don't like zeros" | |
f x = return x |
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
namespace TTest | |
{ | |
using CircularList; | |
using WithCompus = Char; | |
//using RobotState = Tuple<IEnumerable<char>, Position>; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
WithCompus meWithCompusToNorth = 'N'; |
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 Space.Rovers | |
open System | |
type Direction= N | E | S | W | |
let direction= function 'N' ->N |'E'->E |'S'->S |'W'->W | |
|_-> raise (new ArgumentOutOfRangeException()) | |
let swap (x,y)=(y,x) | |
let rec neighbours = function N -> (W,E) |
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 Application { | |
def main(args :Array[String]){ | |
println(Simulator(5,5).execute((Orientations.N,(1,2)),List('G','A','G','A','G','A','G','A','A'))) | |
println(Simulator(5,5).execute((Orientations.E,(3,3)),List('A','A','D','A','A','D','A','D','D','A'))) | |
} | |
object Orientations { | |
type Orientation=Char |
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
class Program | |
{ | |
static IDictionary<string,int> zipCodes= new Dictionary<string,int>{ | |
{"Paris",75} | |
}; | |
static IDictionary<int, int> population = new Dictionary<int, int>{ | |
{75,100} | |
}; | |
static int? GetInterstingNumber(string cityName){ |
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 Test { | |
implicit def lift0[A,B >: Any](a:A):B=>A=_=>a | |
implicit def lift1[A>: Any,B>: Any,C >: Any](f:A=>B):(C=>A)=>C=>A=>B = h=>c =>f (h(c)) | |
implicit def lift2[A<:Any,B<:Any,C<:Any,D >: scala.Nothing <:scala.Any](f:Function2[A,B,C]):Function3[Function1[D,A],Function1[D,B],D,C] =( h ,g, d)=>f (h(d),g(d)) | |
implicit def curry2[a1 >: scala.Nothing <: scala.Any, a2 >: scala.Nothing <: scala.Any, b >: scala.Nothing <: scala.Any] (f:Function2[a1,a2,b]): scala.Function1[a1, scala.Function1[a2, b]] =Function.curried(f) | |
implicit def curry3[a1 >: scala.Nothing <: scala.Any, a2 >: scala.Nothing <: scala.Any, a3 >: scala.Nothing <: scala.Any, b >: scala.Nothing <: scala.Any] (f:Function3[a1,a2,a3,b]): scala.Function1[a1, scala.Function1[a2,scala.Function1[a3,b]]] =Function.curried(f) | |
//implicit def self[A](a:A):A=a | |
def main(args:Array[String]){ |
NewerOlder