Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "metadata": {
- "language": "haskell",
- "name": "",
- "signature": "sha256:cc5b338500a1cc5d224712a3de9e898eeea417ac3c1d87a6cf3d073800ee3dde"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- ":set -XTypeFamilies\n",
- ":set -XDataKinds"
- ],
- "language": "python",
- "metadata": {
- "hidden": false
- },
- "outputs": [],
- "prompt_number": 1
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "import Data.Metrology\n",
- "import Data.Metrology.SI\n",
- "import Data.Metrology.Show"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [],
- "prompt_number": 2
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "data AngleDim = AngleDim\n",
- "data Radian = Radian\n",
- "\n",
- "instance Dimension AngleDim where\n",
- " type DimFactorsOf AngleDim = '[]\n",
- "\n",
- "type instance DefaultUnitOfDim AngleDim = Radian\n",
- "\n",
- "instance Unit Radian where\n",
- " type BaseUnit Radian = Canonical\n",
- " type DimOfUnit Radian = AngleDim\n",
- " type UnitFactorsOf Radian = '[]"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [],
- "prompt_number": 3
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "0.3 % Radian"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "metadata": {},
- "output_type": "display_data",
- "text": [
- "0.3"
- ]
- }
- ],
- "prompt_number": 4
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "instance Show Radian where\n",
- " show _ = \"rad\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [],
- "prompt_number": 5
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "0.3 % Radian"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "html": [
- "<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>"
- ],
- "metadata": {},
- "output_type": "display_data",
- "text": [
- "Could not deduce (Unit Radian) arising from a use of \u2018%\u2019\n",
- "from the context (Fractional n) bound by the inferred type of it :: Fractional n => Qu '[] 'DefaultLCSU n at <interactive>:1:1-12\n",
- "In the expression: 0.3 % Radian\n",
- "In an equation for \u2018it\u2019: it = 0.3 % Radian"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [],
- "language": "python",
- "metadata": {
- "hidden": false
- },
- "outputs": []
- }
- ],
- "metadata": {}
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement