❤️🔥
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 ParentView where | |
import Prelude | |
import Halogen as H | |
import Halogen.HTML as HH | |
import Halogen.HTML.Events as HE | |
import Halogen.HTML.Properties as HP | |
import Data.Maybe (Maybe(..)) | |
import Control.Monad.Aff (Aff) |
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
# ETHEREUM_SCHEME=https ETHEREUM_HOST="ropsten.infura.io" ETHEREUM_PORT=443 iex -S mix | |
Application.put_env(EVM, :debugger, true) | |
EVM.Debugger.Breakpoint.init() | |
EVM.Debugger.Breakpoint.set_breakpoint(%EVM.Debugger.Breakpoint{conditions: [address: <<188, 31, 252, 22, 32, 218, 20, 104, 98, 74, 89, 108, 184, 65, 211, 94, 107, 47, 31, 182>>]}) | |
load_hex = fn("0x" <> hex_string) -> | |
padded_hex_string = if rem(byte_size(hex_string), 2) == 1, do: "0" <> hex_string, else: hex_string | |
{:ok, hex} = Base.decode16(padded_hex_string, case: :lower) |
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 Test.RowListMaps where | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
import Data.Maybe (fromJust) | |
import Data.StrMap as SM | |
import Data.Tuple (Tuple(..)) | |
import Data.Variant (Variant, inj, SProxy(..)) | |
import Global.Unsafe (unsafeStringify) | |
import Partial.Unsafe (unsafePartial) |
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 MapRecordWithComments where | |
-- | Type-level Tomfoolery. A million thankyous to @kcsongor and his | |
-- | unparallelled patience with me while I try to figure this stuff | |
-- | out. | |
import Prelude (($), (+), (<>), discard, show) | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) |
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 (main, zip, zipRecord, class ZipRowList) where | |
-- | After Tuesday's experiments, let's move onto a slightly more | |
-- | interesting example. Last time, I confess, I cheated a bit to | |
-- | avoid getting too deep into RowToList stuff. Today, I'm not | |
-- | going to cheat, and get riiiight into it. When we're thirty lines | |
-- | in, don't say you weren't warned! | |
import Prelude (($), discard, Unit) | |
import Control.Monad.Eff (Eff) |
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 Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, logShow) | |
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol) | |
import Type.Proxy (Proxy(..)) | |
import Type.Row (class ListToRow, class RowToList, Cons, Nil, kind RowList) |
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
{- | |
This is just adventuring with RowToList. | |
Naive approach, not stack safe, probably too slow. | |
-} | |
module DiffRecords | |
where | |
import Data.Record (get, insert) | |
import Data.Symbol (class IsSymbol, SProxy(..)) |
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
class SemigroupJoinRecord rl (row ∷ # Type) where | |
appendRecordsImpl :: RLProxy rl → Record row -> Record row -> Record row | |
instance semigroupJoinRecordCons ∷ (Semigroup ty, RowCons name ty row' row, SemigroupJoinRecord tail row, IsSymbol name) ⇒ SemigroupJoinRecord (Cons name ty tail) row where | |
appendRecordsImpl _ r1 r2 = | |
let | |
_name = (SProxy ∷ SProxy name) | |
v1 = get _name r1 |
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.Foldable (fold, elem) | |
import TryPureScript | |
import Type.Row (class ListToRow, class RowToList, Cons, Nil, kind RowList) | |
import Type.Proxy (Proxy(..)) | |
import Type.Data.Symbol (class IsSymbol, reflectSymbol) | |
import Data.Array (cons) | |
import Data.Monoid (mempty) |
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 (main, zip, zipRecord, class ZipRowList) where | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
import Data.Record (get, insert) | |
import Data.Symbol (class IsSymbol, SProxy(..)) | |
import Data.These (These(..)) | |
import Global.Unsafe (unsafeStringify) | |
import Prelude (Unit, discard) | |
import Type.Row |
NewerOlder