This file contains 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
package foo | |
import scala.language.higherKinds | |
trait Semigroup[M] extends Any { | |
def mAppend(x: M, y: M): M | |
} | |
trait Monoid[M] extends Semigroup[M] { | |
def zero: M |
This file contains 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
package foo | |
sealed trait ParsingError extends Any { | |
def error: String | |
override def toString: String = s"Parsing error: $error" | |
} | |
case object NoInputError extends ParsingError { | |
override def error: String = "No more input" | |
} | |
final case class WrongMatch[A](expected: A, found: A) extends ParsingError { |
This file contains 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
package io.github.carlomicieli.fibonacci | |
import java.util.concurrent.atomic.AtomicInteger | |
import akka.actor._ | |
import akka.event.LoggingReceive | |
import scala.io.StdIn | |
object FibonacciApp1 { |
- A Map of Akka
- A Simple Akka Cluster Application
- About Akka Streams
- Actor System Termination on JVM Shutdown
- Akka Actors to Akka Streams: When You Should Care
- Akka anti-patterns: being out of touch with the hardware
- Akka anti-patterns: flat actor hierarchies or mixing business logic and failure handling
This file contains 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 HsList ( List(..) | |
, fromList | |
, (+++) | |
, singleton | |
, map | |
, length | |
, intersperse | |
, intercalate | |
, concat | |
, and |
This file contains 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
Ninety-Nine Haskell Problems | |
============================ | |
[Original page](https://www.haskell.org/haskellwiki/H-99:_Ninety-Nine_Haskell_Problems) | |
> import Data.List | |
Lists | |
----- |
This file contains 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
twoLargest :: (Num a, Ord a) => a -> a -> a -> (a, a) | |
twoLargest x y z | |
| x <= y && x <= z = (y, z) | |
| y <= x && y <= z = (x, z) | |
| otherwise = (x, y) | |
square :: (Num a) => a -> a | |
square x = x * x | |
squarePair :: (Num a) => (a, a) -> (a, a) |
This file contains 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
#!/bin/bash | |
## Constants | |
NONE='\e[39m' | |
RED='\e[31m' | |
GREEN='\e[32m' | |
CYAN='\e[36m' | |
### ======================================================================= ### | |
### HELPER FUNCTIONS ### |
This file contains 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
public class ReferenceSamples { | |
public static void main(String[] args) { | |
references(); | |
equality(); | |
} | |
private static void equality() { | |
Integer i1 = 1; | |
int i2 = i1; | |
assert i1 == i2 && i1.equals(i2); |
NewerOlder