blob: 5836afdd959a2fbe69538da6246d6c502df4129e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
module Serial (Serial, start, next) where
import Data.Eq
import Data.Hashable
import Data.Ord
import GHC.Generics as Export (Generic(..))
import Numeric.Natural
import Prelude (Num(..))
import Text.Show
newtype Serial = Serial Natural deriving (Show, Eq, Ord, Generic, Hashable)
start :: Serial
start = Serial 0
next :: Serial -> Serial
next (Serial k) = Serial (k + 1)
|