Code in Go that propagates errors can get pretty verbose. For example:
a, err := ...
if err != nil {
return nil, err
}
b, err := ...
> import Control.Monad(MonadPlus(mzero),liftM,unless) | |
The regular filter can be implemented recursively: | |
> f1 _ [] = [] | |
> f1 test (a:as) | test a = a : f1 test as | otherwise = f1 test as | |
Or the recursion can be abstracted: | |
> f2 test list = foldr (\ a rest -> if test a then a : rest else rest) [] list |
-- Implementation of version 1.1 of http://0x10c.com/doc/dcpu-16.txt. | |
-- This work is public domain. | |
module DCPU16 where | |
import Control.Monad(foldM) | |
import Data.Array.IO(IOArray) | |
import Data.Array.MArray(newListArray,readArray,writeArray) | |
import Data.Bits((.&.),(.|.),shiftL,shiftR,xor) | |
import Data.Ix(Ix) | |
import Data.Word(Word16,Word32) |
-- A friend interviewed at Google and was given the task of | |
-- making a linked list from a binary tree where an element's | |
-- next element is its sibling, or null where there is none. | |
-- Example: | |
-- A | |
-- / \ | |
-- / \ | |
-- B C | |
-- / / \ |
The type of futuristic 3D display I'm considering would be pixel-based flat surface, like today's displays. The futuristic part is that each pixel controls what color gets emitted in a number of directions.
If such a display were used to display a 3D image, then it should be like looking through a window, where different viewing angles give the
When choosing a technology, "because it's what you know" is always a good reason, but it's not always a good _enough_ reason. |
Google ought to make a phone called the Google Jaw, or gJaw, which we could use to access the Reticulum. |