Ticket #7489: test.hs

File test.hs, 576 bytes (added by portnov, 16 months ago)

Near to minimal example

Line 
1{-# LANGUAGE EmptyDataDecls, GADTs, TypeFamilies #-}
2
3data Credit
4data Debit
5
6data Posting t where
7  Posting :: {
8    debitPostingAccount :: Account Locked Debit
9  } -> Posting Debit
10
11data Locked
12data Unlocked
13
14data family Account s t
15
16data instance Account Locked t = LockedAccount {
17    accountContent :: (Account Unlocked t) }
18
19data instance Account Unlocked t where
20  CAccount :: {
21    creditAccountPostings :: [Posting Credit]
22  } -> Account Unlocked Credit
23
24  DAccount :: {
25    debitAccountPostings :: [Posting Debit]
26  } -> Account Unlocked Debit
27
28main = print "Hello"