packages feed

keiro-dsl-0.6.0.0: test/conformance-replay/Generated/ReplayDivergence/Note/Domain.hs

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -Wno-unused-top-binds #-}

-- @generated by keiro-dsl; do not edit. Regenerated from the .keiro spec.
module Generated.ReplayDivergence.Note.Domain where

import Data.Proxy (Proxy (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Keiki.Core (RegFile (..))
import Keiki.Generics.TH (deriveAggregateCtorsAll, deriveWireCtorsAll)

data NoteVertex = NoteEmpty | NoteRecorded
    deriving stock (Generic, Eq, Ord, Show, Enum, Bounded)

data WriteNoteData = WriteNoteData
    { noteText :: !Text
    , echo :: !Text
    }
    deriving stock (Generic, Eq, Show)

data NoteCommand = WriteNote !WriteNoteData
    deriving stock (Generic, Eq, Show)

data NoteWrittenData = NoteWrittenData
    { noteText :: !Text
    , echo :: !Text
    }
    deriving stock (Generic, Eq, Show)

data NoteEvent = NoteWritten !NoteWrittenData
    deriving stock (Generic, Eq, Show)

type NoteRegs =
    '[ '("note", Text)
     ]

initialNoteRegs :: RegFile NoteRegs
initialNoteRegs =
    RCons (Proxy @"note") "" RNil

$(deriveAggregateCtorsAll ''NoteCommand ''NoteRegs)

$(deriveWireCtorsAll ''NoteEvent)