-
Notifications
You must be signed in to change notification settings - Fork 0
/
Types.purs
30 lines (20 loc) · 842 Bytes
/
Types.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module MVC.Record.Types
( RecordMsg(..)
, RecordState(..)
) where
import Prelude
import Data.Generic.Rep (class Generic)
import Data.Show.Generic (genericShow)
import Data.Variant (class VariantEqs, class VariantShows, Variant)
import Data.Variant.Internal (class VariantTags)
import Prim.RowList (class RowToList)
newtype RecordState r = RecordState (Record r)
newtype RecordMsg r = SetField (Variant r)
derive instance Generic (RecordMsg r) _
derive newtype instance (RowToList r rl, VariantTags rl, VariantEqs rl) => Eq (RecordMsg r)
instance (RowToList r rl, VariantTags rl, VariantShows rl) => Show (RecordMsg r) where
show = genericShow
derive instance Generic (RecordState r) _
derive newtype instance (Eq (Record r)) => Eq (RecordState r)
instance (Show (Record r)) => Show (RecordState r) where
show = genericShow