23-09-28 20:13:14.751 $ nix shell https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz --extra-experimental-features nix-command --extra-experimental-features flakes
error: flake 'https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/archive/master/ghc-wasm-meta-master.tar.gz' does not provide attribute 'packages.x86_64-linux.defaultPackage.x86_64-linux', 'legacyPackages.x86_64-linux.defaultPackage.x86_64-linux' or 'defaultPackage.x86_64-linux'
Exploring possibilities with simple indexed fields
Database records and formlets and optionally populated records can be neatly all represented with the same data type when the fields are all indexed.
class Indexed i a where
type Index i (a :: *)
Typing Haskell in Haskell
MARK P. JONES
Pacific Software Research Center
Department of Computer Science and Engineering
Oregon Graduate Institute of Science and Technology
module Printf | |
%default total | |
-- Formatting AST. | |
data Format | |
= FInt Format | |
| FString Format | |
| FOther Char Format | |
| FEnd |
Common
export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS
Linux kernel
Email message parsing in Haskell in 2018
Background: I am moving away from GMail to my own Haskell-based
server (SMTP receiver/sender, web-based email client, spam filtering,
etc.). All email to @chrisdone.com
goes through this server
(mx.chrisdone.com
) as of today, and chrisdone@gmail.com
forwards a
copy of everything to it.
This is a summary/tracking document of my efforts to simply parse email messages in Haskell for the SMTP receiver.
Type Inference: Various Designs
I'm exploring the right data types for writing a type inference with higher kinds and poly types.
Putting more things in the type system can force you to think about more things, but it also can make it harder and more verbose to write and read algorithms.
- This one implements a fairly good type inferer, with a free monad, but kinds are not enforced, and forall/schemes are not considered atll.
- This one pushes kinds and generic vars into the type system with a nested tuples approach
- This one borrows from Oleg's typed eval, but doesn't actually implement any hard things yet.
(defun shoe-write-script (script) | |
"Write SCRIPT to the proper place." | |
(let* ((script-dir (shoe-script-dir script)) | |
(script-path (shoe-script-file-path "/" script-dir))) | |
(with-temp-file script-path (insert script)))) | |
(defun shoe-script-file-path (script &optional dir) | |
"Produce the file path for SCRIPT." | |
(concat (or dir (shoe-script-dir script)) | |
"/" |
output/ |
Statically checked overloaded strings
This gist demonstrates a trick I came up with which is defining
IsString
for Q (TExp a)
, where a
is lift
-able. This allows you
to write $$("...")
and have the string parsed at compile-time.
On GHC 9, you are able to write $$"..."
instead.
This offers a light-weight way to enforce compile-time constraints. It's
basically OverloadedStrings
with static checks. The inferred return type