Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. {
  2. "metadata": {
  3. "language": "haskell",
  4. "name": "",
  5. "signature": "sha256:cc5b338500a1cc5d224712a3de9e898eeea417ac3c1d87a6cf3d073800ee3dde"
  6. },
  7. "nbformat": 3,
  8. "nbformat_minor": 0,
  9. "worksheets": [
  10. {
  11. "cells": [
  12. {
  13. "cell_type": "code",
  14. "collapsed": false,
  15. "input": [
  16. ":set -XTypeFamilies\n",
  17. ":set -XDataKinds"
  18. ],
  19. "language": "python",
  20. "metadata": {
  21. "hidden": false
  22. },
  23. "outputs": [],
  24. "prompt_number": 1
  25. },
  26. {
  27. "cell_type": "code",
  28. "collapsed": false,
  29. "input": [
  30. "import Data.Metrology\n",
  31. "import Data.Metrology.SI\n",
  32. "import Data.Metrology.Show"
  33. ],
  34. "language": "python",
  35. "metadata": {},
  36. "outputs": [],
  37. "prompt_number": 2
  38. },
  39. {
  40. "cell_type": "code",
  41. "collapsed": false,
  42. "input": [
  43. "data AngleDim = AngleDim\n",
  44. "data Radian = Radian\n",
  45. "\n",
  46. "instance Dimension AngleDim where\n",
  47. " type DimFactorsOf AngleDim = '[]\n",
  48. "\n",
  49. "type instance DefaultUnitOfDim AngleDim = Radian\n",
  50. "\n",
  51. "instance Unit Radian where\n",
  52. " type BaseUnit Radian = Canonical\n",
  53. " type DimOfUnit Radian = AngleDim\n",
  54. " type UnitFactorsOf Radian = '[]"
  55. ],
  56. "language": "python",
  57. "metadata": {},
  58. "outputs": [],
  59. "prompt_number": 3
  60. },
  61. {
  62. "cell_type": "code",
  63. "collapsed": false,
  64. "input": [
  65. "0.3 % Radian"
  66. ],
  67. "language": "python",
  68. "metadata": {},
  69. "outputs": [
  70. {
  71. "metadata": {},
  72. "output_type": "display_data",
  73. "text": [
  74. "0.3"
  75. ]
  76. }
  77. ],
  78. "prompt_number": 4
  79. },
  80. {
  81. "cell_type": "code",
  82. "collapsed": false,
  83. "input": [
  84. "instance Show Radian where\n",
  85. " show _ = \"rad\""
  86. ],
  87. "language": "python",
  88. "metadata": {},
  89. "outputs": [],
  90. "prompt_number": 5
  91. },
  92. {
  93. "cell_type": "code",
  94. "collapsed": false,
  95. "input": [
  96. "0.3 % Radian"
  97. ],
  98. "language": "python",
  99. "metadata": {},
  100. "outputs": [
  101. {
  102. "html": [
  103. "<span class='err-msg'>Could not deduce (Unit Radian) arising from a use of \u2018%\u2019<br/>from the context (Fractional n) bound by the inferred type of it :: Fractional n => Qu '[] 'DefaultLCSU n at <interactive>:1:1-12<br/>In the expression: 0.3 % Radian<br/>In an equation for \u2018it\u2019: it = 0.3 % Radian</span>"
  104. ],
  105. "metadata": {},
  106. "output_type": "display_data",
  107. "text": [
  108. "Could not deduce (Unit Radian) arising from a use of \u2018%\u2019\n",
  109. "from the context (Fractional n) bound by the inferred type of it :: Fractional n => Qu '[] 'DefaultLCSU n at <interactive>:1:1-12\n",
  110. "In the expression: 0.3 % Radian\n",
  111. "In an equation for \u2018it\u2019: it = 0.3 % Radian"
  112. ]
  113. }
  114. ],
  115. "prompt_number": 6
  116. },
  117. {
  118. "cell_type": "code",
  119. "collapsed": false,
  120. "input": [],
  121. "language": "python",
  122. "metadata": {
  123. "hidden": false
  124. },
  125. "outputs": []
  126. }
  127. ],
  128. "metadata": {}
  129. }
  130. ]
  131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement