urbit-hob

Haskell utilities for phonemic base wrangling.
git clone git://git.jtobin.io/urbit-hob.git
Log | Files | Refs | README | LICENSE

urbit-hob.cabal (3882B)


      1 name:           urbit-hob
      2 version:        0.3.3
      3 synopsis:       Hoon-style atom manipulation and printing functions
      4 homepage:       https://github.com/urbit/urbit-hob
      5 bug-reports:    https://github.com/urbit/urbit-hob/issues
      6 author:         Jared Tobin
      7 maintainer:     jared@jtobin.io
      8 copyright:      2019 Jared Tobin
      9 category:       Urbit
     10 license:        MIT
     11 license-file:   LICENSE
     12 build-type:     Simple
     13 tested-with:    GHC == 8.6.5, GHC == 8.8.3
     14 cabal-version:  >= 1.10
     15 description:
     16   Here you can primarily find functions for dealing with the \"patp\" and
     17   \"patq\" /phonetic bases/ used by Urbit.  The \@p encoding is used for naming
     18   ships, while the \@q encoding is used for arbitrary data; they each uniquely
     19   represent an underlying natural number (or /atom/) in a memorable and
     20   pronounceable fashion.
     21   .
     22   The \@p encoding is an /obfuscated/ representation of an underlying atom, in
     23   particular, hence the \"ob\" in the library's name.
     24   .
     25   The @Urbit.Ob@ module exposes two families of functions, 'patp' and
     26   'fromPatp', and then 'patq' and 'fromPatq', for converting between
     27   representations.  You can also render a 'Patp' or 'Patq' value as 'Text' via
     28   the 'renderPatp' and 'renderPatq' functions, or parse them from 'Text' via
     29   'parsePatp' and 'parsePatq'.
     30   .
     31   Since \@p values represent ships, some utilities for dealing with ships are
     32   also exposed.  The 'clan' and 'sein' functions are useful for determining a
     33   ship's class and (default) parent, respectively.
     34   .
     35   Some quick examples:
     36   .
     37   >>> :set -XOverloadedStrings
     38   >>> import qualified Urbit.Ob as Ob
     39   >>> let nidsut = Ob.patp 15663360
     40   >>> let marzod = Ob.patq (Ob.fromPatp nidsut)
     41   >>> Ob.renderPatp nidsut
     42   "~nidsut-tomdun"
     43   >>> Ob.renderPatq marzod
     44   "~mun-marzod"
     45   >>> Ob.fromPatp nidsut
     46   15663360
     47   >>> Ob.parsePatp "~nidsut-tomdun"
     48   Right ~nidsut-tomdun
     49   >>> Ob.clan nidsut
     50   Planet
     51   >>> Ob.sein nidsut
     52   ~marzod
     53 
     54 extra-source-files:
     55   CHANGELOG
     56 
     57 source-repository head
     58   type: git
     59   location: https://github.com/urbit/urbit-hob
     60 
     61 flag release
     62   Description:  Build for release
     63   Default:      False
     64   Manual:       True
     65 
     66 library
     67   default-language: Haskell2010
     68   hs-source-dirs:   lib
     69 
     70   if flag(release)
     71     ghc-options:     -Wall
     72   else
     73     ghc-options:     -Wall -Werror
     74 
     75   exposed-modules:
     76       Urbit.Ob
     77     , Urbit.Ob.Co
     78     , Urbit.Ob.Muk
     79     , Urbit.Ob.Ob
     80     , Urbit.Ob.Title
     81 
     82   other-modules:
     83       Data.Serialize.Extended
     84 
     85   build-depends:
     86       base        >= 4.7  && < 6
     87     , bytestring  >= 0.10 && < 1
     88     , murmur3     >= 1.0  && < 2
     89     , text        >= 1.2  && < 2
     90     , vector      >= 0.12 && < 1
     91 
     92 Test-suite ob
     93   type:                exitcode-stdio-1.0
     94   hs-source-dirs:      test
     95   main-is:             Ob.hs
     96   other-modules:
     97     Ob.Tests.Small
     98     Ob.Tests.Med
     99     Ob.Tests.Property
    100     Ob.Tests.Unit
    101   default-language:    Haskell2010
    102   ghc-options:
    103     -rtsopts
    104   build-depends:
    105       base
    106     , hspec
    107     , hspec-core
    108     , QuickCheck
    109     , urbit-hob
    110 
    111 Test-suite co
    112   type:                exitcode-stdio-1.0
    113   hs-source-dirs:      test
    114   main-is:             Co.hs
    115   other-modules:
    116     Co.Tests.Property
    117     Co.Tests.Unit
    118   default-language:    Haskell2010
    119   ghc-options:
    120     -rtsopts
    121   build-depends:
    122       base
    123     , hspec
    124     , hspec-core
    125     , QuickCheck
    126     , text
    127     , urbit-hob
    128 
    129 Test-suite title
    130   type:                exitcode-stdio-1.0
    131   hs-source-dirs:      test
    132   main-is:             Title.hs
    133   other-modules:
    134     Title.Tests.Property
    135   default-language:    Haskell2010
    136   ghc-options:
    137     -rtsopts
    138   build-depends:
    139       base
    140     , hspec
    141     , QuickCheck
    142     , urbit-hob
    143 
    144 benchmark ob-bench
    145   type:                exitcode-stdio-1.0
    146   hs-source-dirs:      bench
    147   main-is:             Ob.hs
    148   default-language:    Haskell2010
    149   ghc-options:
    150     -rtsopts -O2
    151   build-depends:
    152       base
    153     , criterion
    154     , deepseq
    155     , urbit-hob
    156