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
{ | |
"account_proof": { | |
"contract_address": "0x2d567ece699eabe5afcd141edb7a4f2d0d6ce8a0", | |
"storage_root": "0x45ce654a39242d3bbe4617ab1f35fc4c0faddfba50da571524b1f7bbad543c3e", | |
"proof": [ | |
"0xf90211a096dbb5271b8dd44c45b01f1e1b1d2ca07f047629f2fa25908a1dd5683e67a8e6a06864c8d60c631b43dd8cc16a10dec93b74eac4861e3a79265915bf157f136f46a01ff65fcc26e6b3597b4a28c6c9abce8f9fc6c631baede1ac2146f182607f5de7a07275b71377c40a09d8289f247a61afe25021b56d3fe2b37e0ecd0a0492e564b9a001aaa6b9c8d9b04af384a614a0f87bac02b96a92d5be36aa7a60d778a14f44c0a05b49926c77f052f90f5e184d60a35bcc6732389fd353acf5f66114b904002322a04de0d4335b6cdb439b614c31262ddb4f2d264ba4862796852847591509382c5ba05f8c7d4919ba6c617d61ae0843041747879fd5feb1c457aa8ef499c3d3cbe235a088d49a54592d0d6d72eea514d0387856120fa9062e8a1a83f1e82eda7346843ba079b7d1f2e13e1074e704d3f887f8ab4ec0523911a4a0ea9bfff5f155bc979de1a0c16335dd7c96a0ef2d531fdd784ba497b2935ea937b6c92e71ed5aa556078b87a0a782dd90a6a95402ce34607c87a32dd828cf9c86992283fddfb2829ed4adb7d |
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
inductive Vector (α : Type u) : Nat -> Type u | |
| nil : Vector α 0 | |
| cons : α -> {n : Nat} -> Vector α n -> Vector α (n + 1) | |
infixr:80 " :- " => Vector.cons | |
namespace Vector | |
def append : Vector α m -> Vector α n -> Vector α (m + n) | |
|cons x xs, v => |
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
#[inline(always)] | |
pub fn jmp<'a>(k: i64, e: Env<'a>) { | |
let k: Compiled<'a> = unsafe { core::mem::transmute(HandlersTable[k as usize]) }; | |
k.0(e) | |
} | |
pub fn program_end<'a>(e: Env<'a>) {} | |
pub fn impossible<'a>(e: Env<'a>) { | |
unreachable!() |
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
/* automatically generated by rust-bindgen 0.56.0 */ | |
#[repr(C)] | |
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] | |
pub struct __BindgenBitfieldUnit<Storage, Align> { | |
storage: Storage, | |
align: [Align; 0], | |
} | |
impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> { | |
#[inline] |
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
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
import Control.Applicative | |
import Control.Lens | |
import Control.Monad |
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
day9 :: IO () | |
day9 = do | |
values <- parse <$> input "day9.txt" | |
let e = invalidElement values | |
-- part 1 | |
print e | |
-- part 2 | |
print $ findContiguousSum values =<< e | |
where | |
parse = |
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
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
-- many imports are not used for this exercice | |
import Control.Applicative | |
import Control.Lens |
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
day5 :: IO () | |
day5 = do | |
currentlyUsedSeatIds <- | |
fmap | |
(toSeatId | |
. over both (getSum . ifoldMap (fmap Sum . step) . T.unpack) | |
. T.splitAt 7) | |
<$> input "day5.txt" | |
-- part 1 | |
print $ maximum currentlyUsedSeatIds |
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 Control.Applicative | |
import Control.Lens | |
import qualified Data.Attoparsec.Text.Lazy as A | |
import Data.Char | |
import Control.Monad | |
import Data.Either | |
import Data.Foldable | |
import Data.Functor | |
import Data.Int | |
import Data.Ix |
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
{-# LANGUAGE DerivingStrategies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE UnicodeSyntax #-} | |
module Main where |
NewerOlder