module Main where
import Daml.Script
newtype MyBounded = MyBounded Int deriving (Show, Enum)
instance Bounded MyBounded where
minBound = MyBounded 18
maxBound = MyBounded 65
setup : Script ()
setup = script do
debug $ ([minBound..maxBound] : [MyBounded])
return ()
prints
[MyBounded 18,MyBounded 19,MyBounded 20,MyBounded 21,MyBounded 22,MyBounded 23,MyBounded 24,MyBounded 25,MyBounded 26,MyBounded 27,MyBounded 28,MyBounded 29,MyBounded 30,MyBounded 31,MyBounded 32,MyBounded 33,MyBounded 34,MyBounded 35,MyBounded 36,MyBounded 37,MyBounded 38,MyBounded 39,MyBounded 40,MyBounded 41,MyBounded 42,MyBounded 43,MyBounded 44,MyBounded 45,MyBounded 46,MyBounded 47,MyBounded 48,MyBounded 49,MyBounded 50,MyBounded 51,MyBounded 52,MyBounded 53,MyBounded 54,MyBounded 55,MyBounded 56,MyBounded 57,MyBounded 58,MyBounded 59,MyBounded 60,MyBounded 61,MyBounded 62,MyBounded 63,MyBounded 64,MyBounded 65]