urbit-hob-0.3.3: Hoon-style atom manipulation and printing functions

Copyright(c) 2019 Jared Tobin
LicenseMIT
MaintainerJared Tobin <jared@jtobin.io>
Stabilityunstable
Portabilityghc
Safe HaskellNone
LanguageHaskell2010

Urbit.Ob.Title

Description

Functions for determining ship class and parentage.

Analogous to the +title arm of zuse.hoon.

Synopsis

Documentation

data Class Source #

Ship class.

Constructors

Galaxy

8-bit atom

Star

16-bit atom

Planet

32-bit atom

Moon

64-bit atom

Comet

128-bit atom

Instances
Eq Class Source # 
Instance details

Defined in Urbit.Ob.Title

Methods

(==) :: Class -> Class -> Bool #

(/=) :: Class -> Class -> Bool #

Show Class Source # 
Instance details

Defined in Urbit.Ob.Title

Methods

showsPrec :: Int -> Class -> ShowS #

show :: Class -> String #

showList :: [Class] -> ShowS #

clan :: Patp -> Class Source #

Determine ship class.

>>> let fes = patp 255
>>> let fipfes = patp 256
>>> let dostec = patp 0xFFFFFFFF
>>> let risfen = patp 0xFFFFFFFFFFFFFFFF
>>> let fipfesfipfes = patp 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
>>> clan fes
Galaxy
>>> clan fipfes
Star
>>> clan dostec
Planet
>>> clan risfen
Moon
>>> clan fipfesfipfes
Comet

sein :: Patp -> Patp Source #

Determine parent.

A ship's parent signs for it on the network. sein establishes the so-called autoboss of a ship (which can escape to another sponsor).

Note that galaxies sign for themselves, and stars sign for comets.

>>> sein fes
~fes
>>> sein fipfes
~fes
>>> sein dostec
~fipfes
>>> sein risfen
~dostec-risfen
>>> sein fipfesfipfes
~fipfes