Permalink
Browse files

improve example

  • Loading branch information...
1 parent b726a7c commit 9b51fbd89ff9260fda44ddce083e0a2eb53cd8d8 @mikeplus64 committed Dec 15, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/Example.hs
View
@@ -1,6 +1,7 @@
{-# LANGUAGE TypeOperators, DataKinds, QuasiQuotes #-}
import Data.Record
import Data.IORef
+import GHC.TypeLits
type Point
= '[ "x" := Double
@@ -11,12 +12,11 @@ type Point
op :: Record P Point
op = 0 & 0 & 0 & (0,0,0) & end
-p :: Record (IO :. IORef) Point
-p = box (compose newIORef) op
-
main :: IO ()
main = do
-
- print "yes"
-
+ point <- runcomp newIORef op
+ print =<< readIORef ([get|x|] point)
+ print =<< readIORef ([get|y|] point)
+ print =<< readIORef ([get|z|] point)
+ print =<< readIORef ([get|colour|] point)

0 comments on commit 9b51fbd

Please sign in to comment.