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 :: *)
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
D [0-9] | |
L [a-zA-Z_] | |
H [a-fA-F0-9] | |
E ([Ee][+-]?{D}+) | |
P ([Pp][+-]?{D}+) | |
FS (f|F|l|L) | |
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U)) | |
%{ | |
#include <stdio.h> |
The following are appendices from Optics By Example, a comprehensive guide to optics from beginner to advanced! If you like the content below, there's plenty more where that came from; pick up the book!
Audience: I assume you heard of chatGPT, maybe played with it a little, and was imressed by it (or tried very hard not to be). And that you also heard that it is "a large language model". And maybe that it "solved natural language understanding". Here is a short personal perspective of my thoughts of this (and similar) models, and where we stand with respect to language understanding.
Around 2014-2017, right within the rise of neural-network based methods for NLP, I was giving a semi-academic-semi-popsci lecture, revolving around the story that achieving perfect language modeling is equivalent to being as intelligent as a human. Somewhere around the same time I was also asked in an academic panel "what would you do if you were given infinite compute and no need to worry about labour costs" to which I cockily responded "I would train a really huge language model, just to show that it doesn't solve everything!". We
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable, TypeFamilies, TemplateHaskell #-} | |
import Data.Functor.Foldable | |
import Data.Functor.Foldable.TH | |
import Data.Functor.Compose | |
-- Example type | |
data Exp | |
= IntValue Int | |
| Sum Exp Exp |
{-# LANGUAGE MultiParamTypeClasses, ExistentialQuantification, ScopedTypeVariables, FlexibleInstances, FlexibleContexts, UndecidableInstances #-} | |
module TransientCont where | |
-- some imports | |
import Control.Applicative | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans |