in flycheck-start-command-checker
, add (message "%s %s" checker args)
-- Transforming between classy stuff. | |
-- | Foo is present in input and output. | |
data Foo = Foo | |
-- | Classy. | |
class HasFoo a where foo :: Lens' a Foo | |
-- | Maybe Bar is added to output type. | |
data Bar = Bar |
λ> import Data.Tree | |
λ> import Control.Comonad | |
λ> let t = Node (1::Int) [Node 2 [Node 4 [],Node 5 []],Node 3 [Node 6 [],Node 7 []]] | |
λ> let draw = putStrLn . drawTree . fmap show | |
λ> draw t | |
1 | |
| | |
+- 2 | |
| | | |
| +- 4 |
newtype Ledger a = Ledger { _lEntries :: Seq a } | |
deriving (Eq,Show,Generic,Monoid) | |
makeLenses ''Ledger | |
instance Cons (Ledger a) (Ledger a) a a where | |
_Cons = prism (\(a,s) -> over lEntries (review _Cons . (a,)) s) $ | |
\s -> case firstOf _Cons (view lEntries s) of | |
Nothing -> Left mempty | |
(Just (a,as)) -> Right (a,set lEntries as s) |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE GADTs #-} | |
module Juno.DSL | |
where | |
import qualified Data.ByteString as BS | |
import Control.Monad.Identity | |
data SigNonce nonce ident cmd = SigNonce { | |
_nIdent :: ident |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE GADTs, DataKinds, PolyKinds, ScopedTypeVariables #-} | |
module Foo where | |
import GHC.TypeLits | |
import Data.Proxy | |
data Foo (a :: Nat) (b :: Nat) :: * where Foo :: Foo a b | |
instance (KnownNat a, KnownNat b) => Show (Foo a b) where |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE GADTs, DataKinds #-} | |
module Foo where | |
import GHC.TypeLits | |
import Data.Type.Equality | |
import Data.Proxy | |
data Foo (a :: Nat) (b :: Nat) :: * where |
(+ 1 2) |
Refer to "Entity Configuration" below for general notes on privacy configurations. This demo requires that there be 4 entities configured by the genconfs
tool, which will name them "Alice", "Bob", "Carol" and "Dinesh". These would correspond to business entities on the blockchain, communicating with private messages over the blockchain. Confirm this setup with the server
command.
Launch the cluster, and load the demo.yaml file.
node3> load demo/demo.yaml
status: success
data: TableCreated
The purpose of this is to enforce regularity around usage of the lens library.
Lens gets a decent amount of flak for (a) horrific type errors (not much we can do with that)
and (b) illegible squigglies. My issue with the squigglies is they cause OO- (or OCAML?)-style left-to-right evaluation.
Thus, I'm not offended by some of the state-monad operators, as they slot into where <-
would go in do
notation.
But in the end, the ones I object to are really because their wordy counterparts are reasonably short. The big advantage of the squigglies in the end is not having to put parens around lens compositions,