We move the effort into designing the type, so that writing the algorithm is simpler.
There is a relationship between monads and Hoare Logic. Can I solve the 9-jigsaw puzzle with Monads? https://en.wikipedia.org/wiki/Hoare_logic
module Main exposing (..) | |
import Html exposing (..) | |
import Html.App exposing (beginnerProgram) | |
import Html.Events exposing (onClick, on, targetChecked) | |
type View | |
= Ascending | |
| Descending |
module Main exposing (..) | |
import Html exposing (..) | |
import Html.App exposing (beginnerProgram) | |
import Html.Events exposing (onClick, on, targetChecked) | |
type View | |
= Ascending | |
| Descending |
#!/bin/sh | |
############################################################ | |
# Create a simple working program. | |
############################################################ | |
cat <<EOF > Foo.elm | |
module Foo exposing (..) | |
type alias Foo = Int | |
EOF |
We move the effort into designing the type, so that writing the algorithm is simpler.
There is a relationship between monads and Hoare Logic. Can I solve the 9-jigsaw puzzle with Monads? https://en.wikipedia.org/wiki/Hoare_logic
-- | Vesting scheme as a PLC contract | |
module Vesting where | |
import Control.Monad (void) | |
import qualified Language.PlutusTx as PlutusTx | |
import qualified Ledger.Interval as Interval | |
import qualified Language.PlutusTx.Prelude as P | |
import Ledger | |
import Ledger.Validation |
-- | Crowdfunding contract implemented using the [[Plutus]] interface. | |
-- This is the fully parallel version that collects all contributions | |
-- in a single transaction. | |
-- | |
-- Note [Transactions in the crowdfunding campaign] explains the structure of | |
-- this contract on the blockchain. | |
import qualified Language.PlutusTx as PlutusTx | |
import qualified Ledger.Interval as Interval | |
import Ledger.Interval (SlotRange) | |
import qualified Language.PlutusTx.Prelude as P |
-- | Crowdfunding contract implemented using the [[Plutus]] interface. | |
-- This is the fully parallel version that collects all contributions | |
-- in a single transaction. | |
-- | |
-- Note [Transactions in the crowdfunding campaign] explains the structure of | |
-- this contract on the blockchain. | |
import qualified Language.PlutusTx as PlutusTx | |
import qualified Ledger.Interval as Interval | |
import Ledger.Interval (SlotRange) | |
import qualified Language.PlutusTx.Prelude as P |
-- | Crowdfunding contract implemented using the [[Plutus]] interface. | |
-- This is the fully parallel version that collects all contributions | |
-- in a single transaction. | |
-- | |
-- Note [Transactions in the crowdfunding campaign] explains the structure of | |
-- this contract on the blockchain. | |
import qualified Language.PlutusTx as PlutusTx | |
import qualified Ledger.Interval as Interval | |
import Ledger.Interval (SlotRange) | |
import qualified Language.PlutusTx.Prelude as P |
-- | Crowdfunding contract implemented using the [[Plutus]] interface. | |
-- This is the fully parallel version that collects all contributions | |
-- in a single transaction. | |
-- | |
-- Note [Transactions in the crowdfunding campaign] explains the structure of | |
-- this contract on the blockchain. | |
import qualified Language.PlutusTx as PlutusTx | |
import qualified Ledger.Interval as Interval | |
import Ledger.Interval (SlotRange) | |
import qualified Language.PlutusTx.Prelude as P |
-- | Crowdfunding contract implemented using the [[Plutus]] interface. | |
-- This is the fully parallel version that collects all contributions | |
-- in a single transaction. | |
-- | |
-- Note [Transactions in the crowdfunding campaign] explains the structure of | |
-- this contract on the blockchain. | |
import qualified Language.PlutusTx as PlutusTx | |
import qualified Ledger.Interval as Interval | |
import Ledger.Interval (SlotRange) | |
import qualified Language.PlutusTx.Prelude as P |