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'
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 :: *)
|-- Formatting AST.|
|= FInt Format|
|| FString Format|
|| FOther Char Format|
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
firstname.lastname@example.org 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.
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))|
This gist demonstrates a trick I came up with which is defining
Q (TExp a), where
lift-able. This allows you
$$("...") and have the string parsed at compile-time.
On GHC 9, you are able to write
This offers a light-weight way to enforce compile-time constraints. It's
OverloadedStrings with static checks. The inferred return type