Skip to content

Instantly share code, notes, and snippets.

@simonjohnthompson
simonjohnthompson / Main.hs
Created March 23, 2021 17:22 — forked from palas/Main.hs
Simple escrow
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe.Extended
main :: IO ()
main = print . pretty $ contract
-- We can set explicitRefunds True to run Close refund analysis
-- but we get a shorter contract if we set it to False
@simonjohnthompson
simonjohnthompson / Main.hs
Created March 23, 2021 17:22 — forked from palas/Main.hs
Escrow with collateral
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe.Extended
main :: IO ()
main = print . pretty $ contract
-- We can set explicitRefunds True to run Close refund analysis
-- but we get a shorter contract if we set it to False
@simonjohnthompson
simonjohnthompson / Main.hs
Created March 23, 2021 17:22 — forked from palas/Main.hs
Zero Coupon Bond
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedStrings #-}
module ZeroCouponBond where
import Language.Marlowe.Extended
main :: IO ()
main = print . pretty $ contract
discountedPrice, notional :: Value
@simonjohnthompson
simonjohnthompson / Main.hs
Created March 23, 2021 17:22 — forked from palas/Main.hs
Swap
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe.Extended
main :: IO ()
main = print . pretty $ contract
-- We can set explicitRefunds True to run Close refund analysis
-- but we get a shorter contract if we set it to False
@simonjohnthompson
simonjohnthompson / Main.hs
Last active October 27, 2020 11:56
Kraken
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
{- Define a contract, Close is the simplest contract which just ends the contract straight away
@simonjohnthompson
simonjohnthompson / Main.hs
Last active October 28, 2020 11:46
Analysis example
{-# LANGUAGE OverloadedStrings #-}
module Example where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
{- Define a contract, Close is the simplest contract which just ends the contract straight away
{-# LANGUAGE OverloadedStrings #-}
module Escrow where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
{- What does the vanilla contract look like?