Skip to content

Instantly share code, notes, and snippets.

View imeredith's full-sized avatar

Ivan Meredith imeredith

View GitHub Profile
myjson :: Maybe Int
myjson = do
json <- decode $ "{\"key\":5}"
flip parseMaybe json $ \obj ->
(+) <$> obj .: "key" <*> obj .: "key"
object comonadbuilder {
import scalaz._
import Scalaz._
case class Config(a: Option[String] = None, b: Option[Int] = None)
type Builder[A] = Config => A
def setFieldA(a: String) = (b:Builder[Config]) => b(Config(a=Some(a)))
//> setFieldA: (a: String)(comonadbuilder.Config => comonadbuilder.Config) => co
//| monadbuilder.Config
@imeredith
imeredith / cb.rb
Last active December 15, 2015 06:38
importantsetting = Cloudbees.env do
test "somestuff"
staging "someotherstuff"
production "realstuff"
end
private static class RequestImpl implements Request {
private final String uri;
public RequestImpl(String uri) {
this.uri = uri;
}
@Override
public String getRequestURI() {
Application.hs:49:44:
No instance for (Control.Monad.Logger.MonadLogger IO)
arising from a use of `runMigration'
Possible fix:
add an instance declaration for
(Control.Monad.Logger.MonadLogger IO)
In the second argument of `Database.Persist.Store.runPool', namely
`(runMigration migrateAll)'
In a stmt of a 'do' block:
Database.Persist.Store.runPool dbconf (runMigration migrateAll) p
16:49 ~/haskell/yesog $ ghc-pkg list monad-logger
/Library/Frameworks/GHC.framework/Versions/7.4.1-x86_64/usr/lib/ghc-7.4.1/package.conf.d
/Users/ivan/.ghc/x86_64-darwin-7.4.1/package.conf.d
monad-logger-0.2.3.2
[5 of 8] Compiling Foundation ( Foundation.hs, dist/build/Foundation.o )
[6 of 8] Compiling Import ( Import.hs, dist/build/Import.o )
[7 of 8] Compiling Handler.Home ( Handler/Home.hs, dist/build/Handler/Home.o )
[8 of 8] Compiling Application ( Application.hs, dist/build/Application.o )
Application.hs:49:44:
No instance for (monad-logger-0.3.0:Control.Monad.Logger.MonadLogger
IO)
arising from a use of `runMigration'
Possible fix:
16:25 ~/haskell/unix-time $ sh configure --with-compiler=ghc --prefix=/Users/ivan/Library/Haskell/ghc-7.4.1/lib/unix-time-0.1.5 --with-gcc=/usr/bin/gcc
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
searching for ghc in path.
found ghc at /usr/bin/ghc
("/usr/bin/ghc",["--numeric-version"])
/usr/bin/ghc is version 7.4.1
looking for tool "ghc-pkg" near compiler in /usr/bin
found ghc-pkg in /usr/bin/ghc-pkg
("/usr/bin/ghc-pkg",["--version"])
/usr/bin/ghc-pkg is version 7.4.1
("/usr/bin/ghc",["--supported-languages"])
("/usr/bin/ghc",["--info"])
16:06 ~/haskell/yesog $ cabal install unix-time
Resolving dependencies...
Configuring unix-time-0.1.5...
Failed to install unix-time-0.1.5
cabal: Error: some packages failed to install:
unix-time-0.1.5 failed during the configure step. The exception was:
ExitFailure 127