Guest User

Untitled

a guest
Jul 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. |%
  2. ++ diff-type
  3. |= =type
  4. ^+ type
  5. ::
  6. ?@ type
  7. ?- type
  8. %noun -:!>(*(list [axis=@ud new-value=*]))
  9. %void ~| %void-type !!
  10. ==
  11. ?- -.type
  12. %atom
  13. :: constants have no diffs; other atoms are replaced wholesale
  14. ::
  15. ?~ constant=q.type
  16. type
  17. [%atom %n `~]
  18. ::
  19. %cell
  20. ::
  21. :+ %cell
  22. [%face [~ %head] (unit-type $(type p.type))]
  23. [%face [~ %tail] (unit-type $(type q.type))]
  24. ::
  25. %core
  26. ~| %core-type !!
  27. ::
  28. %face
  29. ::
  30. ?> ?=(~ p.p.type)
  31. ?> ?=(term q.p.type)
  32. ::
  33. [%face [~ q.p.type] $(type q.type)]
  34. ::
  35. %fork
  36. ::
  37. :- %fork
  38. %- ~(run in p.type)
  39. |= tine=^type
  40. ^+ type
  41. ::
  42. :- %fork
  43. %- ~(gas in *(set ^type))
  44. :~ [%cell [%atom %tas `%replace] ^$(type tine)]
  45. [%cell [%atom %tas `%switch] type(p (~(del in p.type) tine))]
  46. ==
  47. ::
  48. %help
  49. $(type q.type) :: TODO preserve doc
  50. ::
  51. %hold
  52. ::
  53. :+ %hold
  54. :+ %cell
  55. [%face [~ %diff-type-core] -:!>(..diff-type)]
  56. [%face [~ %played-type] (~(play ut p.type) q.type)]
  57. ^- hoon
  58. [%cnhp [%wing ~[%diff-type %diff-type-core]] [%wing ~[%played-type]]~]
  59. ==
  60. :: construct a +type for a +unit whose non-nil value is of type :some-type
  61. ::
  62. ++ unit-type
  63. |= some-type=type
  64. ^- type
  65. ::
  66. :- %fork
  67. %- ~(gas in *(set type))
  68. ~[nil-type [%cell nil-type [%face [~ %u] some-type]]]
  69. :: convenience arm for a type representing a constant nil
  70. ::
  71. ++ nil-type `type`[%atom %n `~]
  72. --
Add Comment
Please, Sign In to add comment