Skip to content

Instantly share code, notes, and snippets.

View ajuggler's full-sized avatar

Antonio Hernandez ajuggler

View GitHub Profile
@ajuggler
ajuggler / metadata.json
Created September 8, 2022 19:13
MyEscrow
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created September 8, 2022 18:41
Example_20220908
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created September 8, 2022 18:04
Example_20220908
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}
@ajuggler
ajuggler / about.md
Last active April 11, 2023 19:46
Monads in Haskell. Notes based on lectures by Irfan Ali.

Monads in Haskell

These are my notes on the lectures on the topic of Monads imparted by Irfan Ali between May 27 and June 7, 2022.

Contents

  • Motivating example
  • The Monad class
  • List monad
  • State monad
@ajuggler
ajuggler / Main.hs
Last active June 13, 2022 17:56
MPP - Bank Client agreement (homework)
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended
np = 3 :: Integer -- Number of payments (positive integer)
am = 50 :: Integer -- Amount (in Ada) of each deposit by Client (positive integer)
main :: IO ()
main = printJSON $ contract np am (TimeParam "Bank Deadline") (TimeParam "Client Deadline")
@ajuggler
ajuggler / metadata.json
Last active June 12, 2022 05:28
Bank Client (draft)
{"valueParameterInfo":[["Amount",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Deposit amount"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Bank conditionally rewards Client for all deposits","contractName":"Bank & Client","contractLongDescription":"Bank conditionally rewards Client for all deposits, penalizes if at least one deposit is missing","choiceInfo":[]}
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Amount of deposit by each payer"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Multiple Payers give to Receiver","contractName":"Multi Pay","contractLongDescription":"Multiple Payers give to Receiver","choiceInfo":[]}
@ajuggler
ajuggler / Main.hs
Last active June 11, 2022 05:36
Double Pay (Haskell)
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe.Extended
main :: IO ()
main = printJSON $ contract (Role "Giver1") (Role "Giver2") (Role "Receiver") (ConstantParam "Deposit") (TimeParam "Deadline")
contract :: Party -> Party -> Party -> Value -> Timeout -> Contract
contract giver1 giver2 receiver amount deadline =
@ajuggler
ajuggler / metadata.json
Created June 10, 2022 21:18
double pay (blockly)
{"valueParameterInfo":[["Deposit",{"valueParameterFormat":{"contents":[6,"ada"],"tag":"DecimalFormat"},"valueParameterDescription":"Deposit by each giver"}]],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Two givers pay to one recipient","contractName":"Double Pay (Blockly)","contractLongDescription":"Two givers pay to one recipient","choiceInfo":[]}
@ajuggler
ajuggler / metadata.json
Created June 10, 2022 19:30
double pay (marlowe)
{"valueParameterInfo":[],"timeParameterDescriptions":[],"roleDescriptions":[],"contractType":"Other","contractShortDescription":"Unknown","contractName":"Unknown","contractLongDescription":"We couldn't find information about this contract","choiceInfo":[]}