http://learnxinyminutes.com/docs/go/ - Brief Overview
https://tour.golang.org/welcome/1 - Interactive Tour
https://gobyexample.com/ - Great examples via idiomatic Go
http://www.golangbootcamp.com/book - More in depth
{-# LANGUAGE DeriveDataTypeable #-} | |
import Control.Monad.Random | |
import System.Random.Shuffle | |
import Data.Typeable | |
import Data.Data | |
import Control.Applicative | |
data Suit = Hearts | Clubs | Diamonds | Spades | |
deriving (Eq, Data, Typeable) |
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
) | |
const ( | |
CONN_HOST = "localhost" |
http://learnxinyminutes.com/docs/go/ - Brief Overview
https://tour.golang.org/welcome/1 - Interactive Tour
https://gobyexample.com/ - Great examples via idiomatic Go
http://www.golangbootcamp.com/book - More in depth
scala> val x: Option[String] = Option[String](null) | |
x: Option[String] = None | |
scala> x.isDefined | |
res0: Boolean = false | |
scala> x.getOrElse("foo") | |
res1: String = foo | |
scala> x.map(_.length) |
Read sections in order:
github.com/onsi/ginkgo/ginkgo | |
github.com/onsi/ginkgo |
import scalaz._ | |
import Scalaz._ | |
trait Read[F] { self => | |
def read(f: String): F | |
} | |
object Read { | |
@inline def apply[F](implicit F: Read[F]): Read[F] = F | |
} |
import List | |
import Set | |
import Html exposing (text) | |
type Suit = Hearts | Spades | Clubs | Diamonds | |
type Value = Two | Three | Four | Five | Six | Seven | Eight | Nine | | |
Ten | Jack | Queen | King | Ace | |
type alias Card = (Suit, Value) |
case class Person(name: String) | |
case class Alias(name: String) | |
case class PersonWithAliases(p: Person, aliases: List[Alias]) | |
/* | |
do some merging magic of Person with Alias to produce: |
<?php | |
class DateTime extends \DateTime | |
{ | |
private static $DATE_NAMES = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); | |
private static $FORMATS = array('ymd' => 'Y-m-d', 'jenark' => 'm/d/y', 'mysql' => 'Y-m-d'); | |
private static $DEFAULT_FORMAT = 'ymd'; | |
public function __call($method, $args) | |
{ | |
if (substr($method, 0, 2) === "is" && in_array(substr($method, 2), self::$DATE_NAMES)) |