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 GADT.Main where | |
import Prelude (class Category, class Semigroupoid, (<<<), flip, identity, ($), (+), (==)) | |
import Unsafe.Coerce (unsafeCoerce) | |
newtype Leibniz a b = Leibniz (forall f. f a -> f b) | |
infix 4 type Leibniz as ~ | |
instance semigroupoidLeibniz :: Semigroupoid Leibniz 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
module MontyHall.Main where | |
import Prelude | |
import Data.Foldable (foldr) | |
import Data.List.Lazy (range) | |
import Data.Tuple (Tuple(..)) | |
import Debug.Trace (class DebugWarning, spy) | |
import Effect (Effect) | |
import Effect.Random (randomInt) |
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 Algebra where | |
import Prelude | |
import Control.Monad.Eff (Eff) | |
import Data.Maybe (Maybe(..)) | |
newtype ConsoleAlg f = ConsoleAlg | |
{ printLn :: String -> f Unit | |
, readLn :: f String |
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 com.sun.istack.internal.NotNull; | |
import static io.vavr.API.*; | |
import io.vavr.collection.List; | |
import io.vavr.control.Option; | |
import lombok.AccessLevel; | |
import lombok.AllArgsConstructor; | |
import lombok.Value; | |
import java.math.BigDecimal; |
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 Loeb where | |
import Prelude | |
import Data.Lazy (Lazy, defer, force) | |
import Data.Array ((!!)) | |
import Data.Maybe (fromMaybe) | |
loeb :: ∀ f a. Functor f => f (f (Lazy a) -> a) -> f (Lazy a) | |
loeb x = go where go = map (\y -> defer (\_ -> y go)) x |
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 Collatz where | |
import Prelude (div, otherwise, (==), (*), (+), (>), ($), map) | |
import Data.Array (length) | |
import Data.Ord (class Ord) | |
import Data.Semiring (class Semiring, zero) | |
import Data.Functor (class Functor) | |
import Data.Int (even) | |
import Data.Maybe (Maybe(..)) | |
import Data.Tuple (Tuple(..)) |
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 Main where | |
import Prelude (($), (<>), map, (<<<)) | |
import Data.Map as M | |
import Data.Ord (class Ord) | |
import Data.Semigroup (class Semigroup) | |
import Data.Monoid (class Monoid, mempty) | |
import Data.Show (class Show, show) | |
import Data.String.CodeUnits (toCharArray) | |
import Data.Foldable as F |
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 Main where | |
import Prelude (($)) | |
import Data.Map (Map, empty, lookup, insert) | |
import Data.Ord (class Ord) | |
import Data.String (toCodePointArray, CodePoint) | |
import Data.Foldable (foldl) | |
import Data.Maybe (fromMaybe) | |
import Data.List (List(..), (:), fromFoldable) |
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
var cashaddrjs = require('cashaddrjs'); | |
var bitcore = require('bitcore-lib'); | |
var bitcoreCash = require('bitcore-lib-cash'); | |
// Get a bitcore.Address object for any address type | |
// - Legacy (BTC-style) | |
// - Copay (BitPay, probably will be deprecated?) | |
// - Cashaddr (new BCH format) | |
var getAddressObj = function(addressStr) { | |
try { |
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.Fin | |
import Data.So | |
-- %default total | |