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
{-# LANGUAGE OverloadedStrings, RankNTypes, ScopedTypeVariables, | |
NoMonomorphismRestriction, DeriveDataTypeable #-} | |
module Main where | |
import Prelude hiding (and, catch) | |
import Data.Char (toLower) | |
import Data.Conduit | |
import Data.Conduit.Util | |
import Data.Conduit.ImageSize (sinkImageInfo) | |
import Data.Conduit.Binary (sourceFile, conduitFile, sinkFile) |
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.Monad | |
import Control.Monad.Trans | |
-- The following is taken from the paper "MFlow, a contiuation-based web | |
-- framework without continuations" by Alberto Gomez Corona, April 23, 2014, | |
-- with minor modifications to make it runnable in GHCi. | |
data FailBack a = BackPoint a | NoBack a | GoBack | |
newtype BackT m a = BackT { runBackT :: m (FailBack a ) } | |
instance Monad m => Monad (BackT m) where |
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
using ParallelAccelerator | |
const RISKFREE = 0.02 | |
const VOLATILITY = 0.30 | |
#ParallelAccelerator.ParallelIR.PIRSetFuseLimit(0) | |
#ParallelAccelerator.CGen.setvectorizationlevel(ParallelAccelerator.CGen.VECDISABLE) | |
@acc begin |
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
------------------------------------------------------------------------------------- | |
-- Schnorr Signatures - A Haskell Tutorial | |
-- | |
-- While studying Schnorr Signatures, I find most online materials either | |
-- imprecise, or inadequate. Often mathematical notations are being quoted | |
-- without fully explaining conditions, expecations, and variables/functions | |
-- domain and/or range. They are confusing enough that any attempt to turn them | |
-- into real programs is doomed, either producing something that is wrong, or | |
-- even worse, something that you think is correct but is actually wrong. | |
-- |
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 ICPTs = record { | |
e8s : nat64; | |
}; | |
type Duration = record { | |
secs: nat64; | |
nanos: nat32; | |
}; | |
type TimeStamp = record { |
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
module { | |
public type BatchId = Nat; | |
public type BatchOperationKind = { | |
#CreateAsset : CreateAssetArguments; | |
#UnsetAssetContent : UnsetAssetContentArguments; | |
#DeleteAsset : DeleteAssetArguments; | |
#SetAssetContent : SetAssetContentArguments; | |
#Clear : ClearArguments; | |
}; | |
public type ChunkId = Nat; |
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
FILES=governance.did cmc.did canister_ids.json dfx.json | |
setup: $(FILES) | |
@echo You are all set! Run 'dfx canister --network=ic call nns get_monthly_node_provider_rewards' to test if it works. | |
@echo Please read the governance.did file to find the complete interface. | |
governance.did: | |
@curl -L https://github.com/dfinity/ic/raw/master/rs/nns/governance/canister/governance.did -o $@ | |
cmc.did: |
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
# practice 1 | |
# check cycle wallet balance | |
dfx wallet balance --ic | |
# if wallet has not been setup, ask for a coupon and redeem to create a cycle wallet on mainnet | |
# dfx wallet redeem-faucet-coupon $COUPON_CODE | |
# dfx.json | |
-------------------------------- |