Skip to content

Instantly share code, notes, and snippets.

View ilya-murzinov's full-sized avatar

Ilia Murzinov ilya-murzinov

View GitHub Profile
import cats.data.Reader
import cats.syntax.applicative._
type MyReader[A] = Reader[String, A]
false.pure[MyReader]
// reader.scala:5: ambiguous implicit values:
// both method catsDataCommutativeMonadForKleisli in class KleisliInstances of type [F[_], A](implicit F0: cats.CommutativeMonad[F])cats.CommutativeMonad[[γ$7$]cats.data.Kleisli[F,A,γ$7$]]
// and method catsApplicativeForArrow in object Applicative of type [F[_, _], A](implicit F: cats.arrow.Arrow[F])cats.Applicative[[β$0$]F[A,β$0$]]
// match expected type cats.Applicative[ammonite.$file.experiments.reader.MyReader]
{-# LANGUAGE BangPatterns #-}
module Timer
( timer
, timer_
) where
import Data.Time
timer :: IO a -> IO a
@ilya-murzinov
ilya-murzinov / merge.hs
Last active November 8, 2017 09:19
merge.hs
merge :: Integer -> Integer -> Integer
merge i1 i2 = merge' i1 i2 (length i1) (length i2) 0
where
merge' _ _ 0 0 acc = acc
merge' _ i2' 0 l2 acc = acc * 10 ^ l2 + i2'
merge' i1' _ l1 0 acc = acc * 10 ^ l1 + i1'
merge' i1' i2' l1 l2 acc = merge' rest1 rest2 (l1 - 1) (l2 - 1) acc'
where
(first1, rest1) = split i1' l1
(first2, rest2) = split i2' l2
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# Enable SSL3
[Net.ServicePointManager]::SecurityProtocol = 'Tls12'
# get current IP
$ip = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -like '*ethernet*'}).IPAddress
$port = 3389
if($ip.StartsWith('192.168.') -or $ip.StartsWith('10.240.')) {
# new environment - behind NAT
$port = 33800 + $ip.split('.')[3]
namespace MyAssembly
{
[TestFixture]
public class TestSuite
{
[Test]
public void Test()
{
doSomething();
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
/**
* @author Murzinov Ilya, murz42@gmail.com
* Date 12.06.14
*/
import java.io.*;
import java.math.BigInteger;
public class Main {
public static String inName = "input.txt";
public static String outName = "output.txt";
public static void main(String[] args) {
try {
String line;
import java.io.*;
import java.util.HashMap;
import java.util.Map;
public class Main2 {
public static String inName = "input.txt";
public static String outName = "output.txt";
public static void main(String[] args) {
try {