$ cabal run exe:coffer -- create diogo/google-work \
--field user:[email protected] \
--field pw:123 \
--field url:www.google.com
[SUCCESS] Entry created at '/diogo/google-work'
$ cabal run exe:coffer -- create diogo/google-home \
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
{ | |
"envelope_id": "f34c6197-a7ef-45ed-acad-4d5a3147ec86", | |
"payload": { | |
"token": "Pct6Sm6JynybrFXkjEiH7hhX", | |
"team_id": "T02NDBHSWSG", | |
"api_app_id": "A03BLN935DK", | |
"event": { | |
"type": "message", | |
"subtype": "message_changed", | |
"message": { |
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
{ | |
"envelope_id": "012327ef-4c84-41e3-a952-09af25782c17", | |
"payload": { | |
"token": "Pct6Sm6JynybrFXkjEiH7hhX", | |
"team_id": "T02NDBHSWSG", | |
"api_app_id": "A03BLN935DK", | |
"event": { | |
"client_msg_id": "0837851c-2d34-4d4d-804c-7aed753c3421", | |
"type": "message", | |
"text": "Hello world", |
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
>>>>0: https://hangzhou.testnet.tezos.serokell.team/version | |
>>>>1: https://hangzhou.testnet.tezos.serokell.team/chains/main/blocks/head/protocols | |
>>>>2: https://hangzhou.testnet.tezos.serokell.team/chains/main/blocks/head/context/contracts/tz1ZSedNyGuqibEYCPbuMS3yEhhLHfZEuLtA/counter | |
>>>>3: https://hangzhou.testnet.tezos.serokell.team/chains/main/blocks/head/context/contracts/tz1ZSedNyGuqibEYCPbuMS3yEhhLHfZEuLtA/manager_key | |
>>>>4: https://hangzhou.testnet.tezos.serokell.team/monitor/bootstrapped | |
>>>>5: https://hangzhou.testnet.tezos.serokell.team/chains/main/blocks/head/context/constants | |
>>>>6: https://hangzhou.testnet.tezos.serokell.team/chains/main/blocks/head/hash | |
>>>>7: https://hangzhou.testnet.tezos.serokell.team/chains/main/chain_id | |
>>>>8: https://hangzhou.testnet.tezos.serokell.team/chains/main/chain_id | |
>>>>9: https://hangzhou.testnet.tezos.serokell.team/chains/main/blocks/head/helpers/scripts/simulate_operation |
This tutorial assumes you're already familiar with Haskell's kind system and extensions like DataKinds
.
If not, please read my blog post first </shameless-plug>
.
Say you want to model a TCP connection, and it can be in either an "open" or "closed" status.
data Connection = MkConnection ...
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
$ nix-build ci.nix -A all-components --no-out-link | |
building '/nix/store/bflfb6jrxykrp53fkd5f0gd0d45z776s-git-ls-files.drv'... | |
trace: To make this a fixed-output derivation but not materialized, set `stack-sha256` to the output of /nix/store/w4f2lcmndg68m64cdrhm1vkhz2s216i7-calculateSha | |
trace: To materialize the output entirely, pass a writable path as the `materialized` argument and pass that path to /nix/store/y1w6r7c4wrvhllzmz4k3h6g30b4hph74-generateMaterialized | |
building '/nix/store/36nhcnn93ik0zdsmbcbrpqbq0ajl5lsc-morley-stack-to-nix-pkgs.drv'... | |
substituteStream(): WARNING: pattern '/nix/store/fn96af9026mkyk28pj3ivwd9drzd247m-morley' doesn't match anything in file '/nix/store/zyzl3v6lww8a81qhmv052075a4qbbj7n-morley-stack-to-nix-pkgs/default.nix' | |
substituteStream(): WARNING: pattern '/nix/store/fn96af9026mkyk28pj3ivwd9drzd247m-morley' doesn't match anything in file '/nix/store/zyzl3v6lww8a81qhmv052075a4qbbj7n-morley-stack-to-nix-pkgs/pkgs.nix' | |
these derivations will be built: |
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
/home/dc/.ghcup/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir /home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build -odir /home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build -hidir /home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build -stubdir /home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build -i -i/home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build -isrc -i/home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build/autogen -i/home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0.0/build/global-autogen -I/home/dc/dev/other/doctest-mixins/dist-newstyle/build/x86_64-linux/ghc-8.8.3/doctest-mixins-0.1.0 |
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 Data.Vinyl (Rec(..)) | |
data Tag = TagInt | TagPair Tag Tag | |
data Exp (t :: Tag) where | |
EInt :: Int -> Exp 'TagInt | |
EPair :: Exp t1 -> Exp t2 -> Exp ('TagPair t1 t2) | |
type family RightComb (tags :: [Tag]) :: Tag where | |
RightComb '[ x, y ] = 'TagPair x y |
A type variable can be either universally ("for all x, then ...") or existentially quantified ("there exists some x, ...").
(If you're a maths persons, this corresponds to ∀x. x
and ∃x. x
, respectively)
In haskell, universally quantified type vars are represented with a forall
:
head :: forall a. [a] -> Maybe 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
import Language.Haskell.TH.Lib | |
import Language.Haskell.TH.Syntax | |
module Problem where | |
data PP a where | |
PP :: forall a. Typeable a => PP a | |
instance Lift (PP a) where | |
lift PP = [|PP|] |
NewerOlder