Last active
August 29, 2015 14:22
-
-
Save nushio3/4b6ac221d46bb52a101c to your computer and use it in GitHub Desktop.
uom-plugin lesson
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS_GHC -fplugin Data.UnitsOfMeasure.Plugin #-} | |
{-# LANGUAGE DataKinds, QuasiQuotes, TypeOperators #-} | |
{-# LANGUAGE TypeFamilies, UndecidableInstances #-} | |
import Data.UnitsOfMeasure | |
main :: IO () | |
main = print ([u| 3 m |] :: Quantity Int [u| m |]) | |
{- | |
(7.10.1)nushio@nuwheezy:uom-plugin$ ghc learn.hs | |
[1 of 1] Compiling Main ( learn.hs, learn.o ) | |
learn.hs:8:8: | |
No instance for (Data.UnitsOfMeasure.Singleton.KnownUnit | |
(Unpack (MkUnit "m"))) | |
arising from a use of ‘print’ | |
In the expression: | |
((Data.UnitsOfMeasure.Internal.MkQuantity :: | |
forall a_a4cE. a_a4cE -> Quantity a_a4cE (MkUnit "m") | |
3) :: | |
Quantity Int (MkUnit "m")) | |
In an equation for ‘main’: | |
main | |
((Data.UnitsOfMeasure.Internal.MkQuantity :: | |
forall a_a4cE. a_a4cE -> Quantity a_a4cE (MkUnit "m") | |
3) :: | |
Quantity Int (MkUnit "m")) | |
(7.10.1)nushio@nuwheezy:uom-plugin$ | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment