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 Data.ByteString qualified as BS | |
import Data.ByteString.Char8 qualified as BSC | |
import Data.Char (isDigit) | |
main :: IO () | |
main = do | |
content <- BS.readFile "input.txt" | |
let lines_sep = BSC.lines content | |
let x = fmap (take_first_and_last . filter isDigit) (BSC.unpack <$> lines_sep) |
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
benchmarked sexp/fpbasic | |
time 3.193 ms (3.073 ms .. 3.357 ms) | |
0.989 R² (0.978 R² .. 0.998 R²) | |
mean 2.960 ms (2.928 ms .. 3.023 ms) | |
std dev 145.1 μs (89.51 μs .. 250.5 μs) | |
variance introduced by outliers: 28% (moderately inflated) | |
benchmarked sexp/fpstateful | |
time 3.417 ms (3.346 ms .. 3.471 ms) | |
0.997 R² (0.995 R² .. 0.999 R²) |
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
use std::boxed::Box; | |
#[derive(Clone, Debug)] | |
enum Expr { | |
VAR(String), | |
APP { func: Box<Expr>, arg: Box<Expr> }, | |
LAM { arg: String, body: Box<Expr> }, | |
} | |
type Env = Vec<(String, Val)>; |
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
use std::boxed::Box; | |
/// Simply typed lambda calculus is based on untyped lambda calculus, but | |
/// added a simple type. (Which is the function type A -> B) | |
#[derive(PartialEq, Eq, Debug)] | |
enum Type { | |
/// Base type | |
BuiltIn(&'static str), Var(String), | |
/// Function type (Type * Type) | |
Lambda(Box<Type>, Box<Type>), |
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
-- 'Topoi Core' is basically the desugared topoi language. | |
-- Only consists of basic primitive atoms and functions. | |
-- This is largely referenced to the ML language, Pie language from the book | |
-- 'The Little Typer' and (GHC Core) | |
-- [https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/core-syn-type] | |
-- write once variable, top level no need to write `let` | |
n = 3 |
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
-- comments | |
--| doc comments (default markdown) | |
--| prefix | prefixed comments | |
--[ block comment | |
]-- | |
--[ prefix | | |
prefixed block comment | |
]-- |
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
-- comments | |
--| doc comments, should support latex (my dream) | |
--|prefix| prefixed comments | |
--[block comment]-- | |
--[prefix| prefixed block comment]-- | |
[1, 2, 3] -- lists | |
1 :: 2 :: 3 :: [] -- list | |
-- Types, should starts with uppercase letters |
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
-- single line comment, no multi-line comment allowed. Keep it simple, okay ? | |
-- https://futhark-lang.org/blog/2017-10-10-block-comments-are-a-bad-idea.html | |
--------------------------------------------------- | |
-- Functions and Values Assignment -- | |
--------------------------------------------------- | |
let varname = 1 | |
let varname_with_type: Bool = true | |
-- ^-- values name ^-- type |
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
# Install dependencies | |
# | |
# * checkinstall: package the .deb | |
# * libpcre3, libpcre3-dev: required for HTTP rewrite module | |
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module | |
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \ | |
mkdir -p ~/sources/ && \ | |
# Compile against OpenSSL to enable NPN |
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
<link rel="import" href="../topeka-elements/theme.html"> | |
<link rel="import" href="../topeka-elements/topeka-resources.html"> | |
<link rel="import" href="../topeka-elements/topeka-app.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
NewerOlder