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 Option<Int> myRiskyMethod() { | |
Option<Int> x = findSomeValue(); | |
Option<Int> y = ohNoFailure(); | |
return x.apply( new Add(), y ); | |
} |
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
case class MyClass( a:String, b:Int, c:Seq[String] ) | |
def derp:Either[String,MyClass] = { | |
val myA = goGetA match { | |
case Left(v) => return Left(v) | |
case Right(v) => v | |
} | |
val myB = goGetB match { |
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
{- This is the IRC protocol parser I'm using at http://github.com/peat/hbot ... look there for the most recent code -} | |
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} | |
module Message where | |
import Text.ParserCombinators.Parsec | |
import Data.Foldable (asum) | |
import Data.List (intercalate) | |
import Data.List.Split (splitOn) |
NewerOlder