func (l *Literal) Blob() ([]byte, error) {
	if l.t != Blob {
		return nil, fmt.Errorf("literal.Blob: literal is of type %v; cannot be converted to a []byte", l.t)
	}
	return l.v.([]byte), nil
}
Blob returns the value of a literal as a []byte.
package literal
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"math"
	"strconv"
	"strings"
	"github.com/pborman/uuid"
)
type Type uint8
const (
	Bool Type = iota
	Int64
	Float64
	Text
	Blob
)
func (t Type) String() string {
	switch t {
	case Bool:
		return "bool"
	case Int64:
		return "int64"
	case Float64:
		return "float64"
	case Text:
		return "text"
	case Blob:
		return "blob"
	default:
		return "UNKNOWN"
	}
}
type Literal struct {
	t Type
	v interface{}
}
func (l *Literal) Type() Type {
	return l.t
}
func (l *Literal) String() string {
	return fmt.Sprintf("\"%v\"^^type:%v", l.Interface(), l.Type())
}
func (l *Literal) ToComparableString() string {
	s := ""
	switch l.t {
	case Int64:
		s = fmt.Sprintf("\"%032d\"^^type:%v", l.Interface(), l.Type())
	case Float64:
		s = fmt.Sprintf("\"%032f\"^^type:%v", l.Interface(), l.Type())
	default:
		s = l.String()
	}
	return s
}
func (l *Literal) Bool() (bool, error) {
	if l.t != Bool {
		return false, fmt.Errorf("literal.Bool: literal is of type %v; cannot be converted to a bool", l.t)
	}
	return l.v.(bool), nil
}
func (l *Literal) Int64() (int64, error) {
	if l.t != Int64 {
		return 0, fmt.Errorf("literal.Int64: literal is of type %v; cannot be converted to a int64", l.t)
	}
	return l.v.(int64), nil
}
func (l *Literal) Float64() (float64, error) {
	if l.t != Float64 {
		return 0, fmt.Errorf("literal.Float64: literal is of type %v; cannot be converted to a float64", l.t)
	}
	return l.v.(float64), nil
}
func (l *Literal) Text() (string, error) {
	if l.t != Text {
		return "", fmt.Errorf("literal.Text: literal is of type %v; cannot be converted to a string", l.t)
	}
	return l.v.(string), nil
}