the code that fails is below. Here's some imported code:
newtype Size = Size Int
deriving (Eq, Ord, Show, Num)
getSize :: Size -> Int
getSize (Size i) = i| import scalaz._ | |
| import Scalaz._ | |
| class InvoiceValidations { | |
| def checkName(name: String): ValidationNel[String, String] = { | |
| if (name.length > 100) | |
| "name too long".failNel[String] | |
| else | |
| name.successNel[String] | |
| } |
| Dear mother, | |
| If you read this letter then I have unfortunately died. Don't believe everything you read about me, | |
| as I'm sure not all of it is true. You knew it already; I love guns. This love is what killed me. | |
| I dared venture out into the unknown and I guess I didn't make it back. | |
| Ever since the day my brother was killed by a better fighter, I vowed to avenge his death. Weapons | |
| are the best way to outmatch an opponent. They are the great equalizer. A Wookie can fall to a pistol | |
| blast. My brother could've been saved had he carried a weapon. Fists and claws are nothing. All that | |
| matters is the concentration of energy that is expelled from the tip of a riffle. I have spent my |
| require 'sinatra' | |
| require 'active_record' | |
| require 'sqlite3' | |
| require 'json' | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => 'sqlite3', | |
| :database => 'app.db' | |
| ) |
the code that fails is below. Here's some imported code:
newtype Size = Size Int
deriving (Eq, Ord, Show, Num)
getSize :: Size -> Int
getSize (Size i) = i$ mkdir git-exercises
$ cd git-exercises
$ git init
$ touch a.txt
$ git add -A
$ git commit -m 'empty file'
##let’s work on a small feature
| package test | |
| case class Address(no: Int, street: String, city: String, state: String, zip: String) | |
| trait LabelMaker[T] { | |
| def toLabel(value: T): String | |
| } | |
| trait Plus[T] { | |
| def plus(a1: T, a2: T): T |
| $ sudo gem install guard | |
| $ sudo gem install guard-shell | |
| links: | |
| - https://github.com/guard/guard | |
| - https://github.com/guard/guard-shell | |
| Create a file named "Guardfile" in the root of the project and put the following lines in it: | |
| guard :shell do |
| require 'values' | |
| # value objects | |
| User = Value.new(:name) | |
| u1 = User.new("Louis") | |
| u2 = User.new("Bob") | |
| u3 = User.new("Louis") |
| main = do | |
| config <- readDbConfig | |
| let runAction = withConnection config | |
| S.scotty 3000 $ do | |
| S.get "/" $ do | |
| res <- liftIO . runAction $ getOpportunity | |
| S.json $ Opportunities res | |
| S.post "/opportunities/" $ do | |
| requestBody <- S.body |
| import Text.Regex | |
| subRegex (mkRegex "\d") "some digits: 123" "*" | |
| <interactive>:19:21: | |
| lexical error in string/character literal at character 'd' |