Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add comments for stdout

  • Loading branch information...
commit 4bc12755dfbe67a74c23b41fd468a8066caf931b 1 parent c073589
Mike Ledger authored

Showing 1 changed file with 14 additions and 4 deletions. Show diff stats Hide diff stats

  1. +14 4 src/Example.hs
18 src/Example.hs
... ... @@ -1,7 +1,8 @@
1 1 {-# LANGUAGE TypeOperators, DataKinds, QuasiQuotes #-}
2 2 import Data.Record
3 3 import Data.IORef
4   -import GHC.TypeLits
  4 +import Data.Monoid
  5 +import GHC.TypeLits -- I get a GHC panic without this module
5 6
6 7 type Point
7 8 = '[ "x" := Double
@@ -41,18 +42,27 @@ main = do
41 42 print frozenPoint
42 43 -- 0.0 & 1.0 & 2.0 & (255,255,0) & end
43 44
44   - let greg :: Record User
  45 + let greg, tony :: Record User
45 46 greg = "GREG" & "Sir Greg of Gerg" & "Male" & "Gregland" & end
  47 + tony = "Scarface" & "Tony Montana" & "Male" & "Cuba" & end
46 48
47 49 makeSpy :: Record User -> RecordT Maybe User
48 50 makeSpy = [set|real name|] Nothing . box Just
49 51
50 52 print greg
51 53 -- "GREG" & "Sir Greg of Gerg" & "Male" & "Gregland" & end
52   -
  54 + print tony
  55 + -- "Scarface" & "Tony Montana" & "Male" & "Cuba" & end
53 56 print (makeSpy greg)
54 57 -- Just "GREG" & Nothing & Just "Male" & Just "Gregland" & end
55   -
  58 + print (makeSpy tony)
  59 + -- Just "Scarface" & Nothing & Just "Male" & Just "Cuba" & end
56 60 print (run (makeSpy greg))
  61 + -- Nothing
  62 + print (run (makeSpy tony))
  63 + -- Nothing
  64 + print (greg <> tony)
  65 + -- "GREGScarface" & "Sir Greg of GergTony Montana" & "MaleMale" & "GreglandCuba" & end
  66 + print (run (makeSpy greg) <> run (makeSpy tony))
57 67 -- Nothing
58 68

0 comments on commit 4bc1275

Please sign in to comment.
Something went wrong with that request. Please try again.