{-# LANGUAGE GeneralizedNewtypeDeriving, RankNTypes #-}
module Game.LambdaHack.Common.KindOps
( Id(Id), Ops(..)
) where
import Prelude ()
import Game.LambdaHack.Common.Prelude
import Data.Binary
import Game.LambdaHack.Common.Misc
import Game.LambdaHack.Common.Random
newtype Id c = Id Word16
deriving (Show, Eq, Ord, Enum, Bounded, Binary)
data Ops a = Ops
{ okind :: !(Id a -> a)
, ouniqGroup :: !(GroupName a -> Id a)
, opick :: !(GroupName a -> (a -> Bool) -> Rnd (Maybe (Id a)))
, ofoldrWithKey :: !(forall b. (Id a -> a -> b -> b) -> b -> b)
, ofoldlWithKey' :: !(forall b. (b -> Id a -> a -> b) -> b -> b)
, ofoldlGroup' :: !(forall b.
GroupName a -> (b -> Int -> Id a -> a -> b) -> b -> b)
, olength :: !Int
}