pro Gurke:
- ca. eine Daumenspitze geriebenen rohen Ingwer
- 1 gestrichener EL Zucker
- 1/2 TL Salz
- Essig
pro Gurke:
| {-# LANGUAGE TemplateHaskell #-} | |
| {- | |
| Inspired by http://www.haskell.org/pipermail/haskell-cafe/2011-June/093358.html | |
| Usage: | |
| {-# LANGUAGE TemplateHaskell #-} |
| module TestAeson where | |
| import Data.Aeson | |
| import Data.Aeson.Types | |
| import Control.Applicative (Alternative (..)) | |
| import Data.Text (unpack) | |
| parserA :: Value -> Parser String | |
| parserA (String s) = return (unpack s) | |
| parserA _ = fail "type mismatch" |
| data A | |
| = A_0 {aNumber_1 :: (Data.Maybe.Maybe Data.Attoparsec.Number.Number)} | |
| instance Data.Aeson.Types.Class.FromJSON A_0 | |
| where Data.Aeson.Types.Class.parseJSON (Data.Aeson.Types.Internal.Object obj) = Control.Applicative.pure A_0 Control.Applicative.<*> Data.Traversable.traverse (\val -> case val of | |
| Data.Aeson.Types.Internal.Number num -> do Control.Monad.when (num GHC.Classes.>= Data.Attoparsec.Number.I 0) (GHC.Base.fail "number must be greater than or equal 0") | |
| GHC.Base.return num | |
| {-# LANGUAGE ExistentialQuantification, RankNTypes, ImpredicativeTypes #-} | |
| module Test where | |
| -- doesn't typecheck | |
| test :: IO (forall a. a -> a) | |
| test = return id | |
| test2 :: (forall a. a -> a) -> (forall b. b -> b) | |
| test2 = const id |
| { | |
| "description": "Test suite for JSON schema implementations", | |
| "type": "object", | |
| "additionalProperties": { | |
| "type": "object", | |
| "properties": { | |
| "schema": { "$ref": "http://json-schema.org/schema" }, | |
| "referencedSchemas": { | |
| "type": "object", | |
| "additionalProperties": { "$ref": "http://json-schema.org/schema" } |
| { | |
| "recursive schema using $ref": { | |
| "schema": { "$ref": "node" }, | |
| "referencedSchemas": { | |
| "node": { | |
| "type": ["object", "string"], | |
| "properties": { | |
| "left": { "$ref": "node" }, | |
| "right": { "$ref": "node" } | |
| }, |
| {- | |
| This is a simple simulation of OT with Cloud in which all slaves generate | |
| and apply random operations. It should work in theory. In practice, however | |
| I wasn't apply to test it because my installation of distributed-process is | |
| apparently broken. Specifically, `spawn` doesn't seem to work (I tested it | |
| with some examples from the Well-Typed blog). | |
| This code depends on https://github.com/timjb/haskell-operational-transformation. | |
| -} |
| -- I'm following the tutorial at http://www.cse.chalmers.se/~ulfn/papers/afp08/tutorial.pdf | |
| module AgdaBasics where | |
| -- 2.1 Datatypes and pattern matching | |
| data Bool : Set where | |
| true : Bool | |
| false : Bool |