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
scala> "[,]".parse | |
res0: Either[String,argonaut.Json] = Left(Unexpected content found: ,]) | |
scala> "{,}".parse | |
res1: Either[String,argonaut.Json] = Left(Expected string bounds but found: ,}) |
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
# ldd -v /home/sean/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/ghc | |
linux-vdso.so.1 => (0x00007ffc6ebe6000) | |
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f13fcb50000) | |
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f13fc948000) | |
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f13fc744000) | |
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f13fc540000) | |
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f13fc2c0000) | |
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f13fbfb7000) | |
libHShaskeline-0.7.2.1-1dVCRhdIH7hAQWJrKwByYv-ghc7.10.2.so => /home/sean/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/../haske_1dVCRhdIH7hAQWJrKwByYv/libHShaskeline-0.7.2.1-1dVCRhdIH7hAQWJrKwByYv-ghc7.10.2.so (0x00007f13fbc33000) | |
libHSterminfo-0.4.0.1-KvtqTNXWuWjKicEYaZ7qsx-ghc7.10.2.so => /home/sean/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/../termi_KvtqTNXWuWjKicEYaZ7qsx/libHSterminfo-0.4.0.1-KvtqTNXWuWjKicEYaZ7qsx- |
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
data Json = JsonBool Bool | |
| JsonArray [Json] | |
| JsonNull | |
deriving (Eq, Show) | |
type JSONError = () | |
type JSONReader a b = a -> Either JSONError (b, a) | |
boolReader :: (Bool -> b) -> JSONReader String b |
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 of ground organic chicken, half bunch of kale, walnuts, 1 onion, 1 clove garlic, gorgonzola. | |
Mix w hands till well blended. add salt, pepper, red pepper flakes. | |
Spread out on either parchment or pie platepat flat, maybe 3/4 inch to 1/2 inch max. | |
Top pizza w Gorgonzola or other strong cheese (taleggio wd work) and other half onion, diced. | |
Preheat oven to 180 C, in it goes after, raise to 220c for 12 minutes..then lower to 180. | |
There will be a layer of fat and water from kale - remove pizza and pour off, then replace and bake 5 more min with crushed walnuts. | |
Remove from heat. let it cool. Consume. | |
Can even top w sour cream/creme fraiche/smetana. |
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
doubleUs Int -> Int -> Int | |
doubleUs 0 0 = 0 | |
doubleUs a 0 = a * 2 | |
doubleUs 0 b = b * 2 | |
doubleUs x y = x * 2 + y * 2 |
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
type AppRWS a = RWST ReaderEnv () () IO a | |
type SpockTApp a = SpockT (RWST ReaderEnv () () IO) 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
renderRoute :: HasRep as => S.Path as -> HVectElim as H.AttributeValue | |
renderRoute path = | |
let curryIt :: (HVect as -> H.AttributeValue) -> HVectElim as H.AttributeValue | |
curryIt = hVectCurry | |
uncurryIt :: HVectElim as Text -> HVect as -> Text | |
uncurryIt = hVectUncurry | |
renderIt :: S.Path as -> HVectElim as Text | |
renderIt = S.renderRoute | |
in curryIt $ fmap H.textValue $ uncurryIt $ renderIt path |
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
proxyCall :: (Typeable a) => String -> a -> Q Exp | |
proxyCall serviceName toProxy = do | |
let parameterCount n a' = case (typeRepArgs a') of | |
[x, xs] -> if tyConName $ typeRepTyCon x == "IO" then n else parameterCount (n + 1) xs | |
_ -> undefined | |
let noOfParameters = parameterCount 0 $ typeOf toProxy | |
fieldNames <- traverse (\n -> mkName ("a" ++ (show n))) [1..noOfParameters] | |
valueName <- fmap fromJust $ lookupValueName serviceName | |
return [p| $(valueName) resource $(fieldNames) = Pool.withResource pool (\(ThriftConnection _ client) -> $(toProxy) client $(fieldNames)) |] |
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
import Control.Concurrent.Lifted | |
import Control.Monad.Base | |
import Data.IORef.Lifted | |
import Data.Traversable | |
import qualified Data.HashSet as S | |
import qualified Data.HashMap.Strict as M | |
import System.IO.Unsafe | |
import Debug.Trace | |
:set prompt "ghci> " |
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
implicit val myEnumDecodeJson: DecodeJson[MyEnum] = DecodeJson{hCursor => | |
hCursor.focus match { | |
case `myEnumValue1Json` => DecodeResult.ok(MyEnumValue1) | |
case `myEnumValue2Json` => DecodeResult.ok(MyEnumValue2) | |
case _ => DecodeResult.fail("Expected MyEnum.", hCursor.history) | |
} | |
} |